Skip to main content

HLW8032

Overview

The TBox uses the HLW8032 energy measurement IC to monitor mains voltage, current, active power and accumulated energy.

The IC continuously transmits measurement telegrams over an asynchronous UART interface. No commands are required from the TBox. The firmware continuously receives and validates each telegram before updating the process values.

Serial Interface

ParameterValue
InterfaceUART
CommunicationUnidirectional (HLW8032 → TBox)
Baud Rate4800 Baud
Data Bits8
ParityNone
Stop Bits1
Bit OrderLSB First
Frame Format8N1
TransmissionContinuous

Telegram Structure

Each telegram consists of 24 bytes.

ByteDescription
0Header
1State Register
2Voltage Register (MSB)
3Voltage Register
4Voltage Register (LSB)
5Current Register (MSB)
6Current Register
7Current Register (LSB)
8Power Register (MSB)
9Power Register
10Power Register (LSB)
11Energy Register (MSB)
12Energy Register
13Energy Register (LSB)
14Data Register
15Data Register
16Data Register
17Data Register
18Data Register
19Data Register
20Data Register
21Data Register
22Checksum
23End Byte

Measured Values

The following process values are calculated from the received telegram.

ValueUnit
VoltageV
CurrentA
Active PowerW
EnergykWh

Data Validation

Before a telegram is processed, the firmware verifies:

  • Correct header
  • Valid checksum
  • Valid register values
  • No UART framing errors

Invalid telegrams are discarded.

Firmware Implementation

The HLW8032 driver is implemented as a dedicated firmware module.

Functions:

  • Continuous UART reception
  • Telegram parsing
  • CRC / checksum verification
  • Conversion to engineering units
  • Energy accumulation
  • Peak filtering before database update