Get Amped for Energy Savings with AI-Powered Electricity Monitoring

Smart energy monitoring and consumption management is becoming increasingly important to the success of businesses everywhere. It’s not as trendy or exciting to engineers as, say, making plans for new clusters of GPU servers in data centers, but technologies like this draw tremendous amounts of power. And the associated energy expenses can be more than enough to sink the forward-looking projects that drive innovation, future profits, and employee satisfaction.

So like it or not, energy monitoring will demand more time from engineering staff moving forward. That is not especially good news, since present monitoring technologies generally require sensing instrumentation to be individually connected to each device that needs to be monitored. Of course there is also the infrastructure that is needed to collect, track, and analyze all of that data. And you certainly cannot forget about the continual maintenance associated with hundreds or thousands of discrete, physical monitors and the complex systems that support them. You might as well kiss those dreams of building the next big thing goodbye!

That does not necessarily need to be the case, however, because engineers have a powerful tool at their disposal called automation. Edge Impulse’s own Brennan Dayberry has been hard at work recently demonstrating how edge AI can be leveraged to intelligently automate energy management while simultaneously reducing the number of required physical sensing devices — to as few as a single unit. This sort of undertaking can be a Herculean effort in its own right, but Dayberry showed how Edge Impulse and a powerful, yet inexpensive, edge computing platform can make short work of the job.

The Particle Photon 2-powered smart energy monitor

The overarching strategy developed by Dayberry involved using a non-invasive current clamp to measure the unique energy-draw signatures of a variety of devices simultaneously. When many devices are involved, this is a fairly messy source of data that cannot readily be understood. But by using a machine learning classifier that has been trained to identify each unique signature, one can recognize, from this single sensing source, all of the devices that are switched on and operating normally. Furthermore, by utilizing an anomaly detector, it is also possible to recognize when something unusual is happening, like a piece of equipment that is drawing more (or less) power than usual. This likely indicates that service is needed to restore efficiency and maybe even prevent a future failure.

Dayberry selected the powerful Particle Photon 2 development board for the task. It comes equipped with an ARM Cortex M33 CPU, 3 MB of RAM, and 2 MB of flash memory, which is more than sufficient to run a machine learning model that has been highly optimized by Edge Impulse. The Photon 2 also comes standard with Wi-Fi and Bluetooth Low Energy transceivers for wireless communication — for example, with an energy tracking database. This board was hooked up to a non-invasive current clamp, which was attached to the cord of a power strip.

Linking the Photon 2 to Edge Impulse for data collection

For demonstration purposes, a lamp, desk fan, mini refrigerator, blender, and a toaster were plugged into the power strip. Next, the Particle Webhook builder was leveraged to connect the Particle 2 to the Edge Impulse data ingestion service. At that point, training data could be collected from the current sensor and automatically be forwarded to an Edge Impulse project. In this configuration, various combinations of devices were turned on to collect data from them during normal operation (the toaster was left off to test the anomaly detector later).

With a solid dataset ready to learn from, an impulse was created to analyze data from the time that the current clamp captures it until the models make their predictions. This impulse begins with a preprocessing step that first slices the electrical current data into windows. Next, a spectral analysis is performed to extract the most informative features from the raw data, which in turn makes the downstream algorithms more accurate and efficient. The features are fed into a neural network classifier that is designed to determine which of the known devices are on or off, based on their current draw signatures. A Gaussian mixture model is also utilized to detect any anomalous power draw activity that might indicate a problem or a need for maintenance.

A closer look at the impulse design

The previously collected dataset was used to train this impulse, and after the process completed, a confusion matrix was presented to help in assessing the model’s performance. Confused by confusion matrices? No need for that — they are just tables that highlight classes that are being confused by the model as belonging to another class. Overall, the model was 97 percent accurate, which is excellent for a first pass. It was noted, however, that there was room for improvement in the blender-lamp and blender-fan classes. Collecting a bit more training data should patch that right up in a future revision.

The results were more than good enough to prove the concept, so Dayberry deployed the model to the Photon 2. The EON Tuner was first utilized to optimize the model for execution on the device, then the impulse was loaded directly onto the physical hardware. This not only maintains privacy, but also reduces latency when compared with a cloud-based processing scheme.

The Datacake dashboard gives a clear overview of energy usage at a glance

With the energy monitor up and running, Dayberry demonstrated a few ways that the model’s predictions can be used. In one example, a Datacake web dashboard was developed that shows the power status of each device alongside power consumption, wattage, and anomaly information. This could, of course, also feed into any internal monitoring and alarming solutions that an organization already has. It was also shown how a simple OLED display could be built into the device itself to show the on/off status of each device — this option might be especially appealing to smaller organizations.

A project like this can be completed for under $50 in parts and in a matter of hours, so it may be a very wise investment for organizations that are starting to see their energy costs soar as they integrate AI and other cutting-edge technologies into their existing processes. Dayberry has written-up a detailed report of his work, so be sure to take a look if you could use a few pointers in getting your own system off the ground.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter