Software Update
Fridge control needn't be complicated...
But where's the fun in that. Anyhow there can be one or two problems with such a straightforward approach.
Firstly the temperature of a full keg or FV takes quite a while to respond to changes in the surrounding air temperature.
So if the beer's more than a degree or two above the set temp the fridge may run continuously for a
long time. That means the air temp inside it can get seriously low, causing icing up and possibly even freezing the beer lines. It also means the condenser and compressor can get pretty hot - domestic fridges aren't built for a 100% duty cycle.
Secondly unlike a traditional mechanical thermostat, the temperature measurements from a digital sensor tend to jitter a bit.
So when the temp is very close to the set point the controller sees lots of 'too warm' / 'not too warm' in close succession and tries to turn the fridge on and off very fast. This is a
really bad idea because the compressor takes a much higher current when it's starting up and will rapidly wear out if you don't run it for a bit once it's going.
For these reasons when I wrote the V1.0 software I added a couple of timers that limited the maximum and minimum time the controller would run the fridge for without a bit of a rest. I also added a 'min air temp' setting that stopped it taking the fridge too cold.
That worked pretty well but I realised after a bit of experience using it that what I really needed was a way to make the fridge temp track the temp of the beer with a controllable offset.
Sort of like this (timers etc not shown):
By the time I'd realised this however one or other fridge was in pretty much continuous use so I didn't feel much like messing with the controller.
Adding the heaters into the mix gave an opportunity to implement this idea and at the same time add a similar algorithm to 'track' the temperature of the heat belt to a certain offset
above the temperature of the beer. Also an additional timer was needed to prevent the controller from switching too quickly from heating to cooling and getting into some kind of death-spiral; and some safety lockouts to behave sensibly if one or more sensors failed.
Implementing this this got quite complicated and I ended up writing it as a state machine.
Anyone who's sufficiently interested can see the relevant bit of the code on GitHub
here.
I should add that (as usual) the most complicated part of the whole exercise was making a sensible user interface that worked on a 20 col 4 row LCD display with a single click-turny knob
Next... hacking the fridges (again)