loading
Has it ever happened to you to go to the fridge and discover that its door is slightly opened ... and probably most your food went to the trash ... Ghhhrr that jammed door that needs an extra push to make it close properly .......

This instructables will show you how to make an alarm system that will beep a buzzer if you leave the fridge door opened for a long time to remind to you to close the door. All new fridges on the market have this option built in, but some may want to upgrade their old fridges.

This video shows the system in action:


  • The Fridge Door Detector Alarm is easy to make - uses only 8components including the batteries!
  • Easy to set to your preferences for the time that the door is left opened - fully customizable!
  • Cheap - less than 5kg potatos.
  • Easy to install - installation means sticking a small box inside your fridge using sticky tape!
  • Easy to maintain - change batteries just every four-five months!
  • Encourages thinking and logic problem solving for the young electricians that will try to make it!
  • Finally - saves electricity costs if you forget the door opened for a long time.

Update History:
  • 1st Oct 2012 - Added several schematics in steps 4 and 5.
  • 4th Oct 2012 - Visually changed the code appearance in step 3.
  • 7th Oct 2012 - Instructions made more clear in step 3.
  • NEW: 8th Oct 2012 - Major changes in the ATtiny85 code: better power mode - enabled power save mode to reduce consumption. New code in step 3.
  • NEW: 9th Oct 2012 - Added description for how to set the circuit sensitivity up. See step 7.

Step 1: The Idea

What the Fridge Door Detector Alarm does is to detect whether there is some ambient light in the food compartment of your fridge or freezer. This happens when you open the door and the Fridge Door Detector Alarm system senses some light that may be coming from the bulb light in the fridge or from the door opening itself.

The Brain

I use an ATtiny85 microcontroller which is easy to program with an Arduino if you have one ;) Than you can write the code that will suit your needs perfectly - for example one may want to hear the buzzer 2- seconds after opening the door ... or maybe 45 or 2 minutes - you decide!

Using a microcontroler minimises the use of external elements which saves you time and cost!

The Components
  • ATtiny85 microcontroller
  • Arduino Uno
  • Prototyping board + wires
  • Buzzer
  • Switch
  • Plastic box
  • 180 kOhms resistor
  • 0-100 kOhms variable resistor
  • LDR - light dependent resistor
  • Batteries
  • Empty PCB to solder the schematic
  • Board holder for the ATtiny

The Tools
  • Soldering iron
  • Double sided sticky tape
  • Cable cutters and knife
<p>Excellent project! Do you think it would be possible to make one that sits externally to, say, a -20C freezer (that doesn't swing shut and a certain absent minded laboratory research assistant occasionally defrosts on accident with lots of expensive microbiology reagents inside of it)? Like, replacing the photo-resistor with a magnet and setting the device over the top? I just don't think batteries would work too well in -20C!</p><p>Thank you!</p>
<p>Yes, you can replace the photoresistor with a reed switch (like thishttps://www.amazon.com/Directed-Electronics-8600-Magnetic-Switch/dp/B0009SUEZY) and read its state with the analog input of the Arduino. </p>
<p>Awesome. I'm totally building this!</p>
<p>awesome but when my mom opened the frige door she got electrocuted!</p><p>:-P</p>
That is 0% likely to happen if you have followed the instructions. What power source did you use?
<p>CanI pay someone to make this for me?</p>
<p><a href="https://www.instructables.com/member/Wanarnold/" rel="nofollow"></a> <br></p><p><a href="https://www.instructables.com/member/Wanarnold/" rel="nofollow">Wanarnold</a>2 hours ago</p><p>Great <br> idea! Now I have to get husband to do it. It's important to keep your <br> fridge door shut or you can get food poisoning if the temperature goes <br>up too much. Here's a handy chart about <a href="http://www.fridgerepairs-adelaide.com.au/fridge-and-freezer-repair-adelaide-sa/food-fridge-safe/" rel="nofollow">fridge temperatures and food safety</a></p>
<p>Can Moisture inside the fridge affect the ckt??</p>
<p>Hello,</p><p>I am having problems compiling code ?</p><p>In function 'void setup_watchdog(int)'</p><p>'WDTCR' was not declared in this scope </p><p>I have tried compiling in v1.2 and v1.4 as well as earlier version of Arduino.</p><p>I also could not get to this link:</p><ol> <br><li><strong>Download this file: <a href="https://github.com/damellis/attiny/zipball/Arduino1" rel="nofollow">https://github.com/damellis/attiny/zipball/Arduino1</a></strong></ol><p>Any help would be appreciated,</p><p>Build_it_Bob</p>
<p>Hey, I've just realized that the WDTCR is now WDTCSR for ATtiny 24/44/84. So just replace that in your code. Hope it helps.</p><p>Regards,</p>
<p>tiagovaz,</p><p>Thank you so much ! I have been doing a lot of playing around with the ATTiny85 and now I see that the change for WDTCR / WDTCSR is required when moving from a test sketch on an Uno to the ATTiny85 .</p><p>Build_it_Bob </p>
<p>Thank you for your help!!! :-)</p>
<p>Dear,</p><p>i am newbie. when i compile the code. it's show error problem : port_to_output_PGM has a previous declaration. Please help me</p>
<p>Planning on this project..................what is the spec on the buzzer?</p>
<p>Most 12V piezo buzzers should work. Try this one for example: http://uk.farnell.com/pro-signal/abi-023-rc/piezo-buzzer-12vdc-leads/dp/1022400</p>
<p>Incredible ...excellent work . I want to make this to practice with the Attiny , and your commenting will help a great deal. Thank you so much for sharing this gem.</p><p>Build_it_Bob</p>
I also made a very crude version of this instructable. <br>https://www.instructables.com/id/Refrigerator-Alarm/ <br>Credits to hertzgamma for enabling me to have this as my reference! :) <br>Congratulations! <br>Please also visit my site for Arduino beginners who wanted to learn more: <br>http://arduinodude11.tumblr.com/
Hi, I'm really interested in doing this project. I have never programmed an Arduino or anything else for that matter. I've got basic soldering know-how, but that's it.<br> <br> One question though. Which version of the ATtiny85 microcontroller do you use? At Atmel's webpage there's 12 different versions.<br> <br> Alternatively, is it possible to use the ATmega328 mc that comes with the Arduino Uno when purchased from Arduino's store?<br> <br> Thanks in advance.
nice project
Congrats on the win. Great job!
Thank you, condrats to you too!
I would be happy to come in a lower place than you in the DIY audio contest. Great instructable, very well written, great pictures. good luck. we will see what happens tomorrow. (I did the Atari Punk Stick BTW.)
Hey, I saw your entry and it is great too! They are actually all amazing entries I think! Even some that didn't end up in the finalists. I wouldn't want to be a judge there ... because it seems tough to make a decision. <br> <br>Anyway :D, fingers crossed and good luck to you too ;)
Congratulations on being a finalist in the DIY Audio Contest!! Good luck to you!
Thanks!
After finding my beer warm, I'm motivated. Thanks! <br>Can you share the specs/part # of the LDR?
I measured it with the multimeter and the LDR's resistance is 50MOhms or infinty sometimes when in darkness and goes to several Ohms when under sunlight.
Works great thank you! :) <br> <br>marC:)
That's great! Could you please tell me what the problem that you described earlier was? Is it something to do with the sleep function?
i don`t know what happened<br><br>thank you!<br>marC:)<br><br>DO you have other arduino project?
Yes, check this one out! It is my latest instructable!<br> <br> <a href="https://www.instructables.com/id/Buzz-Wire-Alarm-Clock/" rel="nofollow">https://www.instructables.com/id/Buzz-Wire-Alarm-Clock/</a><br> <br> <br> Regards,<br> Pavel
Please vote for me in the DIY Audio and Hack It contests! <br> <br>Thanks!
Hi there! I tried but AVRDude gave me this error : avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85 <br>avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85 <br> <br> <br>:( <br> <br>can you help please? <br>thanks! <br>marC:)
Good Idea! I thought it was also a good project for the timer chip NE555, so I made a fridge door alarm using a 555 and a 556. Ill post my Instructable as soon I've done the project. At the moment its just on a breadboard...
Thanks, I want to see it!
I made it today and it works well. As I said I used an NE555 and a 556 instead of the &micro;C. Below is the circuit and the finished project. When I get the time, I'll also post an I'ble.
great instructable, very well documented. How long do these batteries last?
Thanks! Mu calculations showed that the consumption varies between 1 and 2mA, so if you put some better batteries of the sort of 2800mAh, it could last for three-four months.
really? don't you think the ATtiny runs off more than that?
Here is what the current measurement shows. It is in microamps.
You could maybe make the device go into powerdown mode and wake it up when the door opens. An attiny85 uses only 0.1&micro;A in powerdown mode. This would make your batteries last for a long long time.
Janw, <br> <br>I have some results that may be of interest to you. I managed to make the ATtiny sleep for a set period of time. While sleeping it uses only 6.8&Acirc;&micro;A current which is some 222 times less power consumption than before. <br> <br>The code is in step 3, and I will also add images and video later this week!
That is a great result indeed! 222 times less consumtion means that your batteries will last for a pretty long time.
Well yes, this is a very good idea - I had no idea that there is such a mode! I will have to figure out how to make it as I am new to ATtiny, but this is definitely a must try!
Will it work with Attiny85v-10PU? <br> <br>thank you! <br>marC:)
Yes, it will work with this type of Attiny. It will operate at 10MHz clock speed and the tricky part will be to find the right plugin that will allow you to program the Attiny via the Arduino Uno.
I will try it, i will let you know how it does.. <br> <br>thanks! <br>marC:)
I am keen to see that. Good luck!
Great job!!! Very useful! :)

About This Instructable

95,128views

208favorites

License:

Bio: I am a University of Edinburgh electronics engineering student.
More by hertzgamma:Aerial Photography Super Affordable Kite BOOGIE BOX: The Electromagnetic Dance Floor 3D Printed Molds Casting Tutorial: Complex Shapes 
Add instructable to: