

The PZEM-004T is a digital power meter designed for monitoring and measuring key electrical parameters in AC circuits. It provides real-time data on voltage, current, power, energy consumption, and frequency. This module communicates via UART (Universal Asynchronous Receiver-Transmitter), making it easy to integrate with microcontrollers such as the Arduino UNO.








The following table outlines the key technical details of the PZEM-004T module:
| Parameter | Value |
|---|---|
| Voltage Measurement | 80V - 260V AC |
| Current Measurement | 0A - 100A (with external current transformer) |
| Power Measurement | 0W - 22kW |
| Energy Measurement | 0Wh - 9999kWh |
| Frequency Measurement | 45Hz - 65Hz |
| Communication Protocol | UART (9600 baud rate) |
| Power Supply | 5V DC |
| Accuracy | ±0.5% |
The PZEM-004T module has the following pinout:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (5V DC). |
| GND | Ground connection. |
| TX | UART Transmit pin (connects to RX of the microcontroller). |
| RX | UART Receive pin (connects to TX of the microcontroller). |
| AC Input | Connects to the live and neutral wires of the AC circuit for measurement. |
Note: Ensure proper isolation and safety precautions when connecting the module to AC mains.
Below is an example Arduino sketch to interface the PZEM-004T with an Arduino UNO:
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial pzemSerial(10, 11); // RX = Pin 10, TX = Pin 11
// PZEM-004T communication commands
byte readCommand[] = {0xB0, 0xC0, 0xA8, 0x01, 0x01, 0x00, 0x1A};
// Function to send a command to the PZEM-004T
void sendCommand(byte *command, int length) {
for (int i = 0; i < length; i++) {
pzemSerial.write(command[i]);
}
}
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
pzemSerial.begin(9600); // Initialize SoftwareSerial for PZEM-004T
delay(100); // Allow time for initialization
}
void loop() {
sendCommand(readCommand, sizeof(readCommand)); // Send read command
delay(100); // Wait for response
// Check if data is available from the PZEM-004T
if (pzemSerial.available()) {
Serial.println("Data received:");
while (pzemSerial.available()) {
byte data = pzemSerial.read();
Serial.print(data, HEX); // Print data in hexadecimal format
Serial.print(" ");
}
Serial.println();
} else {
Serial.println("No data received.");
}
delay(1000); // Wait 1 second before the next read
}
Note: This code demonstrates basic communication with the PZEM-004T. For advanced functionality, consider using a dedicated library such as the
PZEM004Tlibrary available in the Arduino IDE Library Manager.
| Issue | Possible Cause | Solution |
|---|---|---|
| No data received from the module | Incorrect UART connections or baud rate mismatch | Verify TX and RX connections and ensure the baud rate is set to 9600. |
| Inaccurate readings | Improper current transformer placement | Ensure the CT is clamped around the live wire only. |
| Module not powering on | Insufficient or unstable power supply | Use a stable 5V DC power source. |
| Communication errors | Electrical noise or long UART cable | Use shorter cables and ensure proper grounding. |
Can the PZEM-004T measure DC circuits?
What is the maximum current the module can measure?
Can I use multiple PZEM-004T modules with one Arduino?
Is the module safe to use with high-voltage circuits?
By following this documentation, you can effectively integrate the PZEM-004T into your energy monitoring projects.