Back to Sensors & Actuators Series

AC Energy Meter Module: PZEM-004T

April 10, 2026 Wasil Zafar 8 min read

PZEM-004T deep dive — CT-based AC power measurement, Modbus-RTU protocol, Arduino code, and smart home energy monitoring.

Contents

  1. Working Principle
  2. Electrical Characteristics
  3. Interfacing with MCU
  4. Calibration
  5. Code Example
  6. Real-World Applications
  7. Limitations

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

ParameterRangeResolution
Voltage80–260 V AC0.1 V
Current0–100 A (with CT)0.001 A
Active Power0–23 kW0.1 W
Energy0–9999.99 kWh1 Wh
Frequency45–65 Hz0.1 Hz
Power Factor0.00–1.000.01
InterfaceUART (9600 baud, Modbus-RTU)
SupplySame 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.

DANGER — Mains voltage: The PZEM-004T connects directly to 110/220 V AC mains. Use proper insulation, enclosures rated for mains voltage, and never touch exposed connections. This module should only be handled by experienced individuals.
Isolation: The UART side is NOT galvanically isolated from mains. For safety, use an optocoupler between the PZEM and your MCU.

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.

Smart MeterSolarHome EnergyModbus

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).