Thursday, April 10, 2014

Fermentation Controller update

Since my last post there have been several significant changes to the fermentation control system.

Heating:
Now the system has the ability to heat one or both fermenters. Heating of the fermenters was achieved by converting a rectangular beverage cooler into a water heater of sorts by drilling and inserting a 120v 1500W heating element. A watertight seal was achieved using a rubber gasket as well as silicone caulk. The heating element was controlled initially by an arduino UNO running a PID algorthim (and monitoring the temperature of the bath, which was recirculated using a small submersible pond pump) which opened and closed a SSR. This functionality was then transferred to the due running all of the other functions. Heated and cooled water are supplied and returned in separate piping.

The system to allow for simultaneous heating and chilling of two different beers. Currently, switching between supplying heated or cooled water to the fermenter is done by physically changing the hoses to the pumps. When I can scrounge up enough funds, I will add some 3 way solenoid valves to allow for automated switching. Also in the works is some hard plumbing, replacing the ungainly vinyl tubing.

Monitoring of the water jacket
A design modification of this version is monitoring of the water jacket temperature. By using this temperature to control the action of the pumps (overridden by the temperature of the beer), over and undershoots of the beer were greatly reduced. A downside of this is more frequent activation of the pumps, which can reduce their lifetimes.

So far, the system has fermented 2 beers, a kolsch and a dortmunder lager. The kolsch is currently carbonating, but tastes great. The lager will remain in secondary for another month before being kegged and carbonated.

Here is a picture of the setup before hard plumbing. Note the addition of the hot water reservoir on the right.



An android app, mirroring the functionality of the computer app, has also been created.

Sunday, December 15, 2013

Arduino powered Cylon pumpkin

This has all happened before...


Reason: Halloween. Arduino. It's cool.

Equipment:
Pumpkin
Red LEDs x 12 
spare breadboard
Arduino Uno - to control the leds
Arduino Due - to play the sound file via the DAC
Cylon waveform - acquired here (  )
Parchment paper - to diffuse the light from the leds
Speaker - salvaged from old laptop

LM386 based audio amplifier (built on breadboard)

Method:

Print up an appropriate cylon template to carve up the pumpkin with (I went with the new school version). Then wire up your spare circuit board with the LEDs. I suggest connecting them as shown in the picture with a common cathode (negative side). You'll need some small resistors, one for each LED, to keep the current flowing across them to an acceptable level.


Also, you'll need to build an audio amp, as the DAC from the due can NOT drive a speaker, and indeed, trying to do so will most likely burn out the DAC (this is bad). The circuit is sketched out here (credit http://arduino.cc/en/uploads/Tutorial/LM386_AudioDue.jpg) :



Now get to coding. Check out the code on my github account ( https://github.com/chchchchia/Arduino-Cylon-Pumpkin ). I set the Uno to signal the Due at the end of the led sweep via raising a digital pin high. This signal tells the Due to play the audio signal.
Of course, you should test the lights.

 Now, CARVE.




 Next, get some parchment paper (or wax paper, or a light diffuser) and cover up the parts inside of the pumpkin that have holes.
 Now, you have one of two options : a.)get a plastic bucket and place your boards in this, and run the power line through a small hole in the back OR
b.) cut a big stinking slice out of the back and have the boards external, with only the LED array inside the pumpkin


Regardless of what you choose, test the setup!


Now, find a suitable location, plug it in, and enjoy!


Laptop monitor to LCD monitor conversion

The idea behind this project was to add an extra high resolution monitor with good color rendition to my setup with minimal cost.

Equipment
LCD screen from Dell XPS M1530 laptop
Scrap pegboard

Needed to buy
new power converter/transformer for florescent lamp
new interface for DVI/VGA
These are specific to the LCD brand and model. Check the back of the panel. I got mine off of ebay.

Needed to build
Stand
power converter to transform 18 V from old laptop PS to 12 V for converter board

Method:
I essentially followed the same process outlined here, but made a few alterations.
1.) Instead of rather large blocks of wood used in the tutorial, I decided to use some scrap pegboard I had laying around.
2.) I did not have a 12v power supply capable of supplying the needed current to the inverter board. So, instead of buying a new one, I decided to build a voltage regulator to take the ~18 V from an old laptop power supply down to the needed 12 V. To do this, I designed and built this circuit:

There are four 7812 voltage regulators in parallel to provide the 3.2 A required of the monitor (each 7812 can only provide 1A at a maximum)

An unfortunate byproduct of this voltage drop is a loss in efficiency which results in a generous amount of waste heat. A heat sink, and some thermal paste were needed.
The monitor was mounted to a previous lcd's display stand.





And there you have it, a 1680x1050 display. 

Sunday, December 8, 2013

A homebrew fermentation controller system

Fermentation is a tricky process. Not only must yeast have proper conditions in which to flourish (fermentable sugars, high oxygen levels, etc) but also must be kept within a specified temperature range. The last requirement, as well as an interest to learn more about programming, led me to develop this fermentation controller. There are commercial temperature controllers available (namely the excellent Johnson Controls A419, which I use to control the temperature of my keggerator as well as a converted chest freezer). The cost of these controllers, however, is too high to justify buying several of them. Also, building things yourself gives you a greater understanding of the principals involved. It's also more fun.

The first step in this adventure was designing the fermentation vessel itself. Homebrewers often use use 5-6 gallon glass carboys to ferment in, for their ability to provide an oxygen barrier as well as their durability and low cost compared to stainless conical fermenters. The most common method to control homebrew fermentation is to stick the carboy in a converted chest freezer and set the temperature to somewhere close to the desired range. This has several shortcomings:
  • No direct measurement of the fermenting beer temperature
  • Reliance on on air conduction through a thick glass barrier to remove heat
  • Wide temperature swings, which can slow fermentation and also produce off flavors from the yeast being stressed.

I needed to figure out a different method, so I decided to make use of  liquid conduction of heat, which is much quicker than air conduction and can also provide a heat sink to limit quick temperature swings. In essence I developed a temperature controlled bath. The carboy sits in an igloo cooler with a copper coil wrapped around it that is submersed in the bath.

Water is added until the carboy is just beginning to float. The copper pipe carries coolant that chills the water bath surrounding the carboy, which in turn chills the beer fermentating inside the carboy. Cold coolant is pumped into the top and removed from the bottom of the coil to reduce any temperature stratification that may occur. My next step was to devise a way of cooling the coolant.
Being familiar with glycol systems, I decided to build a similar system. Not having the cash to buy one, I built one using a small dorm room style fridge and a rectangular beverage cooler. The chill plate was very carefully lowed into the cooler which was filled with coolant and a small pond pump to constantly circulate the coolant, again to reduce stratification. Great care was taken in manipulating the chill plate, as a kink in the lines providing freon would reduce efficiency and a break would destroy the system's ability to cool. Even with an antifreeze mixture the system can only chill coolant to ~40 deg F, owing to it's small size and the inefficient method of heat extraction provided by the submersed chill plate. This is fine for most primary and some secondary fermentations. Lagers would most likely need a more efficient, and probably more powerful, system. Coolant is sent to the fermentation vessels (I decided on two of them, though an additional one might be possible) via submersible pond pumps.









Temperatures are monitored using the DS18b20 temperature probes, which are accurate to within 0.5 deg C (~0.9 deg F). These probes are in stainless thermowells which are inserted into the fermenting beer and the coolant.

A small relay board is used to supply power to the pumps as well as to the temperature module of the fridge.

The controller itself is an Arduino Due microcontroller. It is ARM based, and has a generous amount of RAM (96k)and flash storage space (512k). Also, there were preexisting libraries for the temperature probes, lcd screen, and ethernet/SD shield. This shield allows the controller to be connected to the internet and communicate with the computer based application. This connectivity is not required for functionality. The Ethernet shield can either be added to an existing Ethernet connection or, as was required for this project, a wireless bridge supplied by a Linksys wrt54g with DD-WRT firmware. Setting this bridge up is outside the range of this writeup, but can be read about here.
The lcd shield is a 16x2 (16 characters by 2 lines) with an array of 5 buttons as well as one reset button. The 5 directional buttons are connected via resistors to form a voltage divider. This voltage is read on an analog pin (A0 in this case), and its value identifies which button is pressed. The reset button is connected directly to the reset pin of the microprocessor.


Software


The code for the arduino controller is written in C, with some C++ libraries.
This code monitors the temperature probes every 2 seconds, stores the most recent values, activates the fridge cooling circuit and the pumps as needed, forwards the set points and relay statuses upon command to a user connected to the Ethernet shield, as well as displays those values on the lcd screen. The lcd screen has a menu system from which the user can view the current temperatures, change the desired temperatures (the set points), and change the differential for each probe (the maximum allowed temperature swing). The LCD graphics library is m2tk, and is excellent.




This code also serves up temperature values to a connected instance of the computer application, as well as receive and implement commands to set new set point values.
This code, in its entirety, is available on github at https://github.com/chchchchia


The computer application is written in java. This program connects to the fermentation controller using tcp packets, acquires the latest temperature values, issues commands to set new set points, and logs the recorded values. The most recent (up to 5 minutes worth) are graphed on the main screen using the JfreeChart library. It uses swing for the gui, and SQLite (with excellent JDBC drivers available from xerial) to log the received values. These values are logged for up to a week and graphed on demand from the main application. The application retrieves new values every 5 seconds.










Problem:
Eventual overflow of the counting system due to use of millis (which in this case is the number of milliseconds since the last reset) and limited memory. (Approx 50 days). This eventual overflow is accounted for in the code. Unfortunatly, there is no soft reset option for this microprocessor...

Future plans:
Android application
Built in calibration menu
Ability to add an arbitrary number of fermenters to the controller, as well as controllers to the entire system.
Ability to change the ip address of the controller from the menu system
Logic system that takes into account the size of the fermenter, reaction time of the system for controlling coolant flow. This will require thermodynamic calculations and some testing.
Heating option