Skip to content

Multiple PZEM-004T v3 on ESP32 zero/failed reads #145

@DurraniHakim27

Description

@DurraniHakim27

Multiple PZEM-004T v3 on ESP32 (mandulaj/PZEM004Tv30) — individual OK, combined → zero/failed reads

Hello! thanks for the library. I’m seeing a reproducible issue when connecting multiple original PZEM-004T v3 meters to a single ESP32 UART using your PZEM004Tv30 library. Each meter works correctly when connected alone, but once I attach more than one meter to the same RX/TX pair, all meters return zero values or fail to read. I already assigned unique addresses for each PZEM. Details below.

Hardware & wiring

  • MCU: ESP32 DevKit
  • PZEM Serial: Serial2 (example: RX = GPIO16, TX = GPIO17) — PZEM modules operate at 9600 baud (open Serial Monitor at 115200 for logs)
  • PZEM modules: 5 × PZEM-004T v3 (original)
  • Addresses assigned: 0x01, 0x02, 0x03, 0x04, 0x05 (I verified each responds when connected alone)
  • Power: common 5V supply for PZEMs; common ground tied to ESP32
  • Wiring: PZEM TX lines tied to ESP RX; PZEM RX lines tied to ESP TX (all modules on same TTL pair)
Image

Observed behavior

Single meter connected: works perfectly.

Addr 0x01 RESPONDED: V=232.40 V, I=0.171 A, P=21.70 W, E=0.050 kWh, F=50.0 Hz, PF=0.53

Two or more meters connected to the same UART: all return zeros or fail.

Addr 0x01 READ_FAILED (dt=55 ms)
Addr 0x02 READ_FAILED (dt=50 ms)
...or sometimes:
Addr 0x02 RESPONDED: V=0.00 V, I=0.000 A, P=0.00 W, F=0.0 Hz, PF=0.00

I also tried scanning addresses 0x01–0xF7 while multiple meters were connected. When tested singly, each replied correctly, but with others connected, no valid responses were received.

What I tried

  • Confirmed all devices have unique addresses and share common ground.
  • Verified each device individually works on the same UART.
  • Added inter-read delays (100–500 ms) and sequential polling logic.
  • Tried powering via both ESP32 5 V and external regulated 5 V (same result).

Questions

  1. Does the ESP32 have limits on how many PZEM modules it can handle on the same UART port?
  2. Should I consider switching to ESP8266 instead for better compatibility?
  3. Or do I need to add any extra components (e.g. diode, resistors, transistors) to make multi-device communication stable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions