Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Everything about electronics
Everything about electronics

Introduction
The HLW8012 is a highly integrated single-phase energy metering IC designed for real-time measurement of AC voltage, current, power, and energy consumption.
Manufactured by Hi-Link, this IC is popular in IoT-based smart plugs, smart meters, and home automation systems due to its compact design, digital output interface, and cost efficiency.
Unlike traditional analog metering chips, the HLW8012 directly provides pulse outputs proportional to active power and RMS current, simplifying interface with microcontrollers like ESP8266, ESP32, or Arduino.
⚙️ Key Features
(adsbygoogle = window.adsbygoogle || []).push({});
️ Pin Configuration of HLW8012
|
Pin No. |
Name |
Type |
Description |
|
1 |
V2P |
Input |
Voltage sensing input (connected via resistor divider from AC line) |
|
2 |
V2N |
Input |
Negative reference for voltage channel |
|
3 |
IP |
Input |
Current sense input from current shunt resistor |
|
4 |
IN |
Input |
Negative reference for current channel |
|
5 |
SEL |
Input |
Selects CF1 output mode:• High = Current output• Low = Voltage output |
|
6 |
CF1 |
Output |
Frequency output proportional to current or voltage (based on SEL pin) |
|
7 |
CF |
Output |
Frequency output proportional to active power |
|
8 |
REVP |
Output |
Reverse polarity indicator (High if reverse power detected) |
|
9 |
VDD |
Power |
Positive supply voltage (typically 5V) |
|
10 |
GND |
Power |
Ground reference |
Working Principle
The HLW8012 works by sampling voltage and current waveforms via internal ADCs.
Interfacing HLW8012 with Microcontroller
Typically, HLW8012 is connected to an ESP8266 or ESP32 as follows:
A microcontroller measures the pulse frequency, computes the ratio with calibration constants, and displays the power, current, voltage, and energy on a web dashboard or LCD.
(adsbygoogle = window.adsbygoogle || []).push({});
Typical Calibration Formula
After interfacing, you can derive readings as:
where
Applications
⚡ Advantages
(adsbygoogle = window.adsbygoogle || []).push({});
⚠️ Precautions