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, making it an essential tool for energy management and monitoring systems. The module communicates via a UART (serial) interface, enabling seamless integration with microcontrollers such as the Arduino UNO.

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

Common Applications and Use Cases

  • Home energy monitoring systems
  • Industrial equipment monitoring
  • Renewable energy systems (e.g., solar inverters)
  • Smart IoT-based energy management solutions
  • Laboratory and educational projects

Technical Specifications

Below are the key technical details of the PZEM-004T module:

Parameter Specification
Voltage Measurement 80V - 260V AC
Current Measurement 0A - 100A (with external current transformer)
Power Measurement 0W - 22kW
Energy Measurement 0Wh - 9999kWh
Frequency Measurement 45Hz - 65Hz
Communication Protocol UART (9600 baud rate)
Power Supply 5V DC
Accuracy ±0.5%

Pin Configuration and Descriptions

The PZEM-004T module has the following pinout:

Pin Name Description
VCC Power supply input (5V DC)
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
CT Input Connects to the external current transformer (CT) for current measurement

Usage Instructions

How to Use the PZEM-004T in a Circuit

  1. Power the Module: Connect the VCC and GND pins of the PZEM-004T to a 5V DC power source.
  2. Connect the UART Interface:
    • Connect the TX pin of the PZEM-004T to the RX pin of the Arduino UNO.
    • Connect the RX pin of the PZEM-004T to the TX pin of the Arduino UNO.
  3. Connect the AC Circuit:
    • Attach the live and neutral wires of the AC circuit to the AC input terminals of the PZEM-004T.
    • Place the external current transformer (CT) around the live wire of the AC circuit.
  4. Load the Arduino Code: Use the provided Arduino code to read data from the PZEM-004T.

Important Considerations and Best Practices

  • Ensure proper isolation between the AC circuit and the low-voltage side of the module to avoid electrical hazards.
  • Use a high-quality current transformer (CT) for accurate current measurements.
  • Avoid exceeding the voltage and current measurement limits of the module.
  • Use a pull-up resistor on the UART lines if communication issues occur.

Sample Arduino Code

Below is an example Arduino sketch to interface the PZEM-004T with an Arduino UNO:

#include <PZEM004Tv30.h> // Include the PZEM-004T library

// Define the RX and TX pins for the PZEM-004T
#define RX_PIN 10
#define TX_PIN 11

// Create a PZEM object using the defined 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!");
  }

  // Read frequency
  float frequency = pzem.frequency();
  if (!isnan(frequency)) {
    Serial.print("Frequency: ");
    Serial.print(frequency);
    Serial.println(" Hz");
  } else {
    Serial.println("Error reading frequency!");
  }

  delay(2000); // Wait for 2 seconds before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received from the Module:

    • Ensure the RX and TX pins are correctly connected between the PZEM-004T and the Arduino UNO.
    • Verify that the baud rate is set to 9600 in the Arduino code.
  2. Incorrect Voltage or Current Readings:

    • Check the connections to the AC input and the current transformer (CT).
    • Ensure the CT is properly clamped around the live wire of the AC circuit.
  3. Communication Errors:

    • Use shorter wires for the UART connection to reduce noise.
    • Add pull-up resistors to the RX and TX lines if necessary.
  4. Module Not Powering On:

    • Verify that the VCC pin is receiving a stable 5V DC supply.
    • Check for loose or faulty connections.

FAQs

Q: Can the PZEM-004T measure DC circuits?
A: No, the PZEM-004T 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 when used with the appropriate current transformer (CT).

Q: Can I use multiple PZEM-004T modules with a single Arduino?
A: Yes, you can use multiple modules by assigning different UART pins for each module or using a multiplexer.

Q: Is the module safe to use with high-voltage AC circuits?
A: Yes, but proper isolation and safety precautions must be followed to prevent electrical hazards.