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

How to Use PZEM004t: Examples, Pinouts, and Specs

Image of PZEM004t
Cirkit Designer LogoDesign with PZEM004t in Cirkit Designer

Introduction

The PZEM004t is a digital power meter designed for monitoring and measuring key electrical parameters in AC circuits. It provides real-time data on voltage, current, power, energy consumption, and frequency. This module is widely used in applications requiring precise energy monitoring, such as home automation, industrial equipment monitoring, and IoT-based energy management systems. Its built-in serial communication interface allows seamless integration with microcontrollers like Arduino, Raspberry Pi, and other embedded systems.

Explore Projects Built with PZEM004t

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 PZEM004t 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 PZEM004t 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
ESP32-Based Smart Energy Monitoring and Control System with PZEM004t and LCD Display
Image of pr1: A project utilizing PZEM004t in a practical application
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.
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 PZEM004t 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 PZEM004t

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 PZEM004t 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 PZEM004t 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 pr1: A project utilizing PZEM004t in a practical application
ESP32-Based Smart Energy Monitoring and Control System with PZEM004t and LCD Display
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SIM: A project utilizing PZEM004t 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 PZEM004t is a compact and efficient module with the following key specifications:

Parameter Value
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 Interface TTL Serial (3.3V/5V compatible)
Baud Rate 9600 bps
Accuracy ±0.5%
Operating Temperature -10°C to 60°C
Dimensions 70mm x 40mm x 20mm

Pin Configuration and Descriptions

The PZEM004t module has a simple pinout for easy integration:

Pin Name Description
VCC Power supply input (5V DC)
GND Ground connection
TX Transmit pin for serial communication (connects to RX of microcontroller)
RX Receive pin for serial communication (connects to TX of microcontroller)
AC IN+ Live wire input for AC voltage measurement
AC IN- Neutral wire input for AC voltage measurement
CT+ Positive terminal for the current transformer (CT)
CT- Negative terminal for the current transformer (CT)

Usage Instructions

How to Use the PZEM004t in a Circuit

  1. Power the Module: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Connect the AC Input: Wire the AC IN+ and AC IN- terminals to the live and neutral wires of the AC circuit you want to monitor.
  3. Connect the Current Transformer (CT): Attach the CT+ and CT- terminals to the provided current transformer. Ensure the CT is clamped around the live wire of the AC circuit.
  4. Serial Communication: Connect the TX pin of the PZEM004t to the RX pin of your microcontroller and the RX pin of the PZEM004t to the TX pin of your microcontroller.
  5. Load the Code: Use the appropriate library and code to read data from the module.

Important Considerations and Best Practices

  • Ensure all connections are secure and insulated to prevent electrical hazards.
  • The module is designed for AC circuits only; do not use it with DC circuits.
  • Use the provided current transformer for accurate current measurements.
  • Avoid exceeding the specified voltage and current ranges to prevent damage to the module.
  • If using with an Arduino, install the "PZEM004T" library from the Arduino Library Manager for simplified communication.

Example Code for Arduino UNO

Below is an example code to interface the PZEM004t with an Arduino UNO:

#include <PZEM004T.h> // Include the PZEM004T library

// Define the RX and TX pins for communication
#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 Power 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);
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received from the Module:

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

    • Ensure the current transformer is properly clamped around the live wire.
    • Verify that the AC IN+ and AC IN- terminals are connected to the correct wires.
    • Avoid using the module in circuits with high-frequency noise or unstable voltage.
  3. Module Not Responding:

    • Check for loose or incorrect wiring.
    • Ensure the module is not exposed to temperatures beyond its operating range.

FAQs

Q1: Can the PZEM004t measure DC circuits?
No, the PZEM004t is designed specifically for AC circuits and cannot measure DC voltage or current.

Q2: Can I use the PZEM004t with a 3.3V microcontroller?
Yes, the PZEM004t's serial communication interface is compatible with both 3.3V and 5V logic levels.

Q3: How do I reset the energy reading to zero?
The energy reading can be reset using a specific command sent via the serial interface. Refer to the module's datasheet or library documentation for details.

Q4: What is the maximum distance between the module and the current transformer?
The current transformer should be placed as close as possible to the module to ensure accurate readings. Long distances may introduce noise and reduce accuracy.