This project involves;
- Hacking a fridge to act as the fermentation chamber
- Control of fridge cooling and heating to maintain a constant beer temperature using Arduino-based device and programming.
- Use of openenergymonitor setup and emoncms to monitor beer and fridge conditions during the fermentation period.
Hardware
Fridge
We picked up a second hand fridge (£50) to act as the fermentation chamber. By adding a relay on the electrical supply to the fridge, the temperature in the fridge can be controlled (see BrewPi's guide to fridge hacking). A ceramic heater is mounted at the bottom of the fridge to enable the temperature to be raised if necessary (if the beer is too cold, the yeast activity may be slow).
Within the fridge are two DS18B20 temperature sensors. One measures the fridge temperature, the other measures the beer temperature.The fermenter bucket was fitted with a thermowell to house the second temperature sensor. A 3.5mm jack socket embedded within the thermwell enables the sensor to be plugged in to the arduino as required (enabling the bucket to be moved easily).
Computer fans were attached to the shelf as a late addition to improve air circulation. They really should be fixed underneath the shelf to make more room for the bucket.
It turned out that the shelf struggled to hold the weight of the bucket when full, so some old wall tiles were used to prop it up! Will be replaced with something better before the next brew.
Arduino Control
The fridge cooling and heating is controlled by an Arduino Uno, which I built myself from components. There are guides on the web on how to do this. My device is also fitted with an RFM12B radio transceiver, allowing packets of data to send back to the monitoring system (I'll explain this shortly).
The Arduino Uni receives data from the two temperature sensors, and outputs to two relays- one for the fridge, and the other for the heater.
The difference in the temperature of the fridge and the beer is essentially the 'gain' for controlling the beer temperature. I have opted for simple proportional control. The further away the beer is from its setpoint, the colder (or warmer) the fridge target temperature will be. So if the beer is exactly at the required temperature, the fridge target temperature will the same as the beer.
The fridge target temperature follows this equation;
Fridge Temp Setpoint = Beer Temp Sepoint - Kp*(Beer Temp - Beer Temp Sepoint)
Where Kp is the proportional control parameter. I set this to 5 initially (not sure where I got this from), which means that if the beer temperature is 1 degC higher than it should be, the fridge will be cooled to 5degC lower than the beer. The idea of this is to encourage a fast response, although clearly there is a danger of overshoot if Kp is too high.
I thought about using PID control, and adding Ki and Kd parameters, but as will be seen, this isn't necessary.
The cooling and heating are activated on a hysteresis loop. So, for example, the fridge is turned on if the fridge setpoint is exceeded by 1degC, but only turned off when the temperature falls below the setpoint. This 1degC deadband stops the fridge being turned quickly on and off around a single temperature, which could damage the compressor. This means that the fridge temperature is maintained within 1degC of its setpoint. Also, I made a 'deadband' between the heating and cooling, so that they would never be on at the same time.
OpenEnergyMonitor & Emoncms
I set up an OpenEnergyMonitor system in my house, consisting of;
- Raspeberry Pi fitted with RFM12Pi radio transceiver
- Raspberry Pi runs OpenEnergyMonitor web sever with emoncms, and logs data from fermenter controller on an SD card.
- Data also sent to emoncms.org to allow fermenter to be monitored across the web (not just on my home network).
Thanks to the guys at OpenEnergyMonitor who have helped me get this system going!
Snapshot from emoncms dashboard.
Results
Amazingly, the beer temperature was held within 0.2degC of the target temperature (20degC) for the entire 2-week fermentation period. The proportional control algorithm worked perfectly- the fridge temperature oscillated through the 1degC deadband about its (moving) setpoint. The thermal inertia of the fermenter meant that the fluctuations in the fridge temperature had minimal effect on the beer temperature.
One issue I did find was that the fridge cooling and heating would often overshoot its setpoint. Particularly the heating. The heater would come on to raise the fridge temperature, but the temperature would rise too much, and so immediately cooling would be needed. I suspect this is because the ceramic heater actually stores quite a bit of heat within it, and keeps outputting when the power goes off. The issue might be improved by using a smaller heating element (I used 100W).
Snapshot from emoncms dashboard. The beer temperature (red line) stays within 0.2deg of the setpoint (20degC), while the fridge temperature oscillates about its moving setpoint on a hysteresis loop.
Snapshot of emoncms showing cooling (blue) and heating (red) status. 100 = "ON", 0 = "OFF". Every time the heat is activated, this is followed, after a short pause, by cooling. This suggests that the ceramic lamp continues to emit heat after it is turned off.
Future Improvements
- Add support brackets for shelf to take weight of fermenter bucket.
- Add real time clock to enable more complex fermentation regimes to be used.
- Make case for electronics.
- Get a smaller heating lamp (40W?)



No comments:
Post a Comment