I'm in the middle of a basement retrofit and have a refrigerator that I'm hoping to convert to a kegerator. Before I go to town drilling and such, I was wondering if there was a way I could use a Raspberry Pi to control the flow of CO2 to the tap?

One way that I can think of would be to connect it to a servo that would mechanically displace the faucet (squeeze or perhaps a lever). The other would be to figure out how to control the flow of gas through the tubing with a Pi by somehow displacing the ball lock on the inside of the connector.

I may be missing something obvious here so I'm open to suggestion. Ultimately, what I'd like to shoot for would be a push-button beer dispenser (perhaps PIN-protected for the kids).

  • We need a homebrew tag here :) Perhaps someone with more reputation can do this. I'm using my raspi for homebrew stuff, too.
    – notlesh
    Jan 3, 2013 at 7:55
  • 1
    Added a homebrewing tag. Are you aware of other questions that could use this tag, @stephelton?
    – Bengt
    Jan 8, 2013 at 20:40

2 Answers 2


You can use a gas solenoid or valve to control the CO2 supply.I am not sure if it is linear, as in control the flow amount or just on or off. But in order to provide linear power you would need something clever to drive up to 12volts. Otherwise a simple relay will work.

enter image description here

On ebay here

The rest will need to be done on the Pi. A web interface? Touch screen interface? Keypad or just a key and button (You know like in the movies when they launch nuclear rockets.. sweet!)

Remember to have a manual safety valve at the source. Never leave it turned on when you are not around. Just turn it on when in use.


If I'm reading your question right it sounds like you want to have the Raspberry Pi actually turn the flow of beer on and off. The simplest way to do this would be to have a beer faucet that is actuated by a servo. I'm not aware of any such device for sale but I did find the following patent which seems to describe what you're talking about:


The original proposal to control the flow of CO2 to a faucet won't work. The beer has to be under pressure or it will go flat. If the beer is under pressure then it will flow out of any open tap. Leaving a tap open and only applying CO2 when you want beer to flow will result in flat, oxidized beer.

An alternative might be to put a stainless valve in the beer line as close to the tap as possible. Have the Raspberry Pi open and close that valve. The only problem is that there will be beer that stays in the little bit of line and faucet that's past the valve and it will get pretty funky.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.