Introduction
The demand for efficient energy consumption management has never been greater. From enhancing the operational efficiency of utility grids, to ensuring the well-being of individuals in healthcare facilities, or even to providing predictive maintenance to mitigate preventable failures in industrial environments, the insights derived from monitoring energy consumption are invaluable. This project explores the transformative power of edge machine learning in deciphering energy consumption patterns, providing a step-by-step guide on how to create an energy monitoring solution that can individually identify which devices are being used on a shared AC line, based on energy-draw signatures. Current products on the market that provide this feature require an individual connection to each device, typically in the form of a smart plug, which is sufficient for basic consumer functions but not feasible for more complex use cases. With Edge Impulse and the Particle Photon 2, the same features are amplified, requiring just one measurement location for a power strip, circuit breaker, or even entire homes and buildings.Why Use Edge AI for Energy Monitoring?
Sending energy-monitoring data to the cloud for retrieval comes with several pitfalls, especially privacy-related and security concerns, bandwidth and latency issues, and cost considerations. In contrast, the emergence of embedded devices with sufficient processing capabilities to handle powerful machine learning algorithms on-device has several advantages, including enhanced privacy because data is collected locally and remains on device. Local data also provides a real-time analysis and decision-making benefit, ensuring timely responses to critical events or anomalies. Furthermore, reduced bandwidth usage and offline capabilities make the edge a powerful solution to unlock the full potential of energy monitoring, while maximizing efficiency.Getting Started
Materials List:- Particle Photon 2
- Appliances
- Power strip with enough outlets for all the appliances being monitored
- Current clamp, non-invasive, such as https://sparkfun.com/products/11005
- Method to reduce voltage and amplify current clamp signals for suitable measurement on ADC (see Analog Front End schematic for one way to accomplish this)
- Computer with internet access
- Edge Impulse account
Analog Front End Schematic
Data Collection
For demonstration purposes, we utilized a lamp, desk fan, mini refrigerator, blender, and a toaster, collecting data on a combination of appliance states. The energy usage details will be detected via a current clamp, connected to the Particle Photon 2. The analog front end, in the simplest sense, captures and conditions the voltage and current signals in such a way that the low-voltage ADC inputs of the Photon 2 can measure them safely and accurately. Plug all the devices into one power strip, with the current clamp connected to the main power cord on the power strip.Impulse Design and Model Training
In Edge Impulse, the Impulse is the whole pipeline, from collected data all the way to the output, demonstrating the data, digital signal processing, classifiers, and any output features that are utilized.Spectral Analysis
Once the Impulse design and model training phases are complete, it’s time to move into spectral analysis, which pulls out the valuable information about which devices are on. In this case, we’re interested in the harmonics, up to the seventh or about 420 Hertz (in the United States). Harmonics, based on the Nyquist theorem, dictate that it should be sampled twice. If it’s not, you’ll lose part of the signal and won’t capture that frequency.Feature Explorer
The feature explorer is invaluable after the data has been imported. This tool highlights inconsistencies in the data. Perhaps the data was incorrectly labeled for example. The Feature Explorer helps to identify such issues.Anomaly Detection
The toaster was selected to provide an idea of what anomaly detection looks like. No data is collected from the toaster (that would add 60 More combinations), and a toaster doesn’t look like our other devices. Our newest type of anomaly detection is the Gaussian mixture model. Through this model, you can identify the probabilistic bands of where the data shows up. If anything falls out of this band in any of these regions, it has a higher anomaly score because it’s unlike the sampled data.Gaussian Mixture Model (GMM)