Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use PZEM-004T: Examples, Pinouts, and Specs

Image of PZEM-004T
Cirkit Designer LogoDesign with PZEM-004T in Cirkit Designer

Introduction

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.

Explore Projects Built with PZEM-004T

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Smart Environmental Monitoring System with Relay Control
Image of SOCOTECO: A project utilizing PZEM-004T in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled AC Lighting System with Power Monitoring
Image of Smart Energy Meter: A project utilizing PZEM-004T in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Based Energy Monitoring Display with PZEM004T and OLED Screen
Image of Energy Consumption Monitoring: A project utilizing PZEM-004T in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Smart Power Monitoring and Control System with Wi-Fi Connectivity
Image of SIM: A project utilizing PZEM-004T in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with PZEM-004T

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of SOCOTECO: A project utilizing PZEM-004T in a practical application
ESP32-Based Smart Environmental Monitoring System with Relay Control
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Smart Energy Meter: A project utilizing PZEM-004T in a practical application
ESP32-Controlled AC Lighting System with Power Monitoring
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Energy Consumption Monitoring: A project utilizing PZEM-004T in a practical application
ESP8266 NodeMCU Based Energy Monitoring Display with PZEM004T and OLED Screen
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SIM: A project utilizing PZEM-004T in a practical application
ESP32-Based Smart Power Monitoring and Control System with Wi-Fi Connectivity
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

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%

Pin Configuration

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.

Usage Instructions

How to Use the PZEM-004T in a Circuit

  1. Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. UART Communication: Connect the TX pin of the PZEM-004T to the RX pin of your microcontroller (e.g., Arduino UNO) and the RX pin of the PZEM-004T to the TX pin of the microcontroller.
  3. AC Input: Connect the live and neutral wires of the AC circuit to the AC input terminals of the module.
  4. Current Transformer: Place the external CT around the live wire of the load you want to measure. Ensure the CT is oriented correctly as per the markings.
  5. Software Integration: Use the UART interface to send commands and receive data from the module. Libraries are available for platforms like Arduino to simplify communication.

Important Considerations and Best Practices

  • Safety First: The PZEM-004T operates with high-voltage AC circuits. Ensure proper insulation and safety precautions while handling the module.
  • Current Transformer Placement: The CT should only enclose the live wire, not both live and neutral wires, to measure current accurately.
  • Baud Rate: The default UART baud rate is 9600. Ensure your microcontroller is configured to communicate at this rate.
  • Isolation: For added safety, consider using optocouplers or isolation circuits when interfacing with microcontrollers.

Example Code for Arduino UNO

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.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received from the Module:

    • Ensure the TX and RX pins are correctly connected (crossed: TX to RX and RX to TX).
    • Verify the baud rate is set to 9600 in your microcontroller code.
    • Check the power supply to the module (5V DC).
  2. Incorrect Current or Power Readings:

    • Ensure the current transformer (CT) is properly placed around the live wire.
    • Verify that the CT is not damaged or improperly connected.
  3. Module Not Responding:

    • Check the wiring for loose connections.
    • Ensure the AC input is within the specified voltage range (80V - 260V AC).
  4. Error Messages in Arduino Serial Monitor:

    • Ensure the PZEM-004T library is correctly installed.
    • Double-check the UART connections and ensure no other devices are interfering with the communication.

FAQs

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.