Twitter icon
Facebook icon
LinkedIn icon
Google icon
Reddit icon
StumbleUpon icon
Del.icio.us icon

Predict the future? You can with predictive maintenance!

Added to IoTplaybook or last updated on: 04/13/2022
Predict the future? You can with predictive maintenance!

Story

Predict the future and prevent big repair bills!

If you live in a cold climate, then you can appreciate having a boiler. It's a critical component to providing heat to your home. If your boiler breaks down, that means no heat. And you don't want to find out that your boiler doesn't work in the middle of winter. However, with predictive maintenance, your Opla IOT kit can monitor and determine if your boiler is behaving abnormally. How does it do this? With anomaly detection in Edge Impulse!

Things used in this project

Hardware components

Arduino Oplà IoT Kit
Arduino Oplà IoT Kit
 
× 1

Arduino

Battery, 3.7 V
Battery, 3.7 V
 
× 1

Newark

USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
 
× 1

Newark

Adafruit

Software apps and online services

Edge Impulse Studio
Edge Impulse Studio
 
 

Edge Impulse

Arduino Web Editor
Arduino Web Editor
 
  Arduino
Arduino IoT Cloud
Arduino IoT Cloud
 
  Cloud.arduino.cc

Hand tools and fabrication machines

Tape, Adhesive
Tape, Adhesive
 
 

Newark

Why Edge Impulse?

For most of my hobby projects, I use Edge Impulse as much as I can for my embedded machine learning projects. It's intuitive, powerful, and low-code. Even though the Arduino MKR Wifi board isn't officially supported by Edge Impulse, I thought this would be a good test of my skills using the Opla IOT kit for the Arduino #CloudGames2022!

For this project, I affixed the Opla IOT kit to the top of my boiler. The goal of this project was to log accelerometer data (from vibration of the boiler) with the Opla kit, pass it to an Edge Impulse model, determine the state of the boiler from the model inference, and pass the results of that inference to the Arduino IOT cloud. This is ideal because you are only passing metadata (the boiler state and anomaly value) and not the raw accelerometer data to the cloud, improving security and reducing bandwidth strain. Ideally, you want the accelerometer to be as close to the source of vibration as possible, but attaching the kit to the top of my boiler seemed to work well enough.

I started my project with data collection following this tutorial on advanced anomaly detection. I mounted the Opla kit to my boiler, connected it to my laptop, and created a new project in Edge Impulse. I wrote a quick sketch following the data forwarder example here, and connected the MKR Wifi board to Edge Impulse to start reading accelerometer data. I had just two classes for the data collection: off and on. I did 6 minutes of data collection with the boiler off, and 6 minutes of data collection with the boiler on.

Boiler project data collection in Edge Impulse
Boiler project data collection in Edge Impulse

Note the training/testing split in the top middle of the screen. You should be splitting up the collected data into a training and test set so you can validate your model. I did not do that in this case and will split the model data in the future.

Once the data was collected, I created an anomaly detection impulse:

Boiler project anomaly detection impulse
Boiler project anomaly detection impulse

Edge Impulse does a lot of the hard work for you, so I just accepted the default values and trained my model. Once the model was trained, I did a couple live classification tests, and then downloaded the model to an Arduino.zip file. I imported the library into Arduino Web Editor and then started testing out my code. See below for a couple videos!

Boiler on demo

Testing anomaly detection capability

The processing window is 2 seconds, and there is some latency in getting the status to the cloud, so it's not immediate, but within a couple seconds of when things change. Enough time to call your heating company for a tune up!

Initial Setbacks

This project wasn't without challenges. I first ran in to trouble when I tried to integrate the Edge Impulse model into the board. Because the MKR Wifi 1010 isn't officially supported, I ran into compile errors right off the bat. After several hours of search engine queries and message board questions, I had a solution in some simple #defines to clean up the compile errors. You can see those in the code in the definitions.h file. The second issue was the state of the Opla shield. I couldn't get the screen or 18650 battery didn't work on the Opla shield. I was also having issues reading the temperature data from the shield, which would cause frequent reboots of the board. Not ideal but it wasn't required for what I was doing. I was able to connect a battery directly to the MKR Wifi 1010 via the JST connector to get unplugged power to the kit.

Wrapping Up

This project was a lot of fun. As usual, there were some unexpected obstacles to overcome, but I'm happen with how the model and code performs with only 12 minutes of data collection. I could certain improve the model with additional data logged. Other future capability could include a text (via Twilio) if the anomaly threshold is triggered, as well as additional data in the IOT dashboard (with a functioning shield, haha). It would have been nice to see the temperature and humidity setting in real time from the dashboard as well. Perhaps if I get another shield I will give it a try. I hope you enjoyed reading this! Feel free to reach out with any questions.

Code - Boiler Preventative Maintenance Code

Arduino sketch to detect anomalous behavior in a boiler by using an Edge AI model to detect excessive vibration, indicating that maintenance may be required.

jlutzwpi / Opla-boiler

Repository for boiler predictive maintenance — Read More

Latest commit to the master branch on 3-13-2022

Download as zip

Credits

Justin Lutz

Justin Lutz 

Quality manager by day, tinkerer by night. Avid runner. You can tell I'm a dad because of my jokes.

 

Avnet

This content is provided by our content partner Avnet, a global technology solutions provider with end-to-end ecosystem capabilities. Visit them online for more great content like this.

This article was originally published at Avnet. It was added to IoTplaybook or last modified on 04/13/2022.