Have you ever walked away from your refrigerator, not knowing that you left the door ajar? Perhaps you are one of the many people who like to ponder what your next meal will be, with the fridge doors wide open. Maybe you have young children who are constantly opening and closing the refrigerator searching for snacks.
Whatever the situation, the problem is obvious. Refrigerator doors that are open for extended periods of time waste energy, and wasting energy means wasting money.
This project was designed to detect when a refrigerator door, or any door for that matter, remains open for an excessive amount of time. The idea was contrived while leasing an apartment and having to use an older refrigerator that accompanied the unit. On more than one occasion, the door would physically be closed, but then on its own, become ajar. This was often due to the fridge being overfilled or the door heavily loaded with items. At times the fridge would remain that open for hours, resulting in the contents becoming spoiled and energy wasted.
The plan was to design a device, that could be integrated with the refrigerator door frame, to be able to indicate if the door had been in an open position for a period of roughly 20 seconds. If the door was open, a button would be released and a timer initiated. At about 20 seconds, a buzzer would sound, indicating that the door was open for an extended period of time. The buzzer sound would remain until the door was shut.Build
A prototype of the device was built using a few simple items (see Hardware Components List). Particle-Photon-1 was placed onto a breadboard with a Piezo Buzzer. Another smaller breadboard housed the push button, and Particle-Photon-2 was placed onto a third breadboard. All three devices were designed to work as a system.
The breadboard with push button was affixed to the door frame of the refrigerator. With the door in a closed position, the push button would remain pressed. Alternatively, with the door in an open position, the button would release and after 20 seconds, signal the buzzer.
Photon-1 publishes an event that fridge door activity is occurring. Photon-2 subscribes to that event and lights an LED signifying that it has received the buzzer signal. As the LED turns on, Photon-2 publishes an event again and Photon-1 subscribes once more, signaling its LED to turn on. This indicates successful communication between the devices. Once the door position changes to closed, the buzzer and LEDs turn off.
The push button was connected by wire to the D3 pin and to a ground pin on photon 1. The buzzer was connected to the D4 pin and to a ground pin on photon 1. The LED is at D7 for both photons.
The refrigerator door activity data was collected using IFTTT. We created a applet that would record when "fridgeneedshelp" was published as an event in real time and this data was recorded onto a Google Sheet. The data plot below shows this open/close door event. We did an experiment with our photons where we would have the button released for several minutes, and then press the button for at least 10 minutes, and then we would repeat. If you look at the 2 minute mark you can see the next event is at 12 minutes, this indicates that the door was closed between that time period. From the 19 minute mark, the next mark is at 32, which indicates that the fridge was closed during this time period.
Here is a link to the live-stream of the data