Design and Implementation of a Real-Time Modular System for AC/DC Energy Data Acquisition

Published: 8 October 2026| Version 1 | DOI: 10.17632/hdbsk8nx5j.1
Contributors:
alvaro alejandro villa garzon,
,

Description

This repository provides the open-source hardware schematics, firmware, and telemetry data for a synchronous, modular energy profiling system capable of monitoring both AC and DC power sources in real time. Built around the ESP32-S3 microcontroller, the platform is designed for precise electrical data acquisition, remote monitoring, and rapid field deployment. System Capabilities Synchronized Energy Profiling: Calculates and logs RMS voltage and current, active, reactive, and apparent power, power factor, frequency, and Total Harmonic Distortion (THD) simultaneously. Dynamic Field Configuration: The system operates as a plug-and-play device by reading network credentials, MQTT broker details, NTP server parameters, and sensor calibration factors directly from a Config.txt file on the MicroSD card. This enables researchers and engineers to reconfigure the hardware dynamically in the field without needing to recompile or re-upload the firmware. Dual-Mode Data Logging: Features continuous datalogging directly to the MicroSD card, alongside an independent user-triggered event capture mode for isolating specific anomalies or operational states. Real-Time IoT Telemetry: Utilizes a dedicated FreeRTOS task to transmit live electrical profiles and auxiliary sensor data (temperature and battery voltage) to remote servers via MQTT payloads. Operational Redundancy: If the external SD configuration file is missing or corrupted, the firmware automatically reverts to pre-programmed default values to guarantee continuous and reliable operation. Repository Contents Complete C++ source code modularized for the ESP32-S3, including display rendering, hardware interrupt handling, FFT math processing, and MQTT telecommunications. Hardware schematics detailing the integration of the main microcontroller with high-resolution ADCs (ADS1256, ADS1115), Real-Time Clocks (DS3231), and the signal conditioning circuitry for AC/DC sensors. Sample dataset structures demonstrating the continuous CSV output logged to the local storage and the JSON payload formatted for IoT brokers.

Files

Steps to reproduce

3D Printed Enclosure: Fabrication and Assembly Guide 1. 3D Printing Specifications To ensure durability and proper thermal management for the internal power electronics and microcontrollers, follow these recommended printing parameters: Material: PETG or ABS is highly recommended due to their superior thermal resistance compared to PLA. PLA may warp under the heat generated by continuous AC/DC monitoring. Layer Height: 0.2 mm for a balance between print speed and dimensional accuracy. Infill: 20% to 30% (Gyroid or Grid pattern) to provide sufficient structural rigidity. Wall Thickness / Perimeters: 3 to 4 perimeters for reinforced mounting holes. Supports: Enable supports only where necessary (e.g., overhangs for sensor ports or screen bezels). 2. Required Files Ensure you have downloaded the following .STL files from the repository: Enclosure_Base.stl: Main housing for the ESP32-S3, ADCs, and RTC module. Enclosure_Lid.stl: Top cover with the cutout for the TFT LCD display. Sensor_Brackets.stl (If applicable): Internal mounts for the ZMPT101B and ZMCT103C modules. 3. Hardware Required for Assembly 4x M3x12mm machine screws (for closing the case). 4x M3 brass heat-set threaded inserts. M2.5 screws and nylon standoffs (for mounting the internal PCBs). 4. Step-by-Step Assembly Instructions Prepare the Base: Heat a soldering iron to approximately 200°C (392°F) and carefully press the M3 brass threaded inserts into the four mounting posts located at the corners of the Enclosure_Base. Mount the Microcontroller and Modules: Secure the ESP32-S3, the ADS1256, the ADS1115, and the RTC DS3231 into their designated standoffs inside the base using M2.5 screws. Ensure the MicroSD card slot remains accessible. Route the Wiring: Feed the cables from the external AC/DC sensors (ZMPT101B and ZMCT103C) and thermistors through the lateral ports of the enclosure. Connect them to the corresponding differential MUX channels on the ADCs. Install the Display: Carefully press-fit the TFT LCD screen into the bezel on the Enclosure_Lid. If necessary, use a small amount of hot glue or Kapton tape to secure the edges and prevent shifting. Final Wiring and Closure: Connect the display ribbon or jumper cables to the SPI2 bus pins on the ESP32-S3. Verify that no cables are pinched, place the lid over the base, and secure the assembly using the four M3x12mm screws. Note: Before closing the enclosure permanently, ensure the Config.txt file is loaded onto the MicroSD card and inserted into the module, as this allows dynamic network and calibration updates without reopening the case.

Institutions

Categories

Electronic Circuit, Data Acquisition, Energy Demand, Green Electricity, Green IoT

Licence