• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

Arduino Keg Sensor for Level, Temperature, and Pressure with Display

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

UncleD

Well-Known Member
Joined
Dec 1, 2018
Messages
192
Reaction score
193
Needless to say I've had some free time on my hands with the quarantine. I've always wanted to be able to see the level in my keg without having to lift it, and always thought it would be nice to have temperature and pressure as well. I decided to build a keg sensor that monitors all of these values and displays them. I also added periodic storage to a cloud database so I can trend the data. I plan to add thresholds to each of the parameters so I can receive a push notification if any of them go above or below desired setpoints. I figured you guys would find this pretty cool, I certainly like it!!

The sensor is integrated into the corny keg lid, and can be unplugged from the display...
IMG_6322.JPG


The display sits on the tower behind the tap, so no modifications to the kegerator were required...
IMG_6340.JPG


Here's a couple of the trends, I've had a few beers since the picture above was taken :p
Trends.PNG


Let me know what you guys think!
 
Nice! How are you sensing level in the keg?

Brew on :mug:

Thanks @doug293cz! I'm using a time-of-flight sensor to measure the distance to the top of the beer level. Calibrated at a high and low, and interpolating between the two points. Its in a waterproof enclosure that I 3D printed and installed just below the lid along with the pressure and temperature sensors.
 
Pretty cool! Pictures of the sensor setup would be nice.

I was looking around and I realized I didn't take any pictures of the sensor! I'll probably be building another one soon because I bought a few of each of the sensors (they are pretty cheap so it usually makes sense to buy a few!). I'll take some pictures of the sensor enclosure that I 3D print and how I mount it in the corny keg lid. I'll make sure to post them up here!
 
Yes, we need this!

Happy to hear you like it!

I'm happy to put together a DIY for this. All of the parts can be bought online, but the sensor and display enclosures are 3D printed, and I am happy to share those files as well, but I know most people don't have 3D printers. I could also print the parts and send them if people are really interested, or even go as far as putting together kits with everything.

Is there interest for any of this?
 
I would be interested in this. I do have a 3D printer myself.

Cool! I'm going to separate the sensor and displays as separate "projects". I'll start with the sensor, the sensor can be built by itself and a I'll provide a library to download that can be included in any C++ project on Arduino, Raspberry Pi, etc. Stay tuned....
 
I built another one of these and took a couple pictures of the sensor for you guys...

IMG_6509.JPG
IMG_6511.JPG
IMG_6512.JPG


The black is a food-grade epoxy, making this completely sealed and waterproof so it's easy to clean between kegs. I hope you guys dig it!
 
Very much so!If a kit, or even a finished lid were sold one day I'd definitely be interested. My frig shows me its temp, and my CO2 gauge at my regulator works for that, but as to volume of my keg I'm always curious.
 
A ToF camera requires an IR emitter and receiver, a microcontroller, and some support electronics.
This is one bare (sans enclosure) example. The OP's printed box is likely sexier than the camera assembly :D

1597704144425.png


Cheers!
 
I assume that's the other side (without the emitter and receiver and controller)?
 
Here I was thinking that I'd build something to weigh the keg in my keezer. This is is far more sophisticated.
 
To @Dexlor, load sensors have been tried, but there are intrinsic issues - like putting devices at the bottom of a cold cabinet that might get swampy at times (which pretty much kills any notion of using an actual digital scale) along with load cell drift innate to the tech...

Cheers!
 
Last edited by a moderator:
To @Dexlor, load sensors have been tried, but there are intrinsic issues - like putting devices at the bottom of a cold cabinet that might get swampy at times (which pretty much kills any notion of using an actual digital scale) along with load cell drift innate to the tech...

Cheers!
I'm sincerely interested in seeing how this works longer-term & under pressure. I really wish load cells would work long term as they seem like they would be awesome, but yeah - with the drift it just isn't fit for purpose. Flow sensors are great for measuring pours, but the idea of being able to take a direct keg measurement just feels like the holy grail if it works.

This is an awesome project @UncleD . How long has this been in place? Have you noticed any leaks of CO2?
 
Last edited by a moderator:
To @Dexlor, load sensors have been tried, but there are intrinsic issues - like putting devices at the bottom of a cold cabinet that might get swampy at times (which pretty much kills any notion of using an actual digital scale) along with load cell drift innate to the tech...

Cheers!

Ah, I had just started looking into load sensors and hadn't encounter mention of drift. Sounds like that's off the table.

I would be absolutely willing to pilot any hardware/software config for this project and report back.
 
A ToF camera requires an IR emitter and receiver, a microcontroller, and some support electronics.
This is one bare (sans enclosure) example. The OP's printed box is likely sexier than the camera assembly :D

View attachment 694323

Cheers!

Depends on how sexy the wiring job is... He did say there was a temp and pressure sensor in there as well, so I was mostly curious how it was all working in that box on only 4 pins. Could be an ESP type board in the box, but with I2C I guess they could all be on the same 4 with logic in the external display box.

Although now that's got me thinking. Depending on the ToF power draw, you could hook this up with a D1 mini and a couple AA batteries and perhaps skip drilling the lid.
 
Given all the problems folks have had with Tilt and iSpindles communicating through SS fermenters and fridge walls, an in-keg wireless solution may prove equally problematic...

Cheers!
 
Given all the problems folks have had with Tilt and iSpindles communicating through SS fermenters and fridge walls, an in-keg wireless solution may prove equally problematic...

Cheers!
Tilts and Ispindles need to be independent of the keg and float This unit is solidly attached to the lid - could an external antenna be added to the D1 mini?
 
That would preclude the proposed "skip drilling the lid" solution...unless you mean extending the D1's existing antenna inside the keg...

Cheers!
 
Yeah, a D1 plus antenna inside the keg should help. I'm also about to upgrade a mesh WiFi, so perhaps it wouldn't be as big of an issue with a closer AP anyways.
 
That would preclude the proposed "skip drilling the lid" solution...unless you mean extending the D1's existing antenna inside the keg...

Cheers!
Reroute the wire through the pressure valve on the lid and set up a spunding valve and have the wire exit through a port on the spunding plumbing. .
 
So thinking about this device compared to a flow meter (using RaspberryPints as an example host)...

Unlike a flow meter which can (and does) trigger flow counts "automagically" via the meter pulses plumbed into Arduino interrupts, and then "are self-terminating" wrt pour amounts (the stopped meter can then be detected by the counting code), I believe a device like this has to be constantly polled and the detected liquid column height banged against the "previous" legit measurement to detect a difference. That's going to put a bit of extra stress on communications, so one would want them to be solid...

Cheers!
 
Reroute the wire through the pressure valve on the lid and set up a spunding valve and have the wire exit through a port on the spunding plumbing. .

Running a wire through a keg PRV totally disables the ability for the keg to hold pressure. That can't be what you meant ;)
And running a wire through a spunding valve would totally disable it's ability to hold pressure as well...

Cheers!
 

Latest posts

Back
Top