Keg Cop: Keg Monitoring and Control

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

Help Support Homebrew Talk:

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
Sorry, yeah re-reading I was really a jerk. Not to slam the effort that has been put in, I just wish stuff like this was a little easier to get into. I have a bit of experience with Arduino and Raspberry Pi, I am fully capable of soldering components, etc. and loading code, its just that the whole framework is so esoteric, at least from my perspective. I'm also not a youngster, just wish this stuff was easier to navigate.

Also, not gonna hold my breath for a commercial version, sorry for saying that.
I've got 63 years of experience of being a jerk....occasionally. 😊

Good on ya to own up to it.

It really is a cool looking system from what I've seen so far. I like that it's gonna be a total kegerator control system, not just flow meters. I've not seen Keg Screen yet, but if Keg Cop ties into it as seamlessly as I think it's going to..... 🤯

Cheers

Chris
 

day_trippr

Get the shot ffs! Sheesh!
Joined
May 31, 2011
Messages
37,155
Reaction score
19,928
Location
Stow, MA
@Jayjay1976, techie stuff can seem overwhelmingly complicated to implement, but there are many folks on HBT that have supported all kinds of tech stuff over the years, and if there's anyone that can walk someone through a bring-up it would be @LBussy...

Cheers!
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
I dont want to be dumb but I will, is there like a list of parts somewhere that I can just click on and order them? I can't seem to find that.

Edit: Oh nevermind, I found that under ASSEMBLY rather than under PLANNING.
I've added a BOM to each board on the Assembly page (you may need to hard-refresh your browser to see it.)

I've also added the 16-pin female headers since @Thorrak pointed out I failed to list them.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
Some companies provide PCB manufacturing services. It seems like a PIA to set up (mostly because I've never done it) but if there's interest I'll try to carve out some time to do that.

Let me know if you (anyone) are interested in that.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
632
Reaction score
461
Location
Syracuse
Well, it looks like @LBussy has written another piece of open source code that does (almost) exactly what I was planning to write myself, saving me a ton of work. Thanks!

I've been planning on upgrading my keg temperature and flow monitoring and Keg Cop looks like a very nice solution. The RESTful API will make it super easy to connect Keg Cop to the analog display that I'm building. To get exactly what I need, I'll need to make a few changes. This looks straightforward (yay open source!) but I had a few questions for @LBussy before I fire up KiCAD:
  1. I'm planning on using a Lilygo TTGO ESP32 as the main unit, since I have a few of these lying around from my TiltBridge build. I'm going to create my own custom main board (since I won't use the breakout boards) so the different pinout on the TTGO is no issue. I can't think of any reason why the TTGO wouldn't work, but if you see any issues let me know and I'll order some Lolin boards.
  2. It looks like the flow module boards just connect +5V from Vbus and GND to each flow meter and then route the data line on RJ45 pins 2->4->6 as the boards are chained, but don't do anything else. If that's right, I'll just plug my flowmeters directly into my main board on a screw terminal, as the connection to my kegerator is an 8 core cable that carries +5V, GND, 5 x flow meter pulse lines, and a one-wire data bus for my DS18B20s.
  3. I understand the KISS motivation for one DS18B20 for each one-wire bus, but I have too many probes for that. It looks like the code is just using the standard Dallas temperature probe code, so I think I can modify the code in a way that makes the current functionality default, but allows for more sensors using the config. I can do this as a pull request, if this is a useful feature for others.
Thanks again, this have saved me a ton of coding.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
I'm planning on using a Lilygo TTGO ESP32 as the main unit, since I have a few of these lying around from my TiltBridge build. I'm going to create my own custom main board (since I won't use the breakout boards) so the different pinout on the TTGO is no issue. I can't think of any reason why the TTGO wouldn't work, but if you see any issues let me know and I'll order some Lolin boards.
I don't know of any reason other than assuming the display pins for the Lilygo TTGO may conflict with/limit the pins needed for Keg Cop. Other than that, an ESP32 is an ESP32 (till it ain't.)

It looks like the flow module boards just connect +5V from Vbus and GND to each flow meter and then route the data line on RJ45 pins 2->4->6 as the boards are chained, but don't do anything else. If that's right, I'll just plug my flowmeters directly into my main board on a screw terminal, as the connection to my kegerator is an 8 core cable that carries +5V, GND, 5 x flow meter pulse lines, and a one-wire data bus for my DS18B20s.
Well, yes and no. Logically that's correct but I learned (the hard way) that there's a considerable amount of cross-talk between wires if you do not avail yourself of the twisted pair and grounding one side. You are correct about the number of conductors, but be wary of crosstalk.

I understand the KISS motivation for one DS18B20 for each one-wire bus, but I have too many probes for that. It looks like the code is just using the standard Dallas temperature probe code, so I think I can modify the code in a way that makes the current functionality default, but allows for more sensors using the config. I can do this as a pull request, if this is a useful feature for others.
I've no issue with that. You obviously see why I did it. OneWire was overkill, but thermistors required an amp so this kept the circuitry pretty simple while being deterministic about the placement/addressing. I think when you think through it, you may find that there are a few more lines of code than you think to make that change. I mean, cool if you can do it of course.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
632
Reaction score
461
Location
Syracuse
Great, thank you. I've been running the SF800s through regular 8-core cable into a screw terminal block, then via ribbon cable to an Wyolum Alamode for my old RPints setup (image below). I haven't had any issues with crosstalk causing ghost pours on taps (probably luck because my cable run is < 5 ft), so I'm going carry on pretending that it doesn't exist. Good idea to go twisted pair, though. I'll do that if I start seeing ghost pours.

I think when you think through it, you may find that there are a few more lines of code than you think to make that change.
That's the story of my life, sir... :D


IMG_0860 2.jpeg
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
image below
I think I see your problem. You can use less than eight DS18B20's since they are all sensing the same thing

(yes I know those are mosfets)

I haven't had any issues with crosstalk causing ghost pours on taps (probably luck because my cable run is < 5 ft), so I'm going carry on pretending that it doesn't exist. Good idea to go twisted pair, though. I'll do that if I start seeing ghost pours
It could also be that I was using a twisted pair for two different data lines. I chose Ethernet cables for the obvious ubiquity and approachable nature of the assembly. If I was using parallel, the crosstalk may not have been so bad.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
632
Reaction score
461
Location
Syracuse
I think I see your problem. You can use less than eight DS18B20's since they are all sensing the same thing
:D

(yes I know those are mosfets)
Oh, it's worse. They are 2N2222s that are parasitically feeding off the SF800 data line to make the LEDs flash (really, really, fast) when there is a pour. Basically, after a pour there's a 50/50 chance that the LED on that SF800 will have changed state. I put them in for testing, but my daughter said that they looked pretty...

It could also be that I was using a twisted pair for two different data lines. I chose Ethernet cables for the obvious ubiquity and approachable nature of the assembly. If I was using parallel, the crosstalk may not have been so bad.
That makes sense, two data lines in a twisted pair in a long ethernet cable could cause issues. I'm effectively using a short parallel cable for the data.
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
They are 2N2222s that are parasitically feeding off the SF800 data line to make the LEDs flash (really, really, fast) when there is a pour. Basically, after a pour there's a 50/50 chance that the LED on that SF800 will have changed state. I put them in for testing, but my daughter said that they looked pretty...
That sounds like how drinking games start.
 
Joined
Nov 26, 2016
Messages
3,939
Reaction score
3,706
Location
Chicago
I read the section about flow meters, I would like to start out with basic ones and upgrade down the road to Swissflow units. Understanding that they all work a bit differently, will I have a lot of rework to do when upgrading?
 

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
Hi Lee,

I'm assuming the page where you enable and disable temperature sensors is also for calibration of some sort. Known, accurate value versus displayed from the OneWire sensors, or am I all wet?

Cheers!

Chris
Screenshot_20210809-155004.png
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
I'm assuming the page where you enable and disable temperature sensors is also for calibration of some sort.
You are correct: Sensor Control

FWIW, there is a context-aware help link for nearly all the pages on the menu at the "?" link (which is easier to see on a widescreen device).
 

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
Well, that's interesting - it's "supposed to" default to something more helpful. :) I see the problem though, I've added an issue to track.
Chuckle. Honest, I only ask questions about stuff that's available once a week....well, maybe twice. 🤭

If I knew how to fix that, I would but my coding skills are pretty sad. In another life, I was a FidoNet Sysop so I know all too well what RTFM means.

Cheers!

Chris
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
oooooo... I can remember the flames as if they were yesterday.
Next you'll want to argue OS/2 vs DOS. :popcorn:

I must have been sleeping when that kicked off.
We're talking about the horrible way we were forced to download porn in the early 90's. :ghostly:

Back on topic: Does anyone use MQTT in their homes/breweries? While I do have support for it, I'm always curious how it's used and whether I've set it up optimally.
 

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
Next you'll want to argue OS/2 vs DOS. :popcorn:
I was an OS/2 guy..... sorry.

Back on topic: Does anyone use MQTT in their homes/breweries? While I do have support for it, I'm always curious how it's used and whether I've set it up optimally.
Ok.... back on topic. not about MQTT cause I really don't know what that is. Temperature sensors and flow sensors..... sigh

I've been trying to dial in my temperature sensors via the settings offset page. Entering a value for offset and updating the settings page does not change the displayed value on my system. I am not quite sure where to start in terms of looking for a hardware problem as I feel that's probably where the issue lies.

Flow meters.... I have two taps so have disabled Taps 3-9. Blowing (gently) and in the correct direction causes the tap to almost immediately disappear, rather than decrease in displayed volume as I had expected it to . Going to the Tap configuation page shows that it has changed value from active to inactive. Note that I haven't changed the values in pulses/litre or volume from the values that were there when installing KegCop.

I've changed around Cat5 cables (one of them is brand new). What else should I be looking at?

Cheers!

Chris
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
I've been trying to dial in my temperature sensors via the settings offset page. Entering a value for offset and updating the settings page does not change the displayed value on my system. I am not quite sure where to start in terms of looking for a hardware problem as I feel that's probably where the issue lies.
You seem to be experiencing a bug. The ability to calibrate those probes is often requested but seldom used in practice. So, testing it was cursory and early on in development so I probably broke it somewhere. I've enters an issue to track this.

Flow meters.... I have two taps so have disabled Taps 3-9. Blowing (gently) and in the correct direction causes the tap to almost immediately disappear, rather than decrease in displayed volume as I had expected it to . Going to the Tap configuation page shows that it has changed value from active to inactive. Note that I haven't changed the values in pulses/litre or volume from the values that were there when installing KegCop.
Sounds like it kicked. You would be surprised how fast blowing through the meter (which is specifically discouraged by the manufacturer) will do that compared to liquid flow. If you want to see that happen, set up a target for the reporting, or just watch the serial monitor. You can also use Telnet (which I know you know since you're old! :p) to watch the serial log.
 

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
You seem to be experiencing a bug. The ability to calibrate those probes is often requested but seldom used in practice. So, testing it was cursory and early on in development so I probably broke it somewhere. I've enters an issue to track this.
Yay.... I found a bug. :p

Sounds like it kicked. You would be surprised how fast blowing through the meter (which is specifically discouraged by the manufacturer) will do that compared to liquid flow. If you want to see that happen, set up a target for the reporting, or just watch the serial monitor. You can also use Telnet (which I know you know since you're old! :p) to watch the serial log.
Telnet..... never thought of that. " Well, lookie here at that!" Screenshot 2021-08-10 082348.jpg

More banging away at the hardware appears to be in order. Seems I should do research on MQTT.

Cheers!

Chris
 

Exception13

Well-Known Member
Lifetime Supporter
Joined
Oct 9, 2012
Messages
135
Reaction score
91
Location
Westport, Ontario
G'day. I see by the sample system diagram ...
system1.png
... and from your comments in a private message, that it would be best to use a one-wire DS18B20 for the room temperature rather than an IC version mounted to the board. I'll assume that desoldering the IC I have and connecting a one-wire to the 3 pins marked Room supplied on your PCB is all that takes.

I am a bit confused about the two pins marked Power. On the system diagram, they are shown being connected to the 2-channel relay board, but to the jumper pins. There are also the 4 pins (G Sig1 Sig2 V) which are shown connected to the 4 pins on the SainSmart board. I'm familiar with these from my fermentation keezer controller. I do not have any power going to the jumper pins in that project and the keezer control works just fine. What is that extra power connection for? Assuming it's 5V but.... why to jumper pins? 🤔

*** Edit..... sigh.... never mind. I found it...... *** (mumble, grumble, rtfm....)

Cheers!

Chris
 
Last edited:
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
You said you found your answers, but I don't mind making sure.

it would be best to use a one-wire DS18B20 for the room temperature rather than an IC version mounted to the board.
Yep.

I'll assume that desoldering the IC I have and connecting a one-wire to the 3 pins marked Room supplied on your PCB is all that takes.
That or snip it off. If you leave it there the app will just use whichever one answers first which may of course cause strange results.

I am a bit confused about the two pins marked Power.
As you've likely discovered, the ESP32 runs on 3V3 and while the relay may work okay with that, powering the coils with 5V0 is much more "authoritative" of a snap when it actuates. It's simple and removes one more potential source of issues.
 

duncan.brown

Supporting Member
HBT Supporter
Joined
Apr 8, 2020
Messages
632
Reaction score
461
Location
Syracuse
@LBussy quick question about the flow meter wiring: I see you're running them at 5V, but putting a 2k2 pull-up resistor between the 3v3 line and the signal line. Does the SF800 generated pulses by shorting pulse to ground so you don't get more than 3v3 into the ESP32's GPIO pins?
 
OP
LBussy
Joined
Jan 19, 2013
Messages
3,459
Reaction score
1,405
Location
Kansas City
@LBussy quick question about the flow meter wiring: I see you're running them at 5V, but putting a 2k2 pull-up resistor between the 3v3 line and the signal line. Does the SF800 generated pulses by shorting pulse to ground so you don't get more than 3v3 into the ESP32's GPIO pins?
Yessir. I actually bought myself a scope and was able to see it. The scope was because I was having that crosstalk problem, but I mean it was nice to be able to see the 3V3 pulses.
 
Top