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 CT PZEM004T is a multifunctional energy meter designed to measure key electrical parameters such as voltage, current, power, energy, and frequency. It is specifically built to work with current transformers (CTs) for monitoring AC electrical systems. This component is widely used in energy management systems, industrial automation, and home energy monitoring applications. Its ability to provide real-time data makes it an essential tool for analyzing energy efficiency and optimizing power usage.

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

The CT PZEM004T is a compact and versatile module with the following key specifications:

Parameter Specification
Voltage Range 80V - 260V AC
Current Range 0A - 100A (with external CT)
Power Range 0W - 22kW
Energy Range 0kWh - 9999kWh
Frequency Range 45Hz - 65Hz
Communication Protocol UART (9600 baud rate)
Power Supply Self-powered (via measured AC voltage)
Accuracy ±0.5%
Dimensions 48mm x 29mm x 21mm

Pin Configuration

The CT PZEM004T module has a simple pinout for easy integration into circuits. Below is the pin configuration:

Pin Name Description
VCC Power input (5V DC) for UART communication
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 AC voltage to be measured
CT Input Connects to the current transformer (CT)

Usage Instructions

How to Use the CT PZEM004T in a Circuit

  1. Connect the AC Input: Wire the AC voltage to the AC input terminals of the module. Ensure the voltage is within the specified range (80V - 260V AC).
  2. Connect the Current Transformer (CT): Attach the CT to the CT input terminals. The CT should be clamped around the live wire of the AC circuit to measure current.
  3. Power the Module: The module is self-powered from the AC input. However, for UART communication, provide 5V DC to the VCC pin and connect the GND pin to the ground of your microcontroller.
  4. Connect to a Microcontroller: Use the TX and RX pins to establish UART communication with a microcontroller (e.g., Arduino UNO). Ensure the baud rate is set to 9600.

Important Considerations

Example Code for Arduino UNO

Below is an example Arduino sketch to read data from the CT PZEM004T using UART communication:

#include <SoftwareSerial.h>

// Define RX and TX pins for SoftwareSerial
SoftwareSerial pzemSerial(10, 11); // RX = pin 10, TX = pin 11

// PZEM004T communication commands
byte readVoltage[] = {0xB0, 0xC0, 0xA8, 0x01, 0x01, 0x00, 0x1A};
byte response[7]; // Buffer to store the response

void setup() {
  Serial.begin(9600);          // Initialize Serial Monitor
  pzemSerial.begin(9600);      // Initialize SoftwareSerial for PZEM004T
  Serial.println("PZEM004T Test");
}

void loop() {
  // Send voltage read command
  pzemSerial.write(readVoltage, sizeof(readVoltage));
  delay(100); // Wait for the response

  // Read response from PZEM004T
  if (pzemSerial.available() >= 7) {
    for (int i = 0; i < 7; i++) {
      response[i] = pzemSerial.read();
    }

    // Calculate voltage 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 on the Code

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Received via UART

    • Ensure the TX and RX pins are correctly connected (crossed: TX to RX, RX to TX).
    • Verify the baud rate is set to 9600 in both the code and the microcontroller.
  2. Incorrect Voltage or Current Readings

    • Check the AC input connections and ensure the voltage is within the specified range.
    • Verify the CT is properly clamped around the live wire and oriented correctly.
  3. Module Not Powering On

    • Ensure the AC input is connected and within the specified range (80V - 260V AC).
    • Check for loose or faulty connections.
  4. Communication Errors

    • Use shorter wires for UART communication to reduce noise.
    • If using a 3.3V microcontroller, ensure a logic level converter is used.

FAQs

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

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 PZEM004T modules with one microcontroller?
A: Yes, you can connect multiple modules by assigning unique addresses to each module using the UART protocol.

Q: Is the module safe to use with high-voltage systems?
A: Yes, but proper safety precautions and electrical isolation must be implemented to ensure safe operation.