Home Blog


Buttons in case you want to go back to blogindex or back to front page

Side-project Sunday #1: Making my fridge a bit smarter

Introduction

So I've recently moved into my own place, a small apartment close to the university campus.

My apartment is great and all but there seems to be one huge problem. My fridge which I more often than not fail to close is stupid enough to not have an alarm system to notify its users when it has been left open.

The only logical solution to me was to come up with a system that sets up an alarm whenever the fridge has not been closed properly (as opposed to just teaching myself how to close the fridge).

I thought that while I was at it, I might as well implement a system that logs the fridge-door usage for some potential future analysis. Therefore I decided to increment a counter in the Arduino EEPROM every time the fridge is opened.

So this Sunday I woke up early and started building the contraption.

The project

I've brought with me some hobbyist electronics from my childhood home and decided to make some use of them.

In case you would like to build it yourself, here is a (more or less) complete list of items I used:

Here's an attempt on a circuit diagram of the contraption (I'm not very good at drawing these)

A circuit diagram depicting my wirings

The code

I wrote, in total, two different Arduino-Sketches for this project. One for the actual alarm system and another one for managing and reading the statistic written in the EEPROM of the Arduino

They're quite simple scripts (as one would imagine for a project of this scale). The most notable thing is to remember to use the button pin in the correct mode: pinMode(BUTTON_PIN, INPUT_PULLUP).

I added a delay before the code starts playing the alarm because I don't know if my neighbors would be very keen on listening to the beeping every time I open my fridge. One could also expand the code to feature a rhythm or perhaps even a melody that would play when the fridge is left open. I couldn't really manage this in my time frame and besides that I wanted the functionality over any aesthetics or other pleasantries anyways.

I've published the Sketches on GitHub and they're licensed under MIT so feel free to use them

Conclusion and demo

Below is a demo-video of the project:

In conclusion I deem the project "a great success" out of 10

Credits

I'd like to issue a special "thank you" to my friend for helping me with this project and providing some of the tools.