The CT PZEM004T is a multifunctional energy meter designed to measure key electrical parameters such as voltage, current, power, energy, and frequency. It is commonly used in conjunction with current transformers (CTs) to monitor AC electrical systems. This component is ideal for applications requiring real-time energy monitoring, such as home automation, industrial energy management, and renewable energy systems.
The CT PZEM004T is a versatile and compact module with the following key specifications:
Parameter | Specification |
---|---|
Voltage Range | 80V - 260V AC |
Current Range | 0A - 100A (with external CT) |
Power Range | 0W - 22kW |
Energy Range | 0kWh - 9999kWh |
Frequency Range | 45Hz - 65Hz |
Communication Protocol | UART (9600 baud rate, 8N1 format) |
Power Supply | Self-powered (via measured AC voltage) |
Accuracy | ±0.5% |
Operating Temperature | -10°C to 60°C |
The CT PZEM004T module has a 4-pin interface for communication and power connections. Below is the pinout:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply for the module (5V DC) |
2 | GND | Ground connection |
3 | RX | UART Receive pin (connect to TX of microcontroller) |
4 | TX | UART Transmit pin (connect to RX of microcontroller) |
Additionally, the module includes terminals for connecting the AC voltage input and the current transformer (CT).
Terminal | Name | Description |
---|---|---|
1 | AC Voltage Input | Connect to the live and neutral wires of the AC system being measured |
2 | CT Input | Connect to the current transformer (CT) for current measurement |
Connect the AC Voltage Input:
Connect the Current Transformer (CT):
Connect to a Microcontroller:
TX
pin to the microcontroller's RX
pin and the RX
pin to the microcontroller's TX
pin.VCC
pin and connect the GND
pin to the microcontroller's ground.Install the Required Library:
Upload the Code:
#include <PZEM004T.h> // Include the PZEM004T library
// Define the RX and TX pins for the PZEM004T module
#define RX_PIN 10
#define TX_PIN 11
// Create a PZEM004T object
PZEM004T pzem(RX_PIN, TX_PIN);
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
Serial.println("PZEM004T Energy Meter Example");
}
void loop() {
// Read voltage
float voltage = pzem.voltage();
if (voltage < 0) {
Serial.println("Error reading voltage!");
} else {
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
}
// Read current
float current = pzem.current();
if (current < 0) {
Serial.println("Error reading current!");
} else {
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
}
// Read power
float power = pzem.power();
if (power < 0) {
Serial.println("Error reading power!");
} else {
Serial.print("Power: ");
Serial.print(power);
Serial.println(" W");
}
// Read energy
float energy = pzem.energy();
if (energy < 0) {
Serial.println("Error reading energy!");
} else {
Serial.print("Energy: ");
Serial.print(energy);
Serial.println(" kWh");
}
// Wait for 1 second before the next reading
delay(1000);
}
No Data Output:
Incorrect Readings:
Module Not Powering On:
Communication Errors:
Q: Can the CT PZEM004T measure DC systems?
A: No, the module is designed specifically for AC systems and cannot measure DC voltage or current.
Q: What is the maximum current the module can measure?
A: The module can measure up to 100A when used with the appropriate current transformer (CT).
Q: Can I use multiple PZEM004T modules with a single microcontroller?
A: Yes, you can use multiple modules by assigning unique addresses to each module via the UART interface.
Q: Is the module compatible with 3.3V microcontrollers?
A: The module requires a 5V DC supply for UART communication. Use a level shifter if connecting to a 3.3V microcontroller.
By following this documentation, you can effectively integrate the CT PZEM004T into your energy monitoring projects.