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

    Homebrewing Facebook Group

Keg Cop: Keg Monitoring and Control

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I saw this thread a few weeks ago and I'm currently waiting for my deliveries from china. I'm exited to see the new release. Thanks for your time on this project. Looking forward to putting all this together.

I do have a question.

In the documentation you state:

  • Tap Number Choice: This is the most basic and most important decision. The controller choice for this project allowed up to nine pins for flow meters. The system works by utilizing up to three strings of three flowmeters each. This optimization is a result of choosing easily-sourced Ethernet cables as the connectivity between boards.
and

  • Sensor/Meter Boards - Connectors to the physical aspects of the system:
    • Daisy-Chain Boards: These small boards, one per flowmeter, connect the flowmeter(2) into the system. There is an “In” and an “Out” port, creating a chain of up to six sensors. The first on the chain is always number one, and so on.
    • Sensor Board: This is a breakout board for connecting up to five temperature sensors.
So, to run 8 taps, can I run two chains of four sensors each, or do I need to run three chains with 3-3-2 sensors?
 
For flow meters it's 3 3 2. That's a function of using rj45 connectors.
The temp sensors are ds18b20s and one can hook a lot of those to a single bus as they share wires unlike the flow meters...

Cheers!
 
It's a function of using rj45 connectors...
Ok, yeah, I get it now ...

I just re-read the documentation again.

So, I guess the phrase "creating a chain of up to six sensors" is a throwback to when Lee was trying to use each wire as a data wire, but was getting signal interference.

Thanks
 
I'm getting a couple errors when clicking on the tan "gauge" or "bar" on the main page.
Settings Error: Settings update failed. and Temps Warning: Unable to retrieve temperature data.
Then a spinning circle forever. If I click on the menu to a different web page, I get a 404 error and get stuck on that same 404 error for every menu item except the ? that takes me to the Keg Cop website. If I manually remove the 404 in the URL, the webpages for the ESP32 work again.
It has the same results using Brave browser (a Chrome variant) and Microsoft Edge.

I'm on

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

If I DON'T click on that tan bar (circled in red below), the web pages on the Keg Cop / ESP32 work just fine. It's only after clicking on that bar that the trouble occurs.

1657625135981.png
 
Last edited:
I'm getting a couple errors when clicking on the tan "gauge" or "bar" on the main page.
Settings Error: Settings update failed. and Temps Warning: Unable to retrieve temperature data.
Then a spinning circle forever. If I click on the menu to a different web page, I get a 404 error and get stuck on that same 404 error for every menu item except the ? that takes me to the Keg Cop website. If I manually remove the 404 in the URL, the webpages for the ESP32 work again.
It has the same results using Brave browser (a Chrome variant) and Microsoft Edge.

I'm on

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

If I DON'T click on that tan bar (circled in red below), the web pages on the Keg Cop / ESP32 work just fine. It's only after clicking on that bar that the trouble occurs.

View attachment 774661
I get the same results when I click on the Control point: Keg Sensor link in the web gui:
1657628990668.png
 
So, to run 8 taps, can I run two chains of four sensors each, or do I need to run three chains with 3-3-2 sensors?
3, 3, 2. The other is a documentation miss as I actually tried to do the documentation while I built. :) I've entered issue #52 for me to fix this.

The temp sensors are ds18b20s and one can hook a lot of those to a single bus as they share wires unlike the flow meters...
The sensors are capable of that, however to be determinstic I have one per wire. That way the person knows that the sensor connected to "Tower" is actually the Tower sensor and they do not have to heat/cool a sensor, watch for which sensor changes, and then assign it to a logical location. Other sensors would have been a better choice, but the DS18B20's are ubiquitous for Homebrew DIY projects.
 
Almost done building my Keg Cop controller. Getting some more temp probes delivered today.

I should have checked this before I started, but there isn't any additional relay control for a fan for cooling the tower is there? I'm currently using CraftbeerPi3 and have an actor set up to turn on the fan blowing air up into the tower based on the tower temp probe. It doesn't appear that Keg Cop can do this, right? My only option would be to have the fan on all the time or set up an additional Keg Cop controller to just run that tower cooling fan?
 
there isn't any additional relay control for a fan for cooling the tower is there? I'm currently using CraftbeerPi3 and have an actor set up to turn on the fan blowing air up into the tower based on the tower temp probe.
There is a "Solenoid Relay" available to you. Check the API page. You should be able to control that externally if you have an automation base. If you don't have HAST or something similar you could run a pretty small Python script to get the temp probes and cycle the fan.

I do want to add IFTTT support, but it's not reached the top of the list yet.

ETA: I did not pull that trace out on your board design, that would have to be modified.
 
While waiting for a fix in the firmware, is it possible to revert back to 1.0.0? Looking in Brewflasher app, I only 1.1.0 listed as an option for KegCop.
Looking in Github, I don't see where to find the 1.0.0 version - but I definitely am not sure how to use GitHub.
 
I saw you mentioned a 6-way breakout board for flow meters as a TODO, so I spend a bit of time in KiCad this morning and drew one up--it's submitted as a PR to your GitHub repo. Waiting on some PCBs (oh, and to build the actual keezer itself) to get this running, but the 1.1.0 firmware flashed just fine onto a D32 this afternoon, and at least the web UI part of it is working fine.
 
I spend a bit of time in KiCad this morning and drew one up
I saw that! I’ll get it pulled in here shortly. I got some work done on the firmware this morning that fixes absolutely nothing but should make it easier for me to fix it tomorrow.
 
I'm having trouble with one Temp Sensor - the Keg sensor. It's always reading -196.6F. It appears this false number is built-into the firmware to let you know there's trouble reading the value. I've tried a different DS18B20 and get the same results.
Checking Voltage with a meter, I get +5v between GND and Red at the temp sensor. I get +3.3v between GND and the Yellow.
Checking continuity with a meter, I get 0 ohms between the yellow temp sensor wire and the KDAT pin on the ESP32.
The readings above that I get are the same as the two working temp sensors. Not finding an issue in the PCB or traces/jumpers.

Is there anything else I can or need to check? Keep in mind, this is my home-made PCB. Yes, I know it's ugly.

IMG_20220726_081952.jpg






IMG_20220726_082003.jpg


1658846125368.png
 
Last edited:
I'm having trouble with one Temp Sensor - the Keg sensor.
Have you tried swapping a known good sensors to keg and keg to a known good slot?

It looks like there are some cold solder joints on the resistors and capacitors. Can't really tell.
 
Have you tried swapping a known good sensors to keg and keg to a known good slot?

It looks like there are some cold solder joints on the resistors and capacitors. Can't really tell.
Bad temp sensors. I bought a 5-pack on Amazon and 4 of them don't work.
Thanks for the idea of swapping to a known working location - wouldn't have found it otherwise since I was just replacing bad sensor with another bad sensor.
 
Is anyone else who's updated to the latest Beta release having trouble with sensing pulses from the flow meter? When I go to calibrate on 1.1.1-Beta.1, it's not reading pulses. In the other versions, a 0 shows up in the pulses box and counts when you get some flow going. In the 1.1.1-Beta.1, not even the 0 shows up in the box.

1658872718142.png
 

Attachments

  • 1658872661214.png
    1658872661214.png
    43.9 KB
I got some new temp sensors and went through all 10 of them. Had 2 known working sensors connected to the ESP and then rotated 10 of my new sensors (with at least 4 known bad sensors) and discovered something really odd, to me at least.

Rotating the new sensors in just the lower chamber connection I found that all my new sensors measured temperature. Good.
But when I went through those 10, the other readings changed (mostly on the Keg temp connection). With different sensors on the Lower Chamber, the Keg would have different temp readings - like 5F higher when different sensors were connected to the Lower or Tower temp connections. Is there some electrical thing going on that would give that result? I wouldn't think so since I'm pretty sure it's a digital reading from the sensor to the ESP. Odd.

At least I have all 3 temp probes working now.
 
Last edited:
With different sensors on the Lower Chamber, the Keg would have different temp readings - like 5F higher when different sensors were connected to the Lower or Tower temp connections. Is there some electrical thing going on that would give that result? I wouldn't think so since I'm pretty sure it's a digital reading from the sensor to the ESP. Odd.
It is digital - aside from "China" I have no ideas. That's why I allowed calibration. :)
 
Updated Keg Cop Beta to 1.1.1-Beta.2

This addresses all known issues except for the flowmeter calibration. If I could get some eyes testing this it would be great.

Also, I've changed the firmware update URL so that version 1.0.0 people cannot select a newer version - this is intentional because the partition scheme had to change (ran out of room.) Technically I guess that would be a 2.0 but since BrewFlasher is so easy, it's just connecting a USB cable.

Any updates from 1.1.0 to newer should work fine online.
 
I have 3 temp sensors. One shows 80.6F, another 77.9F and the third at 70.7F and they're all in the same room within inches of each other. I'm trying to adjust them so they all read the same.

How does the temp sensor calibration work? I don't think it's like I expect since I still don't see it doing anything.
I'm trying to adjust any of them on the Temperature Sensors calibration web page, but it always shows the same temperature on the Temperature Page no matter where I set the calibration adjustment.

Here's a video of my attempt.
 
@rkhanso Have you tried dropping them all into a cup of ice water to see which one actually reads 32ºF (0ºC)?

Edit to add: Or of course you could use the boiling water method, but that varies with elevation. I personally prefer the crushed ice water bath method.
 
Last edited:
I have roughly three dozen ds18b20 sensors in service in various tasks, and as I accumulated said collection - aside from a few that were clearly AFU from the jump (and in one case a clear case of murder, to which I confess) - all of them will read within the minimum differential of each other if they're all strapped together in a bunch. I can't imagine "inches apart" having such disparate readings. There's a protocol (get temp, read temp) that should prevent BS values...

Cheers!
 
I'm using the newest Beta - 2 version of the KegCop firmware. I've tried with the temp set to both F and C with no difference.

I put the 3 sensors in a glass of ice water. All together in the center of the glass.
42.8F, 38.3F and 29.3F.

Am I expecting the KegCop calibration to be able to compensate for this when it won't? I tried adjusting the compensation for each and it doesn't make any difference in the output readings.

I use the same sensors (bought at different times over the years, from different sources) in my brew kettle, fermentation and current Kegerator running CraftbeerPi3 and haven't seen this much of a difference. Usually it's only about 1F difference in readings (but using CraftbeerPi3 for in all the other situations). The main differences are those are all using either ESP8266 or Raspberry PIs, not my own Home-made PCB, an ESP32 and the software. I guess I could put some of these latest batches of DS18B20 sensors in my other devices and see if there's the same temperature variations.
My homemade PCB wouldn't cause this, would it?

One last thing I tried is moving the sensors around on the homemade KegCop PCB. The temps didn't follow the 1-wire sensor moves. This seems to me to be built-in to the KegCop software. Maybe due to the fact that I can't get any changes done with the calibration? Like the calibration offsets are built-in and not changeable?

1659156106823.png



1659156133585.png
 
Last edited:
I thought about this when I should have been sleeping. The “demo data” in the system is likely the reason for the differences. The calibration page doesn’t start with zeroes like it should.

Sometimes I’m really good at creating issues. :)

The fact that your calibration values are not applying is also a bug. I’ll stomp that when I get the flow meter cal buttoned up.
 
I can make this suggestion as an issue on GitHub if you prefer, but I think it'd be nice if Keg Cop could calculate liquid volume by weight. Here's how I'd see this working:
  • Enter empty weight of the keg
  • Enter filled weight
    • Alternatively, make the user do the math on his own and enter just the weight of the liquid
    • For both of these, allowing mixed units would be a plus--I'd be using US gallons overall, but the math works easier, and it's easier to parse, if the mass/weight entries are metric
  • Enter specific gravity (which we routinely test at the end of fermentation anyway)
  • From these inputs, it's trivial to calculate the volume of liquid
A further refinement--and perhaps more involved than you'd want to get with this software--would be to behave as Raspberry Pints seems to and have an inventory of kegs, storing whatever characteristics would be relevant (but, for purposes of this suggestion, empty weight and capacity should be on the list). Then I can say I've filled Keg 7 to 24.6 kg of beer with a gravity of 1.010, and Keg Cop will know that Keg 7 weighs 4.76 kg, so that's 19.84 kg of beer, or 19.64L, or 5.19 gal. Put that on Tap 3, and Bob's your proverbial uncle.

Maybe I'm the only one who has a shipping scale in my brewery, but this seems like it would give a much more accurate volume than, well, any realistic way of measuring the volume in the keg directly.
 
I think it'd be nice if Keg Cop could calculate liquid volume by weight.
It can now (the "calibrate flowmeter by weight" function,) so the code is there. I would just have to add another UI to allow that. If you would not mind, add that as a suggestion on GitHub or else I will lose track of it.

A further refinement [...] would be to behave as Raspberry Pints seems to and have an inventory of kegs
This is not going to happen in the current code base. The intent is and always was for @Thorrak to get off his a .. for Thorrak to compliment the system of systems with KegScreen and perform those functions. Real Soon Now™.

Load sensor drift would be why I wouldn't go that route.
Dave I've been experimenting with that some for another hobby (beekeeping) and there is some work that can make that a non-issue, at least close enough for our needs. The problem is the strain gauges which can be counted on enough to provide reproducible accuracy are a little more expensive than most folks will buy. Certainly when I figure it out enough for my hives, I can adapt it trivially for beer.
 
AFAIK, it hasn't. My suggestion (assuming that's what you're responding to) involves manually weighing the keg and entering its weight in the Keg Cop web UI.

How do you debit a pour? What is the measurement device? If it's a flowmeter I have no idea what the point of converting volume to mass (with bonus error factors) might be.

Dave I've been experimenting with that some for another hobby (beekeeping) and there is some work that can make that a non-issue, at least close enough for our needs.

The most successful technique for minimizing load cell drift (reference cell) is fairly well understood, and I reckon higher quality sensors helps. The differentiating issue between using a high quality flow meter (sf800) vs load sensors may be environmental resilience: there's pretty much nothing that's going to affect a flow meter while load sensor arrays typically reside where moisture is endemic - fridge and keezer floors...

Cheers!
 
How do you debit a pour? What is the measurement device? If it's a flowmeter I have no idea what the point of converting volume to mass (with bonus error factors) might be.
It's not converting volume to mass, it's the other way around, and the point is to get an accurate measurement of how much beer is in that keg when I first put that keg on tap. Once it's there, the flowmeters do their job, but they can't tell what the starting point is. And my point is, at least in this application, that it's quite a bit easier to accurately measure mass than volume.

Think about the work flow. I've just finished a batch of beer, put it into a keg, and am about to put that keg into my kegerator. I browse to Keg Cop and edit the tap in question, give it a name, and it asks how much beer is there (to four decimals' precision). What do I tell it? A Corny keg has no volume markings. Even if my fermenter had volume markings, they'd only be in gallons--maybe I could interpolate to quarts, but I'd be missing any transfer losses. I guess I could use a calibrated dip stick, but everything you put in there is a risk of contamination. So all I can really do is guess--"that looks like it's about full, so 5 gallons it is."

Or I can weigh the keg. Accurate (enough) digital scales are cheap; the one I'm using has a capacity of 110 lb (50 kg) and a resolution of 0.1 oz (about 3 g), and cost under $25. Sure, it isn't a lab-grade analytical balance, but it's accurate enough for these purposes--even an error of a few ounces would be much less than guessing the volume. Weigh the empty keg (and save yourself a step in the future by marking its empty weight on it), weigh the full keg, and you know the mass of beer to at least three significant digits. And even if you ignore the gravity, you're going to be off by less than 2%--very few beers have a FG greater than 1.020. But of course you don't have to ignore the gravity; you measure that as part of the brewing/fermentation process, so that's another input. Computing volume from these inputs is child's play.

The reason I'm suggesting allowing mixing the units is for ease of parsing the inputs--it's much easier to parse "3.452 kg" in software than it is "7 lb 9.8 oz". As it happens, my scale will also show that value as "121.8 oz", which would also be simple enough to parse, but people don't use units like that very much, just as they don't use decimal pounds ("7.61 lb") much. Whichever units are used, the software can easily convert them to other units if it can accurately understand the value entered.
 
I am NOT bashing on KegCop because I really do like it and plan on switching to it once a couple more bugs are exterminated. Nor poo-poo'ing anyone's desire for more accurate measurements. I appreciate the time and effort all these smart people like Lee put into projects like this because I have no ability to make something even 1/100 as capable. I also like accurate data in many situations related to brewing. Heck, I even made my own 1-sided PCB to use with KegCop and above in this post, I was trying to figure out why 3 temperature sensors were reading very different temperatures.

A number of brews ago, I switched from CraftbeerPi3 to Fermentrack controlling a fermenting chill/heat controller in a 15 gal conical. I was glad I did, as Fermentrack seemed to do a better job. But then I switched to ferment in Corny kegs and no longer need temp control or Fermentrack.

I also serve from the same keg I ferment in, so I'm not sure I need to be concerned to any decimal places or ounces how much beer is left in the keg near the end. One reason, is I'm not sure how much of the beer is actually undrinkable trub left in the bottom of the keg from fermenting in it. Close enough to let me know if I'll need to swap kegs this week or not is close enough. Heck, I used to wait until the tap was spitting more foam than beer, which alerted me to the need to switch kegs. Do I really even need to know if the keg will be empty this week or next? Probably not.

What initially drew me to KegCop was the flowmeter measuring the pours (shiny new object), which is definitely more accurate than clicking a button to deduct ounces in software on TapList, which I used to use. The flow meter is a cool-factor feature that I'll certainly show off to my friends. But is it really needed to know when a keg is empty? It will be nice to have a ballpark figure to know if I have enough beer for an upcoming party or event, which the flow-meter and KegCop will easily be able to do.

I really need to stop switching to the newest software and hardware, and stick with what I have, know and what works - unless there are new features I can't live without. Money wasted. Now, don't judge me. Because I know most of you have done the same types of things when it comes to brewing.
 
Last edited:
I also serve from the same keg I ferment in, so I'm not sure I need to be concerned to any decimal places or ounces how much beer is left in the keg near the end.
Somehow for years we got by with just shaking/tipping the keg once in a while. It's a fun to have thing and certainly not necessary. :)

For your uses, you can always just figure you get 4.5 gallons (or whatever) from a keg and then it will give you a decent approximation what's left to dispense above the trub.

I think you may have edited out your comment about the tower fan. Do put a suggestion up on GitHub and if I have time and/or there's enough interest I'd be happy to implement it. It's not a lot of code. I'd just never considered that functionality. I could repurpose the solenoid pin.

My goal is to get that ONE last bug squashed today, Here's hoping. ;)
 
Last edited:
Do put a suggestion up on GitHub and if I have time and/or there's enough interest I'd be happy to implement it. It's not a lot of code. I'd just never considered that functinality. I could repurpose the solenoid pin.
Done. Put in the "issues" section. I didn't see a section for feature requests.
 
fwiw, there is a spreadsheet created by an HBT member that accurately calculates volume given empty keg weight, current keg weight, keg temperature, beer carbonation level, beer gravity and current altitude. I've been using it for years and given the SF800s I can reliably predict a keg kick within one glass either way. Look for Keg Volume Kalculator.

And, btw if you don't include the carbonation there's a significant error in the mass to volume calculation...

Cheers!
 
Back
Top