The HLW8032 is a high-precision energy metering IC that is primarily used in single-phase applications. It measures line voltage and current and active power. It allows calculating apparent power and power factors.

HLW8032 can use two measuring methods: isolated and not isolated.

Note 1: Both measuring methods are sensitive for correct AC input connection. Please, swap L and N wires if you get strange results.

Note 2: ⚠️⚠️⚠️ High voltage hazard!

Not isolated measuring

This method does use any transformers and the MCU side is separated from the AC side using optocouplers.

Voltage coefficient: 1.88
Current coefficient: 1

Advantages of this HLW8032 board:

  • Easy-to-use.
  • All coefficients are known.
  • The board has a reference schematic.
  • You can find a 3rd party software for this board to read values. The access password is i59p.
  • A library for Arduino.

Isolated measuring

Using this measuring method, the MCU side is separated from the AC side using voltage and current transformers.

I’ve tested this board too. It looks less precise than the non-isolated version. Also, you should measure and set coefficients for current and voltage. To do that, you should measure AC voltage using a multimeter, then connect a load with a known value (e.g., a 100W lamp), calculate current. Then get results, compare with your initial values and calculate a coefficient.

Voltage coefficient: 20.5
Current coefficient: 0.96

HLW8032. Isolated measuring.

Disadvantages (in comparison with the board above):

  • Less accurate.
  • No power supply.
  • It is necessary to measure and calculate coefficients.

The firmware settings

You should connect the “TX” pin of boards to the “P02” pin on CC2530 or CC2531.

  1. Select the HLW8032 board type (isolated or not).
  2. Specify coefficients for your board (see above).
HLW8032. Zigbee firmware settings
Firmware settings

Harvey Specter
Posted at 06:56 June 25, 2022

I just did quick test HLW8032 Non-Isolated with CC2530 + CC2592, using Output1 pin P02 (fw: 2022-06-06). I applied a custom converter generated by the app. It looks fine for measurement of Voltage, current, power, and power factor on z2m dashboard, such as 3.2A, 230.5V, 694.3W, 0.9 cosf . However, for energy measurement, It starts displaying 0 Wh, increase to 0.1 Wh, 0.2 Wh, 0.3 Wh, and always back to 0 Wh respectively for around time interval(30 minutes). When the zigbee device is restarted, it is always back to 0 Wh. I would like to know, whether it is actually designed like that ,or is something wrong in my setting.
Another, in my opinion, It should have displayed as kWh unit, not Wh.

    Harvey Specter
    Posted at 11:58 June 25, 2022

    The firmware just reads values. I think you can read a datasheet for hlw8032 to get more info.

Leave a Reply