Working Principle
The PZEM-004T is an all-in-one AC electrical parameter measurement module that measures voltage, current, power, energy (kWh), frequency, and power factor simultaneously. It uses a current transformer (CT) clamp around the live wire for non-invasive current measurement and a built-in voltage divider for AC voltage sensing. An on-board MCU computes all parameters and outputs them via UART (Modbus-RTU protocol).
Key advantage: The PZEM-004T provides 6 electrical parameters from a single module with no analog signal conditioning required — just serial communication.
Electrical Characteristics
| Parameter | Range | Resolution |
|---|---|---|
| Voltage | 80–260 V AC | 0.1 V |
| Current | 0–100 A (with CT) | 0.001 A |
| Active Power | 0–23 kW | 0.1 W |
| Energy | 0–9999.99 kWh | 1 Wh |
| Frequency | 45–65 Hz | 0.1 Hz |
| Power Factor | 0.00–1.00 | 0.01 |
| Interface | UART (9600 baud, Modbus-RTU) | — |
| Supply | Same mains connection | — |
Interfacing with an MCU
Connect the PZEM-004T’s UART TX/RX to the MCU serial port (use SoftwareSerial on Arduino). The CT clamp clips around the live wire — no need to break the circuit. Mains voltage connects directly to the module’s AC terminals.
Calibration
- Factory calibrated: The PZEM-004T ships pre-calibrated; no user calibration needed for typical accuracy (±1%)
- CT ratio: Ensure the CT matches the module version (100A CT for v3.0)
- Energy reset: The kWh counter can be reset via a Modbus command
- Address configuration: Multiple modules can share one bus with unique Modbus addresses (1–247)
Code Example
/*
* PZEM-004T AC Energy Meter — Arduino
* Library: PZEM004Tv30 (install via Library Manager)
* Wiring: TX → Pin 10 (SoftRX), RX → Pin 11 (SoftTX)
* AC: L & N to module terminals, CT around live wire
*/
#include <PZEM004Tv30.h>
#include <SoftwareSerial.h>
SoftwareSerial pzemSerial(10, 11); /* RX, TX */
PZEM004Tv30 pzem(pzemSerial);
void setup() {
Serial.begin(9600);
Serial.println("PZEM-004T AC Energy Meter Ready");
}
void loop() {
float voltage = pzem.voltage();
float current = pzem.current();
float power = pzem.power();
float energy = pzem.energy();
float freq = pzem.frequency();
float pf = pzem.pf();
if (!isnan(voltage)) {
Serial.print(voltage, 1); Serial.print("V ");
Serial.print(current, 2); Serial.print("A ");
Serial.print(power, 1); Serial.print("W ");
Serial.print(energy, 2); Serial.print("kWh ");
Serial.print(freq, 1); Serial.print("Hz PF=");
Serial.println(pf, 2);
} else {
Serial.println("Error reading PZEM (check wiring)");
}
delay(2000);
}
Real-World Applications
Smart Metering & Home Energy Monitoring
PZEM-004T is widely used in DIY smart energy monitors, solar inverter monitoring, EV charging station metering, industrial machine power profiling, and home automation systems (with ESP8266/ESP32 + MQTT for cloud dashboards). Commercial submetering applications use multiple modules on a Modbus bus for per-circuit energy tracking.
Limitations
- Mains voltage hazard: Direct connection to AC mains requires proper safety measures and enclosure.
- No isolation: UART side is not isolated; use optocouplers for safety.
- Single phase only: Cannot measure 3-phase systems (need 3 units).
- CT accuracy: The included CT limits accuracy at very low currents (<0.5 A).