5168

Explore the simplicity of energy monitoring with the ESP32 Energy Meter, featuring the ATM90E32AS chip. Perfect for anyone looking to track energy use accurately.

Keeping track of energy consumption is crucial in today's world of smart homes and efficient energy use. The ESP32 Energy Meter project is an innovative solution that allows users to monitor and analyze energy consumption in real-time. By leveraging the power of the ESP32-S3 microcontroller, this project provides accurate energy monitoring with integration into Home Assistant for seamless home automation.
 
 
If you want a deep dive into this project, this project has been published in the Elektor Mag. Following are the links to the editions where the project updates were reported.

1. Prototyping an ESP32-Based Energy Meter, Elektor 12/2023 on page 96
2. Project Update #1: Next Steps in Prototyping, Elektor 1/2024 on page 6
3. Project Update #2: Some Enhancements, Elektor 5/2024 on page 102
4. Project Update #3: Integration and Testing with Home Assistant, Elektor 7/2024 on page 12
5. Project Update #4: Energy Monitoring with MQTT, Elektor 11/2024 on page 62

The main purpose of creating this Lab's Project is to provide a general overview, to keep the community members updated, and also to get the feedback from the community. 
 

Project Overview

The ESP32 Energy Meter is designed to measure voltage, current, and power consumption across single-phase and three-phase electrical systems. This latest iteration incorporates enhanced safety features, a modular design, and improved accuracy, making it a practical tool for energy-conscious homeowners and professionals.

Key Features:

  • ESP32-S3-Based Architecture: Improved processing power and efficiency.
  • Single & Three-Phase Support: Compatible with different electrical systems.
  • Transformer-Based Power Supply: Ensures galvanic isolation for safety.
  • Integration with Home Assistant & ESPHome: Real-time monitoring and automation.
  • OLED Display for Instant Readings: View energy data on the device itself.

Hardware Components

The project is built using carefully selected components for reliability and efficiency:

Microcontroller:

  • ESP32-S3: The core of the energy meter, handling data processing and communication.

Energy Metering IC:

  • ATM90E32S: A highly accurate energy measurement IC used for current and voltage sensing.

Power Supply:

  • Step-Down Transformer (220V to 12V AC): Provides safe voltage sampling.
  • AP63203WU-7 Buck Converter: Converts 12V to the required 3.3V for the ESP32.

Current Sensors:

  • Split-Core Current Transformers (SCT-013-000): Measures current flow in the circuit.

Connectivity & Display:

  • OLED Display (I2C-based): Real-time energy readings.
  • Wi-Fi Communication: Enables integration with Home Assistant via ESPHome.

Circuit Design & PCB Layout

The PCB layout has been optimized for modularity and safety:

  • Compact Design: Reduced PCB size for easier integration.
  • Clear Component Separation: Minimized interference and improved solderability.
  • Noise Reduction: Combination of ceramic and electrolytic capacitors for accurate readings.

The voltage and current sampling circuits use high-quality screw terminals for secure and reliable connections, avoiding common issues found in cheap sensor modules.

Circuit Design 

 

elektor
elektor
 

PCB Layout

 
elektor
 

Software & Home Assistant Integration

The ESP32 Energy Meter uses ESPHome firmware to communicate with Home Assistant, allowing real-time monitoring and data visualization.

Setting Up the ESP32 Energy Meter with Home Assistant

  1. Install Home Assistant on your preferred hardware.
  2. Install ESPHome via Home Assistant Add-On Store.
  3. Flash ESPHome Firmware onto the ESP32:
    • Use ESPHome’s YAML configuration to define sensors and Wi-Fi credentials.
  4. Calibrate the Energy Meter:
    • Adjust gain settings for voltage and current readings using a reference multimeter.
  5. Monitor Energy Consumption:
    • View live data on Home Assistant’s dashboard.
    • Set up alerts and automation based on energy usage.

Testing & Calibration

A hairdryer with adjustable power settings was used as a test load to measure current variations. Calibration was performed using a clamp meter, ensuring accurate measurements within ±1% of actual values.


Installation in a Circuit Breaker Box

For real-world use, the ESP32 Energy Meter was installed in a circuit breaker panel using split-core current transformers. Key considerations:

  • Safe Installation: Power must be turned off before handling.
  • Correct Transformer Orientation: Ensures accurate readings.
  • DIN Rail Transformers Recommended: For a compact and professional setup.

Future Enhancements

  • AI-Based Load Prediction: Utilizing the ESP32-S3’s ML capabilities for energy forecasting.
  • Cloud Integration: Sending data to external dashboards for remote monitoring.
  • Enhanced Security: Secure OTA updates and improved encryption.

How to Contribute We welcome contributions and feedback from the community. If you're interested in improving the project or have suggestions, please reach out or contribute in the comments section below. 
 

The ESP32 Energy Meter is a powerful, cost-effective solution for real-time energy monitoring and home automation integration. Whether you’re an engineer, maker, or homeowner, this project offers detailed insights into energy consumption, paving the way for a more efficient and smart home.

For further details, check out the GitHub repository and join the Elektor Labs community to contribute and improve the project!