Situation - We have an old side-by-side refrigerator in our (unheated) garage. Not an efficient beast, and at some point I'd like to send it to a farm upstate where it can run free with the other dinosaurs, but for now we need the space. We've also got a small chest freezer in the garage that is very efficient. My issue is that the fridge temp often gets higher than we would like and we've had more than one incident where some unnamed person that shares my gene pool left the door cracked open and we had to throw out a ton of food.
Intended Solution - I'd like to monitor the door open/close status and temperature, and drive alerts when the temp is out of range or a door is open for longer than 2 min (honestly, take a picture, kid, if you are that indecisive...).
Failed solutions - Fooled around the zwave door sensors (adhesive failed after hot/humid summers and doors opening/closing/slamming). Zwave Temp sensors in the freezer/fridge didn't transmit well (somehow being stuck in a big metal box didn't help the connectivity - who'd a thunk) and the battery lifetime was abysmal.
1 - DHT22 Temp/Humidity Sensor (for ambient temp of garage).
3 - DS18B20 1-wire temp probes (one for Fridge, one for Freezer, one for Chest Freezer)
3 - Copper Tape based contacts on doors. Note - not conductive adhesive - so only the face of the copper conducts, not the sticky side.
The copper tape based contacts are rudimentary but work really well. I've got two copper strips on the frame of the fridge/freezer with some electrical tape behind it because I didn't trust that the adhesive wouldn't conduct (I'm a cynic). Each strip goes to the konnected board - one to a zone, the other to "common". I've placed another strip of copper on the magnetic door seal. When the door is shut, the copper on the door seal completes the circuit and the zone shows "closed". If the door is cracked open even slightly, it shows open. The tape is well inside the magnetic seal, so no air/temp loss.
The temp probes were more problematic. I ended up getting silicone ribbon cable that I could run into the fridge under the magnetic seal and still provide reasonable airtightness. It's not pretty but it saved me from trying to argue with my wife about drilling into the fridge itself (plus I have no idea where the wiring harnesses are in all the insulating foam). I've checked the temp above where the wire goes under the magnetic seal and if there is a temperature difference, it's less than the temp sensor can detect. I'll accept the redneck engineering award at the end of this post.
One other comment about the DS18B20 temp probes - they are advertised as including the 4.7k resistor that you need to "pull up" the signal. If that's so, I don't think they work particularly well. They take 3V - 5.5V (though the accuracy decreases with lower voltage) and you can run multiple of them to the same zone (one-wire is fantastic as each has it's own "signature" in the chip). Even with a dedicated 5V USB power supply, I wasn't getting consistent readings. I added my own 4.7K resistor to the circuit and it's been stable ever since. Resistor goes between Vcc (5V) and the signal wire.
This arrangement worked great, except the temperatures were swinging wildly - enough that I was seriously concerned about the health of the fridge (and the health of the people eating the food from the fridge). The temps would cycle regularly and swing much higher than was safe when the door was opened (Side-by-side, all the cold falls out whenever you open a door). I wanted to check my results, so was looking for a cheap temperature logger - when I noticed that most of the good ones had the temp probe in a bottle of glycol. That lead me to this article about vaccine storage.
This quote in particular resonated: When the refrigerator’s door is open or when the refrigerator is performing its defrosting cycle, hot air currents rush in and immediately alter the reading of the normal probe. During defrost cycles, the evaporator coil behind the refrigerator is heated up to a high enough temperature to melt any ice or frost that may form inside, but at the same time, not too high to diminish or ruin the potency of the vaccines. Due to the large amount of heat supplied during this process, air temperature is drastically higher than the actual temperature of vaccines. Sometimes, this perceived difference in temperature readings results in disposal of perfectly viable vaccines.
After some more research, I landed on using a glass bead bottle as it performed as well and would be easier to clean up if spilled in our fridge (3 kids, have I mentioned that?)
With that - I've had one whole summer of stable monitored temperatures. Alerts when the door was ajar (container blocked the door from closing. Looked closed, but wasn't.) And my wife is now comfortable that she isn't going to get food poisoning from a warm fridge.
The pictures aren't pretty and I need to clean up my wiring as I've left it running all summer before I posted this. That'll be a wintertime project when my wife's parents come for 2 weeks and I need to retreat to the garage for some sanity time.
No real code tricks - I'm using the Safety Monitor to throw alerts to my phone and Text-to-speech when something is amiss ("Close the *&^&%$ing door" was on at first, but my wife overruled me. Probably for the best.) It doesn't have a battery backup - but neither does the fridge. I just started using the InfluxDB logger and Grafana about a week ago and need to build graphs for my dashboards. Otherwise - this does the trick and has operated for 3 months without a problem. Hope this helps anyone else.