DOI : https://doi.org/10.5281/zenodo.19017747
- Open Access

- Authors : Asmit Bhattacharya
- Paper ID : IJERTV15IS030304
- Volume & Issue : Volume 15, Issue 03 , March – 2026
- Published (First Online): 14-03-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Non-Intrusive Load Monitoring via Edge-Based TinyML on ESP32 Microcontrollers
A Low-Latency Approach for Residential Energy Efficiency
Asmit Bhattacharya
Electrical Engineering Dept. National Institute of Technology Agartala Agartala, Tripura, India
Abstract – Real-time monitoring of electrical appliances is a fundamental component of efficient energy management systems. Traditional Non-Intrusive Load Monitoring (NILM) techniques often rely on centralized cloud-based processing, which can introduce latency and bandwidth constraints. This paper presents a decentralized, Edge AI-based monitoring system implemented on an ESP32 microcontroller. By integrating a PZEM004T sensor for real-time electrical data acquisition, I developed a system capable of classifying appliance states locally.
To improve model performance, I utilized feature engineering to derive power consumption (calculated as the product of voltage and current) alongside raw electrical parameters. A machine learning model was trained using the Edge Impulse platform, achieving 100% classification accuracy on a validation dataset. Furthermore, to address transient signal noise observed during load switching, I implemented a temporal filtering algorithm to ensure system stability and reduce false positive state transitions. My findings demonstrate the viability of deploying robust TinyML models for low-latency appliance monitoring, providing a cost- effective and privacy-conscious alternative to cloud-dependent energy management solutions.
Keywords – TinyML, ESP32, NILM, Power Signature Analysis, Edge Impulse, Appliance Monitoring.
- INTRODUCTION
The rapid advancement of the Internet of Things (IoT) has fundamentally altered the landscape of residential energy management. Modern smart home ecosystems increasingly rely on sophisticated monitoring tools to optimize power consumption and improve grid efficiency. However, conventional Non-Intrusive Load Monitoring (NILM) systems often suffer from significant limitations, primarily their dependency on centralized cloud-based processing. These cloud-dependent architectures introduce substantial latency, raise privacy concerns regarding household data, and require consistent network connectivity to function effectively.
To address these challenges, there is a growing paradigm shift toward “Edge Intelligence” or Tiny Machine Learning (TinyML), which seeks to perform data processing locally on resource-constrained devices. This paper proposes a
decentralized, real-time appliance state classification system implemented on an ESP32 microcontroller. By leveraging local computation, this approach eliminates the need for
constant cloud communication, thereby reducing bandwidth requirements and increasing system responsiveness.
The core methodology involves utilizing a PZEM-004T sensor to acquire high-resolution voltage and current data from an electrical load. A key technical contribution of this work is the implementation of feature engineering, where raw electrical signals are processed to derive power consumption (the
product of voltage and current) as a distinct signature for appliance state classification. The proposed system utilizes a trained machine learning model deployed directly onto the ESP32, enabling real-time inference with high precision. This research demonstrates that robust, low-latency, and cost- effective energy monitoring can be achieved entirely at the edge, offering a scalable solution for modern smart grid applications.
- PROPOSED METHODOLOGY
The proposed system architecture is designed to perform non- intrusive load monitoring (NILM) by processing electrical signatures locally on an ESP32 microcontroller. The methodology is divided into three distinct phases: data acquisition, feature engineering, and TinyML model deployment.
-
- Hardware Architecture
The system utilizes a modular hardware approach centered around the ESP32 development board. The primary sensor interface is the PZEM-004T v3.0, which provides high- precision measurements of AC voltage and current. The communication between the PZEM-004T and the ESP32 is established via a hardware serial interface (UART). A TFT display (ST7735) is integrated to provide immediate local feedback regarding the classified state of the electrical load.
- Hardware Architecture
-
- RESULTS AND DISCUSSION
Fig 1: System Architecture
-
- Data Acquisition and Feature Engineering
Data acquisition was performed at a sampling rate of 1 Hz. While raw voltage (V) and current (I) were initially recorded, the methodology was refined through feature engineering to improve classification accuracy. The model was trained using a composite feature vector. We derived the power consumption (P)as a primary feature, calculated using the following relationship:
-
- Model Performance and Classification Accuracy
The TinyML model, developed through the Edge Impulse platform, achieved a high level of robustness in classifying appliance states. Following the training phase, the model was subjected to a validation dataset consisting of distinct “ON” and “OFF” electrical signatures. The model achieved a validation accuracy of 100%, with the confusion matrix indicating no misclassifications between the two states.
The Precision, Recall, and F1-score for both classes were determined to be 1.00, demonstrating that the learned featuresspecifically the derived power signature (P = V x I) effectively captured the unique characteristics of the load. This high performance validates the suitability of the selected TinyML classification block for resource-constrained edge devices.
P = V x I
By incorporating Power (P) as an input feature, the model could leverage a more robust electrical signature, as the relationship between voltage and current fluctuations provided clearer class boundaries between “ON” and “OFF” states.
- Model Performance and Classification Accuracy
-
- Machine Learning Model Development
The machine learning pipeline was constructed using the Edge Impulse platform. The methodology involved the following steps:
- Data Collection: Balanced datasets were collected for both “ON” and “OFF” states, including transient switching data to ensure the model could generalize across real-world electrical behavior.
- DSP Processing: The “Flatten” processing block was employed to prepare the timeseries data, with normalization applied to ensure the variance in voltage (numerical range ~230) did not disproportionately influence the model compared to current (~0.04).
- Classification: A Keras-based classification model was trained and optimized for the ESP32 target architecture, achieving a validation accuracy of 100%.
- Inference and Temporal Filtering
- Data Acquisition and Feature Engineering
The trained model was deployed as a C++ library and integrated into the ESP32 firmware. To address signal noise and electromagnetic interference (EMI) observed during load switching, a temporal filtering algorithm was implemented. The system utilizes a
“confidence counter,” where the model requires the classification result to exceed a 90% confidence threshold for three consecutive inference cycles before updating the TFT status. This prevents display flickering dring transient states and enhances the overall system reliability.
Fig 2: Confusion Matrix
-
- Analysis of Transient Signal Noise
During real-time field testing, it was observed that the load switching event induced transient signal noise. Specifically, the PZEM-004T sensor occasionally reported read errors immediately following a state change, and transitional confidence scores of 0.5/0.5 were noted.
These observations are characteristic of electromagnetic interference (EMI) and signal instability inherent in electrical load switching. Rather than system failure, these transient states represent the brief interval where current and voltage are re- stabilizing within the circuit.
- Effectiveness of Temporal Filtering
- Analysis of Transient Signal Noise
To mitigate the impact of the aforementioned transient noise, a temporal filtering algorithm (confidence counter) was implemented within the firmware. By requiring the classification result to maintain a confidence threshold greater than 90% for three consecutive inference cycles, the system successfully rejected impulsive noise and prevented display flickering.
The implementation of this filter significantly enhanced the stability of the user interface. As demonstrated by the real-time
inference logs, the system effectively transitioned between states without oscillating due to brief sensor read errors, ensuring a reliable and accurate monitoring experience. This finding underscores the necessity of combining machine learning inference with heuristic filtering to achieve robust real- world performance in NILM applications.
-
- CONCLUSION AND FUTURE SCOPE
The proposed research successfully demonstrated the implementation of a real-time, edge-based NILM system using the ESP32 microcontroller. By leveraging TinyML and an optimized feature engineering approach (P = V x I), the system achieved a classification accuracy of 99.49% on test data. The integration of temporal filtering effectively mitigated transient signal noise, ensuring system stability.
This work confirms that robust energy monitoring can be achieved locally, bypassing the need for cloud-based latency and bandwidth constraints. Future iterations of this system will focus on expanding the model to classify multiple appliances simultaneously, moving toward a comprehensive smart home energy management solution.
Fig 3: Temporal Filter Logic Block Diagram
REFERENCES
- M. Mandulaj, “PZEM-004T-v30: Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter,” GitHub repository, 2024. [Online]. Available: (Accessed: March 5, 2026).
- Espressif Systems, “ESP32 Series Datasheet, Version 4.3,” [Online]. Available: (Accessed: March 5, 2026).
- Edge Impulse, “Edge Impulse Machine Learning for Embedded Devices,” [Online]. Available: (Accessed: March 5, 2026).
- Arduino Project, “Arduino IDE 2.0 and ESP32 Board Support Package,” [Online]. Available: (Accessed: March 5, 2026).
- P. Warden and D. Situnayake, TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers, O’Reilly Media, 2019.
- J. Z. Kolter and M. J. Johnson, “REDD: A Public Data Set for Energy Disaggregation Research,” in Proc. SustKDD, 2011, pp.
59-62.
