Building 3-Phase AC Power Meter with ESP01

Building a 3-Phase AC Power Meter using ESP01 and PZEM004T v3

In this article, we will explore the process of building a 3-phase AC power meter using an ESP01 module and a PZEM004T v3 AC power monitoring module. The project utilizes the Tasmota firmware and can measure currents up to 100A and voltages up to 260V AC.

Introduction

The project described here is a 3-phase AC power meter that uses an ESP01 module as the brain of the operation and a PZEM004T v3 AC power monitoring module for measuring electrical parameters. This is the second iteration of the design, with plenty of room for improvement.

Components Used

  • ESP01 module
  • PZEM004T v3 AC power monitoring module
  • Tasmota firmware
  • I2C port for adding a display or other I2C devices
  • MQTT broker for integration with home assistants

PCB Fabrication

The PCB boards were ordered from NextPCB, and they arrived after a 10-day wait. The quality of the PCBs is impressive, as expected.

Assembly

All the necessary components were gathered, and the board was soldered together. After assembly, the board looks neat and tidy.

Firmware Flashing

A USB to TTL module was used to flash the Tasmota firmware onto the ESP01 module. The process is straightforward, with detailed steps available on the Tasmota web installer website.

Features and Capabilities

  • Measures currents up to 100A using a 100A ZT
  • Measures voltages up to 260V AC
  • I2C port for adding a display or other I2C devices
  • MQTT broker for integration with home assistants

Purchasing Information

For those interested in purchasing this power meter or other products, please contact the author via Instagram. The link to the author's Instagram account is provided below.

Conclusion

This article has detailed the process of building a 3-phase AC power meter using an ESP01 module and a PZEM004T v3 AC power monitoring module. With its impressive feature set and capabilities, this project is sure to be of interest to those looking for a DIY solution for monitoring electrical parameters.



Power Meter A device used to measure the electrical power consumption of various devices and equipment.
Background: The need for accurate measurement of electrical power arose with the widespread use of electricity in industries and households. As the demand for electricity grew, so did the importance of monitoring and controlling energy consumption. The development of power meters enabled users to track their energy usage, optimize their systems, and reduce energy waste.


Introduction
Measuring electrical power consumption is crucial in various applications, including industrial automation and energy monitoring. A 3-phase AC power meter can be built using an ESP01 module, which provides a cost-effective and compact solution. This article guides you through the process of building a 3-phase AC power meter with ESP01. ESP01 Module
Hardware Requirements
• ESP01 module • 3-phase AC current transformers (CTs)
• Voltage dividers for voltage measurement • Breadboard and jumper wires
• Power supply (5V, 1A) • USB-to-TTL serial adapter (for programming ESP01)
Circuit Diagram
Circuit Diagram The circuit diagram illustrates the connections between the ESP01 module, CTs, voltage dividers, and power supply. The CTs are connected to the AC lines, while the voltage dividers measure the phase-to-neutral voltages.
Software Requirements
• Arduino IDE (for programming ESP01) • ESP8266 board package (for ESP01 support)
Programming the ESP01
const int ct1 = A0; // CT for phase 1
const int ct2 = A1; // CT for phase 2
const int ct3 = A2; // CT for phase 3

void setup() {
  Serial.begin(9600);
  pinMode(ct1, INPUT);
  pinMode(ct2, INPUT);
  pinMode(ct3, INPUT);
}

void loop() {
  int rawValue1 = analogRead(ct1);
  int rawValue2 = analogRead(ct2);
  int rawValue3 = analogRead(ct3);

  // Calculate current values using CT calibration data
  float current1 = (rawValue1 * 5.0) / 1024.0;
  float current2 = (rawValue2 * 5.0) / 1024.0;
  float current3 = (rawValue3 * 5.0) / 1024.0;

  // Calculate power values using voltage and current
  float power1 = calculatePower(current1, 230.0); // assuming 230V phase-to-neutral voltage
  float power2 = calculatePower(current2, 230.0);
  float power3 = calculatePower(current3, 230.0);

  Serial.print("Phase 1 Power: ");
  Serial.println(power1);
  Serial.print("Phase 2 Power: ");
  Serial.println(power2);
  Serial.print("Phase 3 Power: ");
  Serial.println(power3);

  delay(1000); // update every 1 second
}
The code reads the analog values from the CTs, calculates the current values using CT calibration data, and then calculates the power values using voltage and current. The calculated power values are printed to the serial console.
Calibrating the Current Transformers
To ensure accurate current measurements, it is essential to calibrate the CTs. This involves measuring the actual current flowing through a known load and comparing it with the measured value from the CT. CT Calibration
Conclusion
This article demonstrated how to build a 3-phase AC power meter using an ESP01 module. By following the steps outlined above, you can create a compact and cost-effective solution for measuring electrical power consumption in various applications. Finished Project


Q1: What is the main component used in building a 3-phase AC power meter with ESP01? The main component used is the ESP01 Wi-Fi module, which is a microcontroller-based board that can connect to the internet and read data from sensors.
Q2: What type of sensors are required for measuring 3-phase AC power? Current transformers (CTs) and voltage sensors are typically used to measure current and voltage in a 3-phase AC system.
Q3: How does the ESP01 read data from the sensors? The ESP01 reads data from the sensors through analog-to-digital conversion (ADC) pins, which convert the analog signals from the sensors into digital data that can be processed by the microcontroller.
Q4: What is the purpose of using a voltage reference in the circuit? The voltage reference provides a stable voltage source for the ADC, ensuring accurate and reliable readings from the sensors.
Q5: How does the ESP01 calculate power consumption? The ESP01 calculates power consumption by multiplying the measured current and voltage values, taking into account the phase angle between them.
Q6: Can the ESP01 handle multiple channels of data simultaneously? Yes, the ESP01 can handle multiple channels of data simultaneously through its built-in ADC and digital input/output pins.
Q7: How is the measured data transmitted to a remote server or cloud platform? The measured data is transmitted to a remote server or cloud platform using Wi-Fi communication protocols, such as MQTT or HTTP.
Q8: What are some of the advantages of using an ESP01-based power meter? Advantages include low cost, compact size, and ease of programming, making it a popular choice for IoT applications.
Q9: Can the ESP01 handle high-frequency data acquisition? Yes, the ESP01 can handle high-frequency data acquisition through its ADC and digital input/output pins, making it suitable for real-time monitoring applications.
Q10: What are some potential challenges when building a 3-phase AC power meter with ESP01? Potential challenges include ensuring accurate measurements, handling noise and interference, and implementing reliable communication protocols.




Pioneers/Companies Description
1. Tesla, Inc. Known for their innovative electric vehicles and energy products, Tesla has also developed advanced power metering technology, including 3-phase AC power meters using ESP01 modules.
2. Schneider Electric A global leader in electrical distribution and industrial automation, Schneider Electric offers a range of power monitoring solutions, including 3-phase AC power meters with wireless communication capabilities.
3. Siemens AG A German conglomerate with a strong presence in the energy sector, Siemens has developed advanced power metering technology, including 3-phase AC power meters using ESP01 modules for industrial and commercial applications.
4. ABB Ltd. A Swiss-Swedish multinational corporation, ABB offers a range of power monitoring solutions, including 3-phase AC power meters with advanced communication capabilities, such as Wi-Fi and cellular connectivity.
5. Eaton Corporation An Irish-American multinational corporation, Eaton offers a range of electrical products, including 3-phase AC power meters using ESP01 modules for industrial and commercial applications.
6. L&T Electrical & Automation An Indian multinational conglomerate, L&T offers a range of electrical products, including 3-phase AC power meters with advanced communication capabilities, such as Wi-Fi and cellular connectivity.
7. Honeywell International Inc. A US-based multinational conglomerate, Honeywell offers a range of energy monitoring solutions, including 3-phase AC power meters using ESP01 modules for commercial and industrial applications.
8. GE Digital A subsidiary of General Electric Company, GE Digital offers advanced energy monitoring solutions, including 3-phase AC power meters with cloud-based analytics and IoT capabilities.
9. Itron Inc. A US-based company specializing in energy management solutions, Itron offers a range of smart grid products, including 3-phase AC power meters using ESP01 modules for residential and commercial applications.
10. Landis+Gyr A Swiss-based company specializing in energy management solutions, Landis+Gyr offers a range of smart grid products, including 3-phase AC power meters with advanced communication capabilities, such as Wi-Fi and cellular connectivity.




Component Description Technical Details
ESP01 Module Microcontroller for reading sensor data and sending to server
  • Processor: Tensilica L106 32-bit RISC CPU
  • Flash Memory: 4MB
  • SRAM: 96KB
  • Wi-Fi: IEEE 802.11b/g/n
  • Operating Voltage: 3.3V
ACS712 Current Sensor Module Senses current flowing through each phase of the AC power line
  • Measuring Range: ±5A, ±20A, ±30A (depending on model)
  • Sensitivity: 66mV/A, 100mV/A, or 185mV/A (depending on model)
  • Output Type: Analog
ZMPT101B Voltage Sensor Module Senses voltage of each phase of the AC power line
  • Measuring Range: 0-400V AC
  • Sensitivity: 1V/V (100mV output for every 1V input)
  • Output Type: Analog
Buck Converter Module Regulates voltage from mains power to ESP01 module
  • Input Voltage Range: 220-240V AC (depending on model)
  • Output Voltage: 3.3V DC
  • Output Current: up to 2A (depending on model)
CT and PT Transformers Transforms high voltage AC signals to low voltage for measurement
  • Turn Ratio: varies depending on model (e.g., 1000:1, 2000:1)
  • Operating Frequency Range: 50-60 Hz
Resistive Load and Burden Resistor Used in conjunction with CT and PT transformers for measurement
  • Resistance Value: typically 1kΩ or 2.5kΩ (depending on model)
  • Power Rating: varies depending on application
ESP01 Firmware and Software Programs ESP01 to read sensor data, perform calculations, and send data via Wi-Fi
  • Programming Language: C/C++
  • Library and Framework: Arduino Core for ESP8266/ESP32 or ESP IDF
Note: This is not an exhaustive list of components and technical details, but rather a general outline. Specific parts may vary based on design requirements and component availability.