Peacefair PZEM-004T v3.0 Modbus to the cloud with an ESP32
The hobbyist single-phase AC energy monitor: a PCB with a split-core CT, sold with a TTL serial header. It speaks Modbus RTU, so through a TTL-to-RS-485 adapter (or the RS-485 version of the board) it reads like any other meter.
The Synacl ESP32 gateway reads the Peacefair PZEM-004T v3.0 over Modbus RTU (RS-485). This catalog entry carries the register map, scaling and connection defaults below, so adding it in the app is a pick from a list rather than a form filled in from the datasheet — and it is the same data an AI agent gets from the list_catalog MCP tool.
Needs a recent gateway firmware — 16-bit signed and 32-bit (int32 / float32) Modbus registers. The app warns when the selected gateway is older; update it from the gateway page first.
Registers · 6 tags
| Tag | Unit | Address (hex / dec) | Function | Format | Word order | Scale |
|---|---|---|---|---|---|---|
Voltagevoltage_r_phase | V | 0x0000 / 0 | FC04 input register | uint16 | — | × 0.1 |
Currentcurrent_r_phase | A | 0x0001 / 1 | FC04 input register | uint32 | low word first (CDAB) | × 0.001 |
Active powerpower_active_total | W | 0x0003 / 3 | FC04 input register | uint32 | low word first (CDAB) | × 0.1 |
Energyenergy_import_active | kWh | 0x0005 / 5 | FC04 input register | uint32 | low word first (CDAB) | × 0.001 |
Frequencyfrequency_grid | Hz | 0x0007 / 7 | FC04 input register | uint16 | — | × 0.1 |
Power factorpower_factor_total | — | 0x0008 / 8 | FC04 input register | uint16 | — | × 0.01 |
Addresses are 0-based wire addresses — what goes in the request frame — shown as hex and decimal. A datasheet that numbers registers from 30001 / 40001 is one higher. 32-bit values occupy two consecutive registers. Engineering value = raw × scale + offset; the gateway sends the raw reading and Synacl scales it.
Connection defaults
| Baud rate | 9600 |
|---|---|
| Framing | 8N1 — 8 data bits, no parity, 1 stop bit |
| Unit ID (slave address) | 1 |
Wiring
The v3 board's 5 V TTL header (5V, RX, TX, GND) needs a TTL↔RS-485 converter before it can join the gateway's RS-485 bus: converter A to the gateway's A, B to B, GND common. Power the board's TTL side from 5 V. The CT clamps around ONE conductor (live or neutral, not both).
Notes
- 9600 baud, 8N1. The board answers unit ID 1 by default, and also the general address 0xF8 (248) from any single unit on the bus — handy for the first read, but use the real ID once more than one board shares the bus.
- Current, power and energy are 32-bit values with the LOW word at the lower address (word order little); voltage, frequency and power factor are single registers. This entry needs gateway firmware that reports the modbusFormats capability.
- Raw units are 0.1 V, 0.001 A, 0.1 W, 1 Wh, 0.1 Hz and 0.01 PF; the scale factors here turn them into V, A, W, kWh, Hz and PF.
- Energy is the board's accumulated active energy since its last reset; it is filed under Import active energy.
- Derived from the vendor's register table, not yet bench-verified on this platform. If a reading does not match, report the mismatch.
Set it up in three steps
- Flash the gateway from the browser
Plug an ESP32 dev board into USB, open the free web flasher in Chrome or Edge and write the Synacl gateway firmware. It asks for Wi-Fi and pairs the gateway with your account — nothing to install, about two minutes. - Add the Peacefair PZEM-004T v3.0 from the catalog
In the app open Devices → Add device and choose “Start from a catalog device”, then pick Peacefair PZEM-004T v3.0. The Modbus RTU (RS-485) settings and every tag in the table above are filled in; choose the gateway it is wired to, change the unit ID or baud rate if yours differs, and save. How the catalog picker works → - Watch the live data arrive
The gateway receives the new configuration over MQTT within seconds and starts polling. Readings show on the device page and in any dashboard widget you bind to them; add a rule for alerts, keep history for reports, or let an AI agent read it over MCP.
How this entry was verified
Datasheet-derived — derived from the vendor datasheet and not yet confirmed on hardware — please report a mismatch.
Bench-verified means Synacl ran this entry on real hardware. Datasheet-derived means the map was transcribed from the vendor's documentation, so a register may be off by one or in the other word order on your unit — a two-line email fixes it for everyone.
Report a register mismatch · Vendor datasheet ↗ · All catalog devices
Try it on your own hardware
Synacl is free for five devices — no card, no sales call. Flash a gateway from the browser, add the Peacefair PZEM-004T v3.0 from the catalog, and see live data in a few minutes.