Tuesday, April 21, 2015

Fermentation Detector

This is a follow up to my posts on automated home brewing:
Automated Home Brewing
and
Improved Home Brewing Controller

In the second post I mentioned that I would be adding a "bubble detector" to my interface. Now I have finally gotten the time to do it and am using it to monitor the fermentation stage of a lager. This sensor detects bubbles in the air lock and if you have ever seen an airlock in action you will understand why I call this a "bloop-ometer."

The sensor uses this photo interrupter with a simple circuit to trigger an interrupt on the Raspberry Pi which records how many bubbles per minute are produced. The photo interrupter has a gap with an infrared LED on one side and an infrared sensor on the other. Voltage is provided to the output pin until an object enters the gap and breaks the infrared beam.

In this case the object to block the beam is a small amount of water which is mostly transparent to infrared.  To overcome this the circuit has a potentiometer to adjust the voltage applied to the LED. It must be adjusted down until the sensor is just on the edge of triggering.  In this configuration, the water will block the infrared enough to trigger the device, but when a bubble passes, the infrared can pass.

The circuit is very simple - an interrupter and a potentiometer is all that is really needed. To make it easier to adjust, I added a red LED. I also added an inverter since the output from the sensor is not enough to drive an LED and trigger the Pi. The potentiometer that I used was 5K ohms and I added an additional 100 ohms for safety. If you use less than 100 ohms then too much current will flow into the LED and it will die. (I know this from experience.)

Here is the pinout for the GP1A57HRJ00F.

And here is the circuit as I built it.


And finally, a video of it in action.