Our fridge has double doors, and it doesn't have automatic alarm. We decided to set up phone notification alarm. We used Adafruit ESP8266, it can be programmed with Arduino IDE, it has WiFi. We used two reed switches to determine if magnets, attached to the two fridge doors are close or not.
Project description:
Circuit. The circuit is very simple, shown in the picture below:
Since there are two doors and we need to detect whether ANY ONE OR BOTH of them are open we connected two magnetic Reed switches in series between Pin 12 and the ground. Pin 12 is set as input pullup in the code, this means there is an internal resistor between 3.3V source and the pin. In this configuration, when ANY ONE or BOTH switches are open (either one of them not conducting, at least on magnet is away, at least one door is open), the pin is high, current is not flowing. When both switches are closed (both are conducting, both magnets are close by, both doors are closed) then there the current flowing through internal resistor and the pin is low, it's grounded.
SinricApp. We set up an account with Sinric app https://sinric.pro/index.html. Initially we tried Blynk app (described here), but then switched to Sinric, because it has Alexa skill available. On Sinric page we registered an account and added the device (pic below top panel) as a contact sensor (middle panel) and enabled notifications (bottom panel) when it closes or opens. Sinric gives app key and app secret, that will be used in the code later.
In Alexa app we added Sinric skill then connected to the account. This added "fridge door" to Alexa devices. In Alexa app you can check whether the door is closed (pic below left top) or closed (pic below left bottom). Then we added a routine so that Alexa says "fridge door is open" and sends notification to the phone (pic below right).
In the code we set a cycle time to check the status every 10s (variable CycleTimeInSec). We also set a variable AlertTimeInSec to 60s. If the door stays open for longer than alert time, then Sinric sends notification event. After that the timer continues and if fridge door stays open for another minute Alexa alerts again.
Mounting. We scotch taped the breadboard to the top of the fridge and two magnets to each of the doors. We adjusted the position of the switches on the board and the boards itself carefully with trial and error, such that even smallest opening alerts us.
Here is the video demonstration of how it works, sorry it's a bit long, because we have to wait for a minute for the alarm:
As a result we always keep our fridge door closed. It's surprising how often it alerts us. The fridge doors aren't designed too well, they don't close automatically on their own, actually we need to put extra effort to close them. We probably wasted a lot of energy and cooling power before we installed such sensor.
Comments
Please log in or sign up to comment.