EARLY DETECTION OF ANOMALIES IN ENERGY CONSUMPTION USING EDGE AI
Abstract
Background. Industrial IoT infrastructures require edge-based predictive maintenance to prevent asset breakdowns. Traditional cloud monitoring suffers from bandwidth saturation, high ingestion costs, and propagation latencies. This study shifts diagnostics to the network edge using an ESP32 module to detect power consumption anomalies in real time.
Materials and Methods. An autonomous edge computing framework was developed by integrating a 32-bit dual-core ESP32 microcontroller with an INA219 precision power monitoring circuit. To eliminate polling gaps during neural network inference, the firmware architecture utilizes the FreeRTOS real-time scheduler to partition operations: Core 0 handles sensor sampling at 100 Hz, while Core 1 executes a multi-tiered machine learning voting ensemble. The ensemble combines six parallel analytical pipelines categorized into three layers: a 1-dimensional deep autoencoder fully quantized to signed 8-bit integers (int8) for pointwise reconstruction-error tracking, alongside rolling 5-minute window aggregation and differential tracking modules designed to evaluate signal statistical profiles, smoothness metrics, coefficients of variation, and gradient shifts concurrently.
Results and Discussion. Hardware experiments on stepper motors, DC fans, and resistive units validated fault sensitivity. The point-level autoencoder achieved a 100% detection rate for abrupt short-circuits with a 42-second notification latency. Gradual parametric drifts were tracked with 98% precision and 92% recall (F1-score: 0.95), filtering out motor start-up spikes. Acute internal motor phase failures were isolated within 1.1 seconds. The local pipeline requires 47 ms per inference cycle, consumes under 0.3 W·h/day, and utilizes a 6.8 KB tensor arena inside static random-access memory (SRAM).
Conclusion. Shifting multi-tiered predictive analytics to resource-constrained microcontrollers ensures complete processing autonomy, microsecond-level fault response times, and robust network bandwidth conservation. The proposed edge AI framework provides a highly viable, energy-efficient, and scalable solution for distributed industrial predictive maintenance without cloud dependency.
Keywords: edge AI, anomaly detection, ESP32, INA219, energy consumption, Tensorflow Lite.
Full Text:
PDFReferences
[1] Gopinath, R., & Kumar, M. (2023). DeepEdge-NILM: A case study of non-intrusive load monitoring edge device in commercial building. Energy & Buildings, 294, 113226. https://doi.org/10.1016/j.enbuild.2023.113226
[2] Sater, R. A., & Hamza, A. B. (2021). A federated learning approach to anomaly detection in smart buildings. ACM Transactions on Internet of Things, 2(4), 1–23. https://doi.org/10.1145/3467981
[3] Zim, M. Z. H. (2021). TinyML: Analysis of Xtensa LX6 microprocessor for Neural Network Applications by ESP32 SoC. https://doi.org/10.13140/RG.2.2.28602.11204/1
[4] Reis, M. J. C. S. (2025). Lightweight Signal Processing and Edge AI for Real-Time Anomaly Detection in IoT Sensor Networks. Sensors, 25(21), 6629. https://doi.org/10.3390/s25216629
[5] Foltýnek P, Babiuch M, Šuránek P. Measurement and data processing from Internet of Things modules by dual-core application using ESP32 board. Measurement and Control. 2019;52(7-8):970-984. https://doi.org/10.1177/0020294019857748
[6] Alshede, H., Nassef, L., Alowidi, N., Fadel, E. (2023). Ensemble Voting-Based Anomaly Detection for a Smart Grid Communication Infrastructure. Intelligent Automation & Soft Computing, 36(3), 3257–3278. https://doi.org/10.32604/iasc.2023.035874
[7] Novac, P.-E., Boukli Hacene, G., Pegatoquet, A., Miramond, B., & Gripon, V. (2021). Quantization and Deployment of Deep Neural Networks on Microcontrollers. Sensors, 21(9), 2984. https://doi.org/10.3390/s21092984
[8] Chang, Y.-H., Wu, F.-C., & Lin, H.-W. (2025). Design and Implementation of ESP32-Based Edge Computing for Object Detection. Sensors, 25(6), 1656. https://doi.org/10.3390/s25061656
[9] Abboush, M., Bamal, D., Knieke, C., & Rausch, A. (2022). Intelligent Fault Detection and Classification Based on Hybrid Deep Learning Methods for Hardware-in-the-Loop Test of Automotive Software Systems. Sensors, 22(11), 4066. https://doi.org/10.3390/s22114066
[10] Klinsuwan, T., Ratiphaphongthon, W., Wangkeeree, R., Wangkeeree, R., & Sirisamphanwong, C. (2023). Evaluation of Machine Learning Algorithms for Supervised Anomaly Detection and Comparison between Static and Dynamic Thresholds in Photovoltaic Systems. Energies, 16(4), 1947. https://doi.org/10.3390/en16041947
[11] Amirkhanova, G., Aidynuly, A., Adilzhanova, S., Fu, Y., Dina, B., & Alipbeki, O. (2026). A Comparative Analysis of Machine Learning Models for Anomaly Detection in Industrial Smart Meter Time-Series Data. Information, 17(2), 131. https://doi.org/10.3390/info17020131
[12] Śmiałkowski, T., & Czyżewski, A. (2025). Anomaly detection in urban lighting systems using autoencoder and transformer algorithms. Scientific Reports, 15, 35972. https://doi.org/10.1038/s41598-025-19414-8
DOI: http://dx.doi.org/10.30970/eli.35.10
Refbacks
- There are currently no refbacks.

Electronics and information technologies / Електроніка та інформаційні технології