The PZEM-004T V3, manufactured by Peacefair, is a versatile and compact energy meter designed for monitoring and measuring key electrical parameters in AC circuits. This module can measure voltage, current, power, energy, and frequency, making it an essential tool for energy management and monitoring systems. It features a UART interface for seamless communication with microcontrollers, enabling integration into IoT and automation projects.
Explore Projects Built with PZEM-004T V3
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This is a smart environmental monitoring and control system featuring an ESP32 microcontroller interfaced with a PZEM004T for power monitoring, relay modules for actuating bulbs and a fan, and an LCD for user interface. It includes flame, gas, and vibration sensors for safety monitoring purposes.
This circuit is a smart power monitoring and control system using an ESP32 microcontroller. It features multiple sensors and components, including PZEM-004T AC modules for voltage and current measurement, DS18B20 temperature sensors, an LCD for display, and solid-state relays for controlling power outlets. The system is integrated with Blynk for remote monitoring and control, and includes pushbuttons for local interaction.
This circuit is designed to monitor electrical parameters using the PZEM004t sensor and display the data on a 0.96" OLED screen. The esp8266 nodemcu serves as the central controller, interfacing with the PZEM004t sensor via serial communication (RX/TX) and with the OLED display through an I2C connection (SCK/SDA). A 5V adapter provides power to the circuit, with the nodemcu regulating down to 3.3V for the OLED display and the PZEM004t sensor receiving 5V directly.
This circuit features an ESP32 microcontroller interfaced with a PZEM004T power monitoring module and a 4-channel relay module controlling multiple AC LED bulbs. The ESP32 uses GPIO pins to control the relays, which in turn switch the LED bulbs on and off. The PZEM004T is connected to the ESP32 for communication and to a current sensor for monitoring power consumption of the connected load through the relay contacts.
Below are the key technical details of the PZEM-004T V3:
Parameter
Specification
Voltage Range
80V - 260V AC
Current Range
0A - 100A (with external current transformer)
Power Range
0W - 22kW
Energy Range
0kWh - 9999kWh
Frequency Range
45Hz - 65Hz
Communication
UART (9600 baud rate, 8N1 format)
Power Supply
Self-powered (from measured AC line)
Accuracy
±0.5%
Operating Temperature
-10°C to 60°C
Dimensions
48mm x 23mm x 22mm
Pin Configuration
The PZEM-004T V3 has a 4-pin interface for communication and power connections. The pinout is as follows:
Pin
Name
Description
1
VCC
Power supply for the UART interface (3.3V or 5V)
2
GND
Ground connection
3
RX
UART Receive pin (connect to TX of microcontroller)
4
TX
UART Transmit pin (connect to RX of microcontroller)
Usage Instructions
How to Use the PZEM-004T V3 in a Circuit
Connect the Current Transformer (CT):
Attach the included CT sensor to the PZEM-004T V3 module.
Place the CT sensor around the live wire of the AC circuit to measure current.
Connect the Module to a Microcontroller:
Use the UART interface to connect the PZEM-004T V3 to a microcontroller (e.g., Arduino UNO).
Connect the VCC and GND pins to the 5V and GND pins of the microcontroller.
Connect the RX pin of the PZEM-004T V3 to the TX pin of the microcontroller.
Connect the TX pin of the PZEM-004T V3 to the RX pin of the microcontroller.
Power the Module:
The PZEM-004T V3 is self-powered from the AC line it measures. Ensure the AC voltage is within the specified range (80V - 260V AC).
Read Data via UART:
Use the UART interface to send commands and receive measurement data from the module.
Important Considerations and Best Practices
Safety First: The PZEM-004T V3 is designed for high-voltage AC circuits. Ensure proper insulation and avoid direct contact with live wires.
CT Orientation: Ensure the CT sensor is correctly oriented around the live wire for accurate current measurement.
Baud Rate: The UART communication operates at a fixed baud rate of 9600. Configure your microcontroller accordingly.
Isolation: For added safety, consider using an optocoupler or isolation circuit between the PZEM-004T V3 and your microcontroller.
Example Code for Arduino UNO
Below is an example Arduino sketch to interface with the PZEM-004T V3 and read voltage, current, and power data:
#include <PZEM004Tv30.h> // Include the PZEM-004T V3 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 V3 Energy Meter Example");
}
void loop() {
// Read voltage, current, and power from the PZEM-004T V3
float voltage = pzem.voltage();
float current = pzem.current();
float power = pzem.power();
// Check if the readings are valid
if (isnan(voltage) || isnan(current) || isnan(power)) {
Serial.println("Error reading data from PZEM-004T V3!");
} else {
// Print the readings to the 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 for 1 second before the next reading
}
Troubleshooting and FAQs
Common Issues and Solutions
No Data Received from the Module:
Ensure the UART connections (RX and TX) are correctly wired.
Verify that the baud rate is set to 9600 in your microcontroller code.
Check that the module is powered and the AC voltage is within the specified range.
Incorrect Current or Power Readings:
Ensure the CT sensor is properly clamped around the live wire.
Verify that the CT sensor is not damaged or improperly connected.
Module Not Responding to Commands:
Check the wiring and ensure the microcontroller's UART pins are functioning.
Ensure the PZEM-004T V3 library is correctly installed and included in your code.
FAQs
Q: Can the PZEM-004T V3 measure DC circuits?
A: No, the PZEM-004T V3 is designed specifically for AC circuits and cannot measure DC voltage or current.
Q: Can I use the module with a 3.3V microcontroller?
A: Yes, the UART interface supports both 3.3V and 5V logic levels.
Q: How do I reset the energy counter?
A: The energy counter can be reset by sending a specific command via UART. Refer to the module's command set documentation for details.
Q: Is the module safe for high-power applications?
A: Yes, the PZEM-004T V3 can measure up to 100A and 22kW, but ensure proper insulation and safety precautions when working with high-power circuits.