Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use CT PZEM004T: Examples, Pinouts, and Specs

Image of CT PZEM004TDesign with CT PZEM004T in Cirkit Designer

Introduction

The PZEM004T is a multifunctional energy meter designed for AC applications. It is capable of measuring key electrical parameters such as voltage, current, power, energy, and frequency. This module is widely used in applications requiring real-time monitoring and management of electrical systems. Its serial communication interface makes it easy to integrate with microcontrollers, such as Arduino, for data acquisition and analysis.

Explore Projects Built with CT 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 ESP32-Controlled AC Lighting System with Power Monitoring: A project utilizing CT 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.

Open Project in Cirkit Designer
Image of ESP32-Based Smart Power Monitoring and Control System with Wi-Fi Connectivity: A project utilizing CT 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.

Open Project in Cirkit Designer

Common Applications:

Technical Specifications

Below are the key technical details of the PZEM004T energy meter:

Parameter Specification
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, 8N1 format)
Power Supply 5V DC
Accuracy ±0.5%
Dimensions 48mm x 29mm x 22mm

Pin Configuration and Descriptions

The PZEM004T module has a 4-pin interface for communication and power supply. Below is the pin configuration:

Pin Name Description
1 VCC Power supply input (5V DC)
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 PZEM004T in a Circuit

  1. Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Serial Communication: Connect the RX pin of the PZEM004T to the TX pin of your microcontroller (e.g., Arduino UNO) and the TX pin of the PZEM004T to the RX pin of the microcontroller.
  3. Current Transformer (CT): Attach the external current transformer to the load circuit. Ensure the CT is properly clamped around one of the AC lines (live or neutral, but not both).
  4. Load Connection: Connect the AC load to the input terminals of the PZEM004T module.
  5. Software Integration: Use a compatible library or write custom code to read data from the module via UART.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example Arduino sketch to interface with the PZEM004T module using the PZEM004T library:

#include <PZEM004Tv30.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 with the specified RX and TX pins
PZEM004T pzem(RX_PIN, TX_PIN);

void setup() {
  Serial.begin(9600); // Initialize serial communication for debugging
  Serial.println("PZEM004T 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);
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received from the Module:

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

    • Confirm that the current transformer is properly clamped around the AC line.
    • Ensure the load is within the specified voltage and current ranges of the module.
    • Avoid placing the module near sources of electromagnetic interference.
  3. Communication Errors:

    • Use shorter wires for the RX and TX connections to reduce signal degradation.
    • Check for loose or faulty connections in the circuit.

FAQs

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

Q2: What is the maximum current the module can measure?
The module can measure up to 100A when used with the appropriate external current transformer.

Q3: Can I use the PZEM004T with a 3.3V microcontroller?
Yes, but you will need a level shifter to safely interface the 3.3V logic of the microcontroller with the 5V logic of the PZEM004T.

Q4: How do I reset the energy reading to zero?
You can reset the energy reading programmatically using the appropriate command in the library or by sending the reset command via UART.

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