Difference between revisions of "Energy meter"

From ElectroDragon
Jump to: navigation, search
Line 1: Line 1:
 
<accesscontrol>CM</accesscontrol>
 
<accesscontrol>CM</accesscontrol>
 
== HLW8012 ==
 
== HLW8012 ==
 +
* Note: Power supply of HLW8012 and AC Mian Live and natural should be NOT isolated.
 +
* Note: Better use optical-coupler to send signal to your MCU, this make it isolated. MCU shared power supply with HLW8012 is not a good idea.
 +
 
===HLW8012 Pin Definition===
 
===HLW8012 Pin Definition===
 
* High-frequency pulse '''CF''', indicating active power, in the range of 1000: 1 to achieve ± 0.3% accuracy
 
* High-frequency pulse '''CF''', indicating active power, in the range of 1000: 1 to achieve ± 0.3% accuracy

Revision as of 07:44, 8 August 2017

This is a protected page.

HLW8012

  • Note: Power supply of HLW8012 and AC Mian Live and natural should be NOT isolated.
  • Note: Better use optical-coupler to send signal to your MCU, this make it isolated. MCU shared power supply with HLW8012 is not a good idea.

HLW8012 Pin Definition

  • High-frequency pulse CF, indicating active power, in the range of 1000: 1 to achieve ± 0.3% accuracy
  • High frequency pulse CF1, indicating current or voltage rms, using SEL selection, ± 0.5% accuracy in the 500: 1 range
  • Built-in crystal, 2.43V voltage reference source and power monitoring circuit
  • 5V single power supply, operating current less than 3mA

Caculation

HLW8012 calibration.png
  • Fcf = Power, Fcf1 = current, Fcfu = voltage
  • V1: Voltage signal on the current channel pin
  • V2: Voltage signal on voltage channel pin
  • Fosc: built-in crystal, the typical frequency of about 3.579MHz;
  • Vref: built-in reference source, the typical voltage is 2.43V

Use with ESP8266

  • Download demo code from our github
  • The demo code will monitoring the power, current, voltage and frequency, you can monitor it via telnet to see remote debug output, same as serial output, but safe when AC main power connected.
  • Pin definition to esp8266 please see the comments in sketch
  • Also can calibrate the parameters, see the comments in sketch
  • Enter SSID and password in the sketch, run the demo code first to see IP address
  • Connect to AC main power, login remotely via telnet, in windows for example, command: telnet 192.168.0.100

Documents

HLW8012 Documents

BL0937

Schematic

  • Demo -1: on board sample resistor is 0.002R, 2mR, diameter 2.5mm, rate current is 20A. space is 10mm, height 7.5mm, "door" shape.
  • Demo -2 PCB File

Demo Video

Other Reference

Demo Code ESP8266

Demo Code STM32

Energy monitor ICs:

  • ATT7309
  • ADE7758
  • 锰铜取样电阻
  • CS5460