Refrigerator Monitor
This was one of the first practical projects I did. It was filled with exciting new hardware and concepts about which I had to learn. This is a very feature-rich project.
| Features |
|---|
| Audible indicator when the fridge door remains open more than 30 seconds. Instead of a ho hum beep, it the alarm plays “Blinded By The Light”. |
| Alarm if the fridge compartment rises above an adjustable temperature, this time playing “Hot Blooded”. |
| Alarm if the freezer compartment rises above an adjustable temperature. Because this is an important exception, a siren sound is played. |
| Text messages are automatically generated for all alarms. Texts will be re-sent every 10 minutes until the alarm condition clears. |
| A cloud-based dashboard that can be referenced anytime, anywhere. |
| Ability to change the temperature thresholds from the cloud in real time. |
The project revolves around a light-sensitive resistor for knowing when the fridge light is on, and therefore that the door is open, and a pair of temperature sensors to monitor the the fridge and freezer compartments. Data is monitored by the Arduino code over Wifi. Arduino code manages the musical alerts and cloud data management. Sending alarm texts is done with a separate set of processes:
- Arduino data is sent to the cloud using Adafruit/IO.
- A Python program running as a Docker container is triggered by the data posts and generates its own updates to a local MQTT broker.
- The MQTT messages are monitored by a local Home Assistant instance which sends text messages for the various alerts.
- A dashboard of the refrigerator operations is also available on Home Assistant which also feature visual cues for alert conditions.
| Basic Program Flow |
|---|
| Connect to local WiFi |
| Read fridge and freezer temperature sensor every 30 seconds |
| Read photoresistor sensor every 10 seconds |
| Asynchronously monitor for changes to the temperature thresholds via Adafuit IO |
| Send all readings to Adafruit IO feed |
| If any of the readings exceed the set threshold, play appropriate alarm |
| Simultaneous Python/Docker/Home Assistant monitor conditions and send alerts as needed |
| Project Toolkit | |
|---|---|
| Board | ESP8266 (WiFi) |
| Components | > DS18B20 temperature sensor (2) > GL5516 LDR photo resistor > Piezo passive buzzer (speaker) |
| Programming | > Arduino native (C++) > Python |
| Cloud mechanism | Adafruit IO |
| Text trigger | Home Assistant |
Adafruit IO manages the cloud dashboard and serves as the portal for changing the temperature thresholds.
| Adafruit IO Dashboard Fields | |
|---|---|
| Status | Shows red if there is an alarm condition, otherwise it is green |
| Fridge alarm limit | Fridge compartment temperature below which an alarm will be triggered |
| Freezer alarm limit | Freezer compartment temperature below which an alarm will be triggered |
| Refrigerator (current) | Current temperature of the fridge compartment. Gauge will be red if in alarm condition. |
| Freezer (current) | Current temperature of the freezer compartment. Gauge will be red if in alarm condition. |
| Fridge Temperature History | Fridge temperatures recorded over the last 24 hours. |
| Freezer Temperature History | Freezer temperatures recorded over the last 24 hours. |
Adafruit IO is made up of a code library for message send-and-receive services and customizable cloud dashboards. It includes a free service that I use in many of my projects.







