

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, and frequency with high accuracy. The module communicates via UART (Universal Asynchronous Receiver-Transmitter), making it easy to integrate 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 tracking.








The PZEM-004T has the following key technical specifications:
| Parameter | Value |
|---|---|
| Voltage Range | 80V - 260V AC |
| Current Range | 0 - 100A (with external current transformer) |
| Power Range | 0 - 22kW |
| Energy Range | 0 - 9999kWh |
| Frequency Range | 45Hz - 65Hz |
| Communication Protocol | UART (9600 baud rate) |
| Power Supply | 5V DC |
| Measurement Accuracy | ±0.5% |
The PZEM-004T module has a simple pinout for easy integration. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| VCC | 5V DC power supply input |
| GND | Ground connection |
| TX | UART Transmit pin (connects to RX of microcontroller) |
| RX | UART Receive pin (connects to TX of microcontroller) |
| AC Input | Connects to the live and neutral wires of the AC circuit for measurement |
Note: The module comes with an external current transformer (CT) for current measurement. Ensure the CT is properly connected to the load for accurate readings.
Below is an example Arduino sketch to read data from the PZEM-004T using a compatible library:
#include <PZEM004Tv30.h> // Include the PZEM-004T library
// Define the RX and TX pins for UART communication
#define RX_PIN 10
#define TX_PIN 11
// Create a PZEM object with the specified RX and TX pins
PZEM004Tv30 pzem(RX_PIN, TX_PIN);
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
Serial.println("PZEM-004T Energy Meter Example");
}
void loop() {
// Read voltage
float voltage = pzem.voltage();
if (!isnan(voltage)) {
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
} else {
Serial.println("Error reading voltage!");
}
// Read current
float current = pzem.current();
if (!isnan(current)) {
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
} else {
Serial.println("Error reading current!");
}
// Read power
float power = pzem.power();
if (!isnan(power)) {
Serial.print("Power: ");
Serial.print(power);
Serial.println(" W");
} else {
Serial.println("Error reading power!");
}
// Read energy
float energy = pzem.energy();
if (!isnan(energy)) {
Serial.print("Energy: ");
Serial.print(energy);
Serial.println(" kWh");
} else {
Serial.println("Error reading energy!");
}
// Wait for 1 second before the next reading
delay(1000);
}
Note: Install the PZEM004Tv30 library in the Arduino IDE before uploading the code. You can find it in the Library Manager.
No Data Received from the Module:
Incorrect Current or Power Readings:
Module Not Responding:
Error Messages in Arduino Serial Monitor:
Q: Can the PZEM-004T measure DC circuits?
A: No, the PZEM-004T is designed specifically for AC circuits and cannot measure DC parameters.
Q: Is it possible to reset the energy reading?
A: Yes, the energy reading can be reset via a specific UART command. Refer to the module's datasheet for details.
Q: Can I use multiple PZEM-004T modules with one microcontroller?
A: Yes, you can use multiple modules by assigning unique addresses to each module via UART commands.
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.
By following this documentation, you can effectively integrate and use the PZEM-004T energy meter in your projects.