

The PZEM-004T is a multifunctional energy meter designed for monitoring and measuring key electrical parameters in AC circuits. It can measure voltage, current, power, energy consumption, frequency, and power factor with high accuracy. The module communicates via UART (Universal Asynchronous Receiver-Transmitter), making it easy to interface with microcontrollers and other devices.
This component is widely used in energy monitoring systems, smart home applications, industrial automation, and other projects requiring real-time electrical parameter monitoring.








The PZEM-004T module has a 4-pin interface for communication and power, as well as terminals for AC input and the current transformer (CT).
| Pin Name | Description |
|---|---|
| VCC | 5V DC power supply input |
| GND | Ground connection |
| TX | UART Transmit pin (connects to RX of the microcontroller) |
| RX | UART Receive pin (connects to TX of the microcontroller) |
| Terminal Name | Description |
|---|---|
| AC Input | Connects to the live and neutral wires of the AC circuit being measured |
| CT Input | Connects to the external current transformer for current measurement |
Below is an example Arduino sketch to interface with the PZEM-004T and read its measurements:
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial pzemSerial(10, 11); // RX = pin 10, TX = pin 11
// UART command to request data from PZEM-004T
byte requestCommand[] = {0xB4, 0xC0, 0xA8, 0x01, 0x01, 0x00, 0x1E};
// Buffer to store response from PZEM-004T
byte response[7];
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
pzemSerial.begin(9600); // Initialize SoftwareSerial for PZEM-004T
Serial.println("PZEM-004T Energy Meter");
}
void loop() {
// Send request command to PZEM-004T
pzemSerial.write(requestCommand, sizeof(requestCommand));
// Wait for response
delay(100);
// Read response from PZEM-004T
if (pzemSerial.available() >= 7) {
for (int i = 0; i < 7; i++) {
response[i] = pzemSerial.read();
}
// Extract voltage, current, and power from response
float voltage = (response[0] << 8 | response[1]) / 10.0; // Voltage in volts
float current = (response[2] << 8 | response[3]) / 1000.0; // Current in amps
float power = (response[4] << 8 | response[5]) / 10.0; // Power in watts
// Print measurements to Serial Monitor
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
Serial.print("Power: ");
Serial.print(power);
Serial.println(" W");
Serial.println("-----------------------");
}
delay(1000); // Wait 1 second before next reading
}
No Data Received from the Module
Incorrect or Fluctuating Measurements
Module Not Powering On
Q: Can the PZEM-004T measure DC circuits?
A: No, the PZEM-004T is designed specifically for AC circuits and cannot measure DC voltage or current.
Q: Can I use multiple PZEM-004T modules with a single microcontroller?
A: Yes, you can use multiple modules by assigning unique addresses to each module and connecting them to different UART ports or using a multiplexer.
Q: What is the maximum distance for UART communication?
A: The maximum reliable distance for UART communication depends on the baud rate and cable quality, but it is typically around 15 meters for 9600 baud.
Q: How do I reset the energy reading to zero?
A: The energy reading can be reset by sending a specific UART command to the module. Refer to the module's datasheet for the reset command.