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

How to Use PZEM004t: Examples, Pinouts, and Specs

Image of PZEM004tDesign with PZEM004t in Cirkit Designer

Introduction

The PZEM004T is a versatile and highly accurate digital power meter designed to measure various electrical parameters including voltage, current, power, energy, and frequency. It is widely used in monitoring energy consumption for household appliances, industrial machinery, and various electronic projects. Its ability to interface with microcontrollers like the Arduino UNO makes it a popular choice for DIY enthusiasts and professionals looking to build energy monitoring 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!
Image of ESP32-Controlled AC Lighting System with Power Monitoring: 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.

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

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Function Description
1 VCC Power supply input (5V DC)
2 GND Ground
3 RX Receive pin, used to receive data from the PZEM (TTL logic)
4 TX Transmit pin, used to send data to the PZEM (TTL logic)

Usage Instructions

How to Use the PZEM004T in a Circuit

  1. Power Supply: Connect the VCC pin to a 5V power source and the GND pin to the common ground.
  2. Current Transformer: Attach the current transformer around the live wire of the circuit you wish to measure.
  3. Voltage Measurement: Connect the voltage measurement terminals of the PZEM004T across the points in the circuit where you want to measure the voltage.
  4. Data Communication: Connect the RX and TX pins to a microcontroller or a computer to read the data from the PZEM004T.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can the PZEM004T be used with an Arduino UNO? A: Yes, the PZEM004T can be easily connected to an Arduino UNO for data logging and monitoring.

Q: What is the default baud rate for the PZEM004T? A: The default baud rate for serial communication with the PZEM004T is 9600 bps.

Q: How can I reset the energy data on the PZEM004T? A: Energy data can be reset through a command sent from the microcontroller to the PZEM004T.

Example Arduino UNO Code

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

// PZEM004T connection pins
#define PZEM_RX 6
#define PZEM_TX 7

// Create a SoftwareSerial object
SoftwareSerial pzem(PZEM_RX, PZEM_TX);

void setup() {
  Serial.begin(9600); // Start the Serial communication
  pzem.begin(9600);  // Start the PZEM communication
}

void loop() {
  // Send request for data to PZEM004T
  pzem.write(0xB0);
  pzem.write(0xC0);
  pzem.write(0xA8);
  pzem.write(0x01);
  pzem.write(0x01);
  pzem.write(0x00);
  pzem.write(0x1E);

  // Wait for a response
  delay(1000);

  // Read the response and print it to the Serial Monitor
  if (pzem.available()) {
    Serial.print("Voltage: ");
    Serial.print(pzem.read()); // Read voltage
    Serial.println("V");

    // Repeat for current, power, energy, and frequency
    // ...
  }
}

Note: This example code is for demonstration purposes only and may require additional commands and error checking for practical applications. Always refer to the PZEM004T datasheet for detailed communication protocol information.