
Story
Problem
A refrigerator is one of our home’s most common and useful appliances. It has changed society and culture by improving the quality of life for people. Refrigerator has increased food accessibility, and food preservation has become so much easier, thus also reducing food wastage. Refrigerator has another significant impact on the medical sector. It has made preserving and transporting certain medicines, including vaccines, easier, thus increasing accessibility. If a refrigerator storing medicine fails, it will spoil the medicines or reduce their effectiveness. Considering the importance of a refrigerator in our lives, I am trying to make something to predict a refrigerator failure allowing predictive maintenance in this project.My Solution
My proposed solution is to use a machine learning (ML) model to identify a failure as soon as possible using the temperature and humidity changes in a refrigerator. Project Link: https://studio.edgeimpulse.com/public/115503/latestData
A good machine learning model starts with a good dataset. Sadly, I could not find any open dataset of temperature and humidity levels inside a refrigerator, so I decided to build one. A machine learning model needs at least two kinds of data to identify refrigerator failure.- Normal operation data - Time-series data from a normally working refrigerator.
- Abnormal operation data - Time-series data from a faulty refrigerator.
- Keeping the fridge door open for an extended period.
1. Dataset Preparation
The parameters I want to capture are:
- Temperature
- Humidity
- Illumination - To check the door open/close status. The ML model will not use this parameter, and it is only to help us in visualising and understanding the data.
- A temperature sensor
- A humidity sensor
- A light intensity sensor
- A microcontroller board
- An SD card module
- A battery



2. Software for Dataset Preparation
The software used in the Arduino BLE sense and Arduino portenta for the data collection is available from this GitHub page.
https://github.com/sw4p/Refrigerator_Predictive_Maintenance
The Dataset_Collector.ino is for the Arduino BLE sense, and the Data_Recorder.ino is for the Arduino Portenta H7 with a Vision Shield.
The Arduino BLE sense records temperature, humidity and illumination reading every 200ms. The illumination data is used to detect when the fridge door is open. If illumination is greater than 0, then the fridge door is open.
3. Data Visualization
The recorded data is in CSV (Comma Separated Value) format, and it looks like this.

Normal operation of the fridge

Normal operation of the fridge

Normal operation of the fridge

Zoomed-in view of the normal operation

Simulated abnormal operation of the fridge

Zoomed-in view of the abnormal operation
4. Data Classes
As mentioned previously, due to the unavailability of a faulty refrigerator, I have simulated the abnormal operation using just one technique. That gives me only two classes of data - normal operation and abnormal operation. Let’s make most of what I have got.
Training
For training my ML model, I used Edge Impulse. Edge impulse is a fantastic tool for building ML solutions quicker. Edge Impulse has many excellent features for all stages of building an ML solution. One such cool feature is Data Explorer. It makes visualising the data points very easy.
Data explorer

Impulse creation
Testing
For testing the ML model, Edge Impulse provides two methods: a) Model testing b) Live classification In this project, I have primarily used the model testing method because I already had a lot of data captured. In the data acquisition tab, I assigned some data as test data, which are only used in the model testing.
Model testing

Set Confidence Thresholds

Show Classification

Classification Result

Wrong Classification
Deployment
Edge Impulse fully supports the Arduino Nano BLE sense development board, so the best way to deploy this ML model would be to build firmware.
Prepare a firmware

Flash scripts and firmwares