The PZEM004T.V4-2 is a multifunctional energy meter manufactured by Peacefair. It is designed to measure key electrical parameters in AC circuits, including voltage, current, power, energy consumption, frequency, and power factor. This module is widely used in applications requiring real-time monitoring and data logging of electrical systems. It features a UART interface for seamless communication with microcontrollers, making it ideal for IoT and automation projects.
Explore Projects Built with PZEM004T.V4-2
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 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.
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 a monitoring and control system using an ESP32 microcontroller. It integrates multiple PZEM004t energy meters, a rain gauge, a light sensor, and an LCD display for data visualization. Additionally, it controls a relay module to switch a bulb on or off based on sensor inputs.
The PZEM004T.V4-2 module has a 4-pin interface for communication and power. Below is the pin configuration:
Pin Number
Pin Name
Description
1
VCC
Power supply input (5V DC)
2
GND
Ground
3
RX
UART Receive pin (connect to TX of MCU)
4
TX
UART Transmit pin (connect to RX of MCU)
Additionally, the module includes terminals for connecting the AC input and the external current transformer (CT).
Terminal Name
Description
AC IN
Connect to the live and neutral wires of the AC load
CT IN
Connect to the external current transformer (CT)
Usage Instructions
Connecting the PZEM004T.V4-2
Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
UART Communication: Connect the RX pin of the module to the TX pin of your microcontroller (e.g., Arduino), and the TX pin of the module to the RX pin of the microcontroller.
AC Input: Connect the live and neutral wires of the AC circuit to the AC IN terminals on the module.
Current Transformer (CT): Attach the external CT to the CT IN terminals and clamp it around the live wire of the AC circuit.
Important Considerations
Ensure the AC input voltage is within the specified range (80V - 260V AC).
The current transformer (CT) must be installed correctly, with the arrow on the CT facing the load.
Avoid exposing the module to high temperatures or humidity.
Use proper isolation techniques when working with high-voltage AC circuits to ensure safety.
Example: Using with Arduino UNO
Below is an example of how to interface the PZEM004T.V4-2 with an Arduino UNO to read voltage, current, and power data.
Arduino Code
#include <SoftwareSerial.h>
// Define RX and TX pins for UART communication
SoftwareSerial pzemSerial(10, 11); // RX = pin 10, TX = pin 11
// PZEM004T communication commands
byte readVoltageCmd[] = {0xB0, 0xC0, 0xA8, 0x01, 0x01, 0x00, 0x1A};
byte response[7]; // Buffer to store response from PZEM004T
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
pzemSerial.begin(9600); // Initialize PZEM004T communication
Serial.println("PZEM004T.V4-2 Energy Meter");
}
void loop() {
// Send command to read voltage
pzemSerial.write(readVoltageCmd, sizeof(readVoltageCmd));
delay(100); // Wait for response
// Read response from PZEM004T
if (pzemSerial.available() >= 7) {
for (int i = 0; i < 7; i++) {
response[i] = pzemSerial.read();
}
// Extract voltage value from response
float voltage = (response[2] << 8 | response[3]) / 10.0;
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
}
delay(1000); // Wait 1 second before next reading
}
Notes:
The above code demonstrates how to send a command to the PZEM004T and read the voltage data. Similar commands can be used to read current, power, and other parameters.
Use a library like PZEM004T (available in the Arduino Library Manager) for simplified communication.
Troubleshooting and FAQs
Common Issues
No Data Received via UART
Ensure the RX and TX pins are correctly connected (crossed: RX to TX, TX to RX).
Verify the baud rate is set to 9600 in your code.
Check the power supply to the module (5V DC).
Incorrect Voltage or Current Readings
Ensure the AC input voltage is within the specified range (80V - 260V AC).
Verify the current transformer (CT) is properly clamped around the live wire.
Check for loose connections on the AC IN and CT IN terminals.
Module Not Powering On
Confirm the VCC pin is receiving 5V DC.
Check for any short circuits or damaged components.
FAQs
Q: Can the PZEM004T.V4-2 measure DC circuits?
A: No, the module is designed specifically for AC circuits 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 using the provided external current transformer (CT).
Q: Can I use multiple PZEM004T modules with a single microcontroller?
A: Yes, you can connect multiple modules to a single microcontroller by assigning unique addresses to each module. Refer to the module's datasheet for address configuration.
Q: Is the module safe to use with high-voltage circuits?
A: Yes, but proper isolation and safety precautions must be followed when working with high-voltage AC circuits.
By following this documentation, users can effectively integrate the PZEM004T.V4-2 into their projects for accurate energy monitoring and data logging.