Why the fridge? Well, having built various things for the tortoise, your normal host has been doing a good amount of research about hibernating Tilly. You need a good stable temperature of somewhere between 3 and 7 degrees which, you may well know is the sort of temperature a domestic fridge maintains. If you are shocked about the prospect of putting a pet in a fridge, don’t be, it is a widespread practice. Keeping a constant is important but getting too cold is not going to be good for her and too warm risks her waking up which also causes problems.
While a fridge aims to keep a good temperature, its own control system gives some variation and opening the door of course lets in warm air. The quest set was to see how stable the temperature is and what makes it vary. This is where some Shed Engineering comes in. You can buy various devices for simple temperature measurement which gives you maximum and minimum but if you want something that logs temperature, you are into industrial controls territory and lots of money. After being given a Raspberry Pi for Christmas a couple of years ago, there have been a couple of ideas for small projects that are in various schemes in different stages of development so why not have a go at another one.
Objective: measure the temperature of the box of soil in the fridge and record it so that worried tortoise owners can check on it.
I had already got a thermocouple unit so that we could calibrate the Rayburn oven temperature so as to burn the cakes less so we had a go using that. While that is good for very high temperature ranges, it is not great for sub-degree accuracy and early results showed things to be reasonably stable but not with the certainty needed.
The wonderful world of internet searches and open source development pointed me at a little device which would link up to the Raspberry Pi, allow regular, accurate measurements and be able to store them to look at them over time. The assembled nature of each of the hardware items meant very little construction was needed for the test and the various software tutorials pointing you to the library files for the temperature board enabled very simple program to give spot readings. The Raspberry Pi Zero board shown below is the core of things for the processing and here is seen dwarfed by the cable connectors for the prototype.
The fact that the operating system that is fairly normal for Raspberry Pi allows you to automatically run a program however frequently you like (a thing called Cron Jobs, which always takes me back to the time travel machines called the Chron-o-John in Day of the Tentacle, a game which distracted us from our final year studies for far too long, but that is another story) and has the ability to access web pages all means that we had something that sampled the temperature every minute and stored it in a database on a website for easy viewing where every you are.
Looking at a list of numbers is not that great. As much as selling my soul to Google goes against most feelings I have on the matter, looking for an easy way to turn lists of numbers into a nice graph without hours of coding led me to Google Charts which did just the job.
Having looked at the general temperature of the fridge, the box for Tilly was put in place and the measuring device refined slightly to make it suitable for being buried in the soil. This involved adding a small metal plate to one side to contact with the temperature measuring chip on the board and encapsulating the rest of the device so that it would survive being buried in soil which may be slightly damp.
The early results were promising in that the fridge appeared to be, and stay, within the required limits.
It did, however, highlight a few obvious things.
The fridge has some sort of defrost cycle so every eight hours or so the temperature rises up a couple of degrees before settling back to its gentle wobble around its target temperature, varying just by the hysteresis in its control system.
Putting stuff in the fridge which is warmer that the bits already in there has an impact on temperature, but not necessarily in the way that you think. If you put something room temperature in the fridge, you would think that the temperature inside would go up. True there is more thermal energy in the box. However, it very much depends where you put the item as to what happens. If, as we found (and is actually blindingly obvious) you put the warmer thing near where the fridge has its temperature sensor, it will think that things are warming up and run the compressor for longer to overcome this. The result is that the already cold bits of the fridge get very cold until the vital area gets cool enough to register all is well. While it does not matter if your milk gets a bit of ice on it or a small corner of your salad drawer gets a little frosted, your tortoise is a bit more picky and wants to avoid permanent eye or brain damage.
A few months of observations and experiments led to the happy position of a bottle of water always stored next to the sensor to give a) a cold mass to generally act as a sink for things going in and out and the air changes when the door opens (acting as a temperature dampener) and b) a physical reminder that you do not want to put a room temperature thing next to the sensor. A bespoke device was rustled up to make sure the appointed bottle does not roll away.
A couple of other refinements were made along the way.
Wrapping the box up in foil covered insulation gave the box an even slower response time to changes in the fridge so gives a very smooth profile.
The link to the website also gives a few more possibilities. The script that uploads the data checks the information to see if the temperature is within limits. If it is not, you can have an alarm condition to send you an alert. This is set up to be via e-mail and text message. E-mail is straight forward from the web hosting and there are many SMS applications that allow you to send text messages. Most have a free introductory offering but inevitably, there is a small cost to an ongoing service. Hopefully things will be stable enough to mean that we do not eat through texts as too fast a rate. The tests so far look good.
Given that you can run cron jobs on the web hosting too, it is set up to check every ten minutes whether readings have been posted (they should be there every minute). If there has been no activity, it sends an alert warning of system failure. This is not 100% sophisticated in that the fault could be that the Pi has stopped working or that the home internet which links it to the page has dropped out or that the reasonable value web hosting (which incidentally is the same used to host this blog) is having an off day. It may also be that the power to the house has gone off (and hence so has the fridge). However, given the relatively slow response time of the soil mass in the fridge with a reasonable amount of thermal mass (the general stuff and extra bottles of water), a Pi Failure alarm will not require urgent response as it will take a few hours to rise up to anything worrying if the fridge has failed as well. Anyway, the alert is there and someone can look into it.
Tilly is just preparing for hibernation now – no food and waiting for her insides to be empty before a bit of cooling down next week and into the box thereafter. If you want to see her comfort levels (if you can call 5 degrees C comfortable) have a look at the Tilly Temperature. Don’t fret about some of the variations in the past weeks and months, these were the various experiments. Hopefully it will be a smooth line over the next couple of months.
Here is the display squashed into a small box on this screen. The real page is a bit clearer.
That is all very fine, but perhaps Tilly herself might have liked a look in photograhphically speaking, after all she has just been on a pre-christmas diet and probably thinks she’s looking good!
I think the plan is for a pre-hibernation viewing and photo shoot next week.
Make sure you get her best side ?