Keg Cop: Keg Monitoring and Control

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Fun news:
I just released my latest project - BrewFlasher Web Edition! Flash BrewPi-ESP8266 (amongst other projects!) to your controller, straight from your web browser.

This project took all the magic of BrewFlasher, and stuck it in a web app. Flash any ESP8266/ESP32 firmware supported by BrewFlasher, straight from your web browser. No downloads needed.

BrewFlasher Web Edition is available at: BrewFlasher Web Edition

The code is open source, and is available at GitHub.

Note - Due to the APIs required, BrewFlasher Web Edition only works in recent desktop versions of Google Chrome, Microsoft Edge, and Opera. If you don't use one of those browsers, try BrewFlasher desktop edition instead.
Yes, Keg Cop is supported by BrewFlasher Web Edition!
 
Certainly allowing people to integrate this into RPints was a goal so I'd be interested to hear how it works out for you. I would not be surprised if some tweaks are warranted.

Parts finally arrived (at least enough to do the basics), and I soldered everything together and got the interface up, so I'll be playing with this over the weekend. I need to rebuild a rpints instance, and I'm converting the kegerator over to quick disconnects at the same time, so hopefully I'll get some connectivity this weekend. Would love to see "proper" mqtt support for integration with Home Assistant at some point, but that's definitely on the "nice to have" category. Will report back when I get things going.
 
If I'm deviating from "proper" let me know (or, put in a PR ;)) and we can get things going. I don't have a home much less HAST right now but that's another adventure.
 
Just got the basics set up; kegcop standalone is working fantastic. I'm still waiting for my relay to show up so that I can hand control of the kegerator temp control over, but the flowmeters and temp sensors are working great! Thanks as well for the .stl files for the cases...they fit perfectly when I printed them.

So, I'm trying to rebuild my old rpints instance at the moment...it's been a year since I used it so I'm starting from scratch. In the meantime, I've pointed kegcop at my mosquitto mqtt broker but I'm not seeing anything show up. No connections, no nothing. I'll try again using a mosquitto instance on the rpints server in a bit and see if that works any better.

Anyway, once I get a little more data put together that will help with some troubleshooting I'll put in either an issue on github, or maybe try to figure out the issue and see what I can do to contribute some code. I'm completely new to the esp world but I'm having fun learning.
 
I did test with mosquito but I will admit that mqtt may be the least tested function. It didn’t seem to need much and is sort of outside of the main processing. If it doesn’t show up, you might try either a serial monitor or telnetting in (pretty sure I left that turned on). If you don’t see anything when you telnet in, just a blank screen, type “d” to put it in debug mode.

Telnet debug will “break” the rpints functionality, just remember to turn it back off with “d” again.
 
I did test with mosquito but I will admit that mqtt may be the least tested function. It didn’t seem to need much and is sort of outside of the main processing. If it doesn’t show up, you might try either a serial monitor or telnetting in (pretty sure I left that turned on). If you don’t see anything when you telnet in, just a blank screen, type “d” to put it in debug mode.

Telnet debug will “break” the rpints functionality, just remember to turn it back off with “d” again.
So I'm actually a little confused at this point. How are rpints and kegcop supposed to talk to each other? I see in the kegcop configuration that under url, it's pre-configured for rpints.local. But then there's also the Raspberry pints section that looks like it's for Mqtt style configuration. Is there a better method of communicating with Rpints that's not MQTT?

It's been over a year since I last had my arduino based rpints working, so the functionality after that time frame is new to me. Going back to the rpints thread, there's a few mentions of mqtt functionality, but I'm not finding many details of how to best use it.
 
What’s funny is that I forgot my plan. :)

So if you have the serial plugged into your Pi just as you would an Arduino, it will report to RPints. RPints is also supposed to receive MQTT pours but you’ll have to go over to the RPints thread for more info on that.

Using serial will require you keep the debug off - that’s what I was talking about with the “d” command. It should be off by default.

“Someone” can also add telnet capability to the RPints if they feel like it. That’s how @Thorrak ported BrewPi to the esp8266.
 
@LBussy would you mind posting the IO's numbers used for the DS18B20's,first 2 flowmeters and cooling relay and where pullup resistors are needed,or a schematic diagram ?
I have bought some really cheap flowmeters and would like to bodge the wiring to test accuracy (and foaming) before making boards and printing enclosures.
swissflow meters are ridiculously expensive in my country.
cheers
 
Got it from config file.
Will upload a picture of the flowmeter used if tests are successful.
Thanks
 
I might be doing something wrong but when changing the set point temperature under settings > temperature > control and pressing update button,after returning to the home screen it is still showing setpoint at default 1.7 degrees.
Going back to the settings page shows 1.7 again.
I tried firefox,chrome and edge with the same result.
Any idea how to resolve this ?
All other user settings are sticking after changing from default
 
I have just found out about this project and listened to the podcast on HomeBrewing DIY. I have been looking at a solutions to monitor the keg levels in my home bar and was considering the Plaato but since I have six kegs, it gets expensive quickly. This solution looks good.

A couple of questions.
1) It is not clear to me what the circuit board is for. Dont the flow meters just connect to the ESP8266 headers?
2) I have tried Raspberry pints but ended up with TapItGood as a visual tool to tell guests about my beers. Will this work with TapItGood or only Raspberry pints?
3) At the Homebrew/home bar scale, is there a big difference between the high end SwissFlo meters and the much cheaper flow meters out there? The major difference seems to be the connection method.

Thanks
 
I might be doing something wrong but when changing the set point temperature under settings > temperature > control and pressing update button,after returning to the home screen it is still showing setpoint at default 1.7 degrees.
Somehow I missed a few replies here - I apologize!

I'll have a look. I assume this is when using C? If so, and if I have not answered the question yet, try to set the system to F, make your changes, then switch it back to C.

Does anyone have single boards for sale? I don't want to order 3 of each from OSH Park.
I have single-sided copper blanks for etching at home, but am not set up and have never made 2-sided boards at home.
I do, but I have no idea where my stuff is right now. If I can find my box (I need to find some other stuff too) I'll let you know.
 
It is not clear to me what the circuit board is for. Dont the flow meters just connect to the ESP8266 headers?
They do, with resistors as pull-ups. While the RPints setup calls for using internal pull-ups for the flowmeters, I found these are much more reliable with stranger pull-ups. Even more so when using flowmeters with higher resolution.

Aside from that, there's a relay to control your kegerator, and of course temperature sensors from which to control, but you can also monitor different parts of your system. There are also some decoupling capacitors to help reduce the noise on the power/signal circuits. None of this is "necessary." A person could use some soldering, electrical tape, and a project box to keep things tidy and be able to use the flowmeters without the boards.

Have a look at the image here: Project Planning — Keg Cop 1.0.0 documentation

I have tried Raspberry pints but ended up with TapItGood as a visual tool to tell guests about my beers. Will this work with TapItGood or only Raspberry pints?
I have no idea honestly, never used it. This will work with RPints. If TapItGood works with the RPints Arduino, then maybe. That said, KegScreen is intended to be the graphical front end, but @Thorrak is still working on it.

At the Homebrew/home bar scale, is there a big difference between the high end SwissFlo meters and the much cheaper flow meters out there? The major difference seems to be the connection method.
Yes - and I'll tell you why. We geek out at these things working and telling us what's been poured and what's left. The error which accrues with the less precise meters is really most noticeable for us with our setups because we count on "one more glass" and it's disappointing and noticeable when it's off by that much at our scale. If a larger establishment is off by a few pints, who cares?

The connection method is really the same, three wires.
 
I might be doing something wrong but when changing the set point temperature under settings > temperature > control and pressing update button,after returning to the home screen it is still showing setpoint at default 1.7 degrees.
I confirmed this is a bug I fixed in #10. It's in the devel branch right now. It will work if you set it to F, then update your setpoint, then switch back to C. Or, you could use the Alpha code which is on BrewFlasher right now (1.0.1-Alpha.3.) The deep link to it for the web version is here (but you can't use FireFox.) Otherwise you can look in the BrewFlasher app for 1.0.1-Alpha.3.)

This is not supported with OTA upgrade right now, and upgrading will wipe your settings and WiFi config.

I don't have a planned date to release to OTA updates (will likely be 1.1.0 because of a new feature) but I don't think it will be too much longer.
 
Aside from that, there's a relay to control your kegerator,
Lee, Do you find that the standard 10A Arduino-type relays have enough capacity for the Kegerator compressor without failing quickly? In the past I've used 40A SSRs for anything Compressor/Motor or high-wattage (5500 W heating element) because I've been afraid the relays can't take either the start-up current of the compressor/motor or the PWM action needed to keep a heating element controlling to precise temperatures.
 
Lee, Do you find that the standard 10A Arduino-type relays have enough capacity for the Kegerator compressor without failing quickly?
So far, however; there are exceptions to every rule.

I did just code an "invert pin" function that could support an SSR. That's in the devel branch right now.
 
I'm trying to view the Schematic and connections between the main board and others so I can just hand-wire this up since I don't have any PCBs. I'm trying to get these from Github but can't figure out how to download the schematics and view them in Eagle (or any other PCB software).
Is there a trick to downloading the schematics and displaying them in some software?

When I download the Main.sch file, I get this when opening in Eagle (I've also tried opening in some other software with no success):

Loading F:/Downloads/Keg Cop - Main.sch ...

Error:

line 9, column 122: This is not an EAGLE file.
 
Last edited:
Shouldn't be anything tricky. I'm on a new laptop and just opened it in Eagle 9.6.2 Free Edition.

I printed it to a PDF for you, attached.
 

Attachments

  • Keg Cop - Main.pdf
    25.5 KB · Views: 0
Do you think it could be possible to make a single-sided PCB version of your boards? I'm probably not even a novice in Eagle, but it doesn't appear to easily convert a 2-sided PCB to a 1-sided PCB (if even possible at all). Or maybe could start over with the schematic and try to make a 1-sided board with necessary jumper wires.
EDIT - Heck, I just tried the OLD version of ExpressPCB and ExpressSCH and they don't even do single-sided boards. KiCad does a minimum of 2 layers.
I suppose even if I could find some old software that would make a 1-sided board, there wouldn't be the modern ESP32 component available.

Have you had a chance to find any boards Lee? I only have one keg, so only need one of the boards for temp controller, One for Keg flow Meter and One main board.
 
Uh ........................

Maybe? If it was only ever going to support one keg, one temp, and one relay, I could see how that looked.

I went through a few boxes, no joy so far.
 
Do you think it could be possible to make a single-sided PCB version of your boards?
Attached is a single-layer design, using the "KEG" temperature sensor, and the "KEG8" flowmeter. You'd have to set the UI to use KEG as the temp control and disable all but TAP8.

No warranty, YMMV, may cause hair loss, halitosis, and your dog to run away.

1656514110702.png
 

Attachments

  • Keg Cop - Single.zip
    241.9 KB · Views: 0
Preferably using a drill press, but given the hole size and pitch in this case it shouldn't be a challenge to use a handheld drill...

Cheers!
 
Thanks for that single-sided PCB. It'll be perfect for my setup! One flow meter, one tap, one relay for kegerator cooling, one temp sensor for the keg.

I was trying to make my own PCB in Eagle (but much more complicated) and having a hard time. I was trying to use the 4 temp sensors and one flow meter. Routing was challenging. If I want to add an additional temp sensor or two to your board above, I think I should be able to do that pretty easily with hand-wiring. Not sure it'll be necessary, but I do like to have a tower temp also.

I have some very tiny drill bits that I use with a dremel tool (dremel sized shank) to drill the holes in the PCB. It works very well. I've only broken a couple bits after hundreds of holes drilled.

Now to find my PCB blanks, acid, Laser print the PCB, iron it on the copper and start eating the copper away.
A 3-D printer would be way cooler to cut away the copper.
 
Thanks for that single-sided PCB. It'll be perfect for my setup! One flow meter, one tap, one relay for kegerator cooling, one temp sensor for the keg.

I was trying to make my own PCB in Eagle (but much more complicated) and having a hard time. I was trying to use the 4 temp sensors and one flow meter. Routing was challenging. If I want to add an additional temp sensor or two to your board above, I think I should be able to do that pretty easily with hand-wiring. Not sure it'll be necessary, but I do like to have a tower temp also.

I have some very tiny drill bits that I use with a dremel tool (dremel sized shank) to drill the holes in the PCB. It works very well. I've only broken a couple bits after hundreds of holes drilled.

Now to find my PCB blanks, acid, Laser print the PCB, iron it on the copper and start eating the copper away.
A 3-D printer would be way cooler to cut away the copper.
That is dedication, sir!
 
Attached is a single-layer design, using the "KEG" temperature sensor, and the "KEG8" flowmeter. You'd have to set the UI to use KEG as the temp control and disable all but TAP8.

No warranty, YMMV, may cause hair loss, halitosis, and your dog to run away.

View attachment 773411
When this is printed on my laser printer, I think this will put the traces on the top side instead of the bottom. I'd need it Flipped? Mirrored? Flipped AND Mirrored? I'm not sure.

I'm not sure how to print this in the laser printer so that what I see as the traces are on the bottom side of the PCB so I can solder the pins to it. It's like looking through a piece of paper and having the traces I see in your picture on the BOTTOM side of the paper it's printed on. Not sure I'm explaining that correctly.

In the past, the boards I made were designed by other people and ready to do a toner transfer method of PCB creation.

I added a couple more Temp Sensors (but had to use Jumper wires).
 
I think I figured it out. Just click "Flip Board" in Eagle and it appears it will print correctly so the traces are on the bottom.
But that appears to only change it in Eagle.
I guess when printing, I have the option of mirroring the page in the Windows Print option window.
 
Keep in mind that PDF is scaled larger to see it. You'll have to print your own template. I think you're doing that but I want to be sure. :)
 
Okay folks - thanks to some free time and some assistance from @Thorrak I have a Beta release of 1.1.0 available via BrewFlasher:

Updated Keg Cop Beta to 1.1.0-Beta.2.2

This is a breaking change, since I had to resize the partitions. BrewFlasher will not keep settings anyway like an OTA will, so anytime you use BrewFlasher you will wipe out your settings including WiFi - keep that in mind.

I'd love to get a couple brave souls to test this for me. If you are interested in the nitty-gritty, the chances can be seen in PR 39.
 
Keg Cop 1.1.0 has been released!

What's Changed:
  • Add support for TaplistIO
  • Updated documentation
  • Added cool control inverted pin capability
  • Add tap label to allow external synch (KegScreen prep)
  • Telnet removed from release version (security concern)
  • SPIFFS editor removed (broken upstream)
  • New platform libraries - added stability
  • Fix temperature calibration in C
Because of the upstream changes and size differences necessitating a custom partition scheme, the OTA updater will not work with this release. I recommend you update with BrewFlasher. Please note BrewFlasher will erase all settings, including your WiFi setup. If your settings are complex, I recommend you manually record these settings.

Full Changelog: https://github.com/lbussy/keg-cop/compare/1.0.0...1.1.0
 
Lee,
On that single sided board you designed, is there a mistake? It appears the flowmeter data signal also has 3v3 power added in across a 2k2 resistor. Keg Cop tells me it can't see the flowmeter and gives this message: Flow Warning: Unable to retrieve flowmeter data.

What I find on the Internet about the YF-S401 flow meters doesn't mention a resistor and 3v3 power are needed on the data line. It appears they simply connect the yellow data wire to the I/O 13 / Keg pin on the ESP.
 
Last edited:
On that single sided board you made, is there a mistake?
I believe I pointed out that possibility. :)

It appears the flowmeter data signal also has 3v3 power added in across a 2k2 resistor.
The power -> resistor -> data line is called a "pull-up resistor" and is required.

Keg Cop tells me it can't see the flowmeter and gives this message: Flow Warning: Unable to retrieve flowmeter data.
The error is a web page error. You'll need to open your browser console and see if there are errors shown there.

What version do you have running? Look at "About" to see the version number if you are not sure.
 
Please flash the current version (1.1.0) and then check the browser console with it running. We will not know if there's really a wiring issue until the web page is running, or you login to the serial console and watch it there.
 
Before upgrading the firmware, I took out the magnifying glass and found a solder bridge. Fixed that and it's counting pulses now.
I then upgraded the firmware.

About Keg Cop: v1.1.0 [main] (5f787b6)​

Now I need to find 3 temp probes to solder on and make sure they work.
Slow progress.....but progress.

Thanks Lee - you're a saint!

It would be cool if there were some sort of animation in the GUI/homepage when a beer is being served from the keg, once pulses are detected.
 
Last edited:
Back
Top