Help Support Aussie Homebrewer by donating using the link above.

Keg Scale and Digital Tap List project

Discussion in 'Electronics, Hardware & Software' started by megabyte, 23/6/16.

 

  1. megabyte

    Well-Known Member

    Joined:
    18/4/10
    Messages:
    376
    Likes Received:
    237
    Gender:
    Male
    Home Page:
    Posted 23/6/16
    A few months ago I had 2 great brews on tap. Naturally, one of them blew dry while I was entertaining guests - “Sorry guys, it’s just the porter now”. Straight afterwards what do you know? The porter blew dry as well. This happens to me a lot and it seems like kegs always abide by Murphy's law. Generally I have a ballpark idea about how much is remaining in my kegs, but I hate lifting or shifting them when they get low because it rouses the slurry and my next few beers pour cloudy. Surely there’s a solution for this problem right?

    I scoured the internet, credit card in hand and it turns out... there are several options:
    -If the weather’s right you can warm your kegs and watch where the condensation forms, but this is difficult if you can’t reach some of your kegs (think the third keg at the back of a kegerator, or vertical kegs stacked like sardines in a keezer setup). In my experience the condensation takes a long time to form and I find it tedious.
    -There’s a cool product called Ball and Keg that uses floating magnets to give an indication, but it’s equally restrained if you don’t have easy visual access to your kegs.
    -Then there are these awesome DIY open source projects like KegBerry and Raspberry Pints, but I find them to be overcomplicated with loads of wiring and after you cobble together all the parts, you’re looking at a serious investment in time and money.
    (There are many more options out there with similar drawbacks that I’ll omit for brevity)

    I totally would have bought into one of the existing solutions but none of them really spoke to me, so for the past few months I’ve been working on yet another keg monitoring system. The idea is that if you take a digital bathroom scale then add bluetooth, you now have the basis for a no-wires keg monitoring system that can talk to almost any modern mobile device.
    overview - 1.jpg

    Some of the open source guys have tried using scales in the past but couldn’t get it to work, hence splicing flow sensors into their beer lines instead. I gave it a go anyway, logged measurements for days and found the results to be very linear in proportion to temperature so it’s actually quite easy to get an accurate measurement.

    Here's a pic of how the weight reading varied along with changes in temperature. This was just weighing a keg full of water for a few days.
    weight with temp.jpg
    Using that correlation we can compensate for the temperature to get a much more stable measurement of the keg's weight, however, it may not even be necessary. Here's that same data when you chart it with the zero point included in the plot.
    weight absolute.jpg
    As you can see it's pretty darn flat and that's with temperature variances of about 6 degrees C. If your fridge has temperature swings of 6C it's probably on the frink :)

    Here's are some pics of one of my first test setup. I used a cheapo bathroom scale and hooked it up to a Spark Core to upload measurements to an online database.
    early test setup - 1.jpg early test setup - 1 (1).jpg

    And here’s the super ugly prototype I’ve been working with most recently. I got the glass cut at a local glass shop, but it's pretty dodgy and not very round.
    prototype - 1.jpg

    Meanwhile I've been buying and tearing apart all manner of bathroom scales to see how they're built and learn from their designs.
    kitchen scale - 1.jpg plastic scale - 1.jpg

    The awesome thing about the bluetooth scale approach is that you don’t have any wires and you don’t have to splice anything into your beer lines. Bluetooth 4.0 (or BLE) uses very little power and it looks like we’ll be able to get a couple of years of operation from a pair of AAA batteries.

    I taught myself iOS (swift) and began writing a demo app to interface with my bluetooth sensor and it quickly became evident that adding a fully featured tap list would make a lot of sense. That way you can leave your tablet with your kegerator when you have guests over and it behaves like the chalk board at a tap house - a digital tap list showing what’s on each tap, vital stats and telling a story about each beer, and of course showing how much is remaining. Following are some screenshots of the app as it's was being being developed.
    At the moment there are no scales in range so the fill levels aren't being displayed, but you get the gist...
    app screenshot - 1.jpg
    And here's an early version running on my iPhone.
    early mobile app - 1.jpg

    I gave the app a trial run a few weeks ago at my son’s first birthday party and it was surprisingly popular with our family and friends! I got loads of questions about my beers and I noticed a lot of guests were treating it like a wine tasting event since they had the app telling them what’s on each tap and describing the styles and flavours of each of the beers.
    on fridge - 1.jpg

    Anyhow, we haven’t settled on a name yet, but one of my favourites is Barmaiden - as a nod to the way it keeps inventory of your kegs and also tells your guests about your beers to help them choose between them. Now it’s full steam ahead with the software and I'm also working on the 3D models for the scale part, but I really wanted to post this here on AHB sooner rather than later because I know you guys are going to have loads of awesome advice in these early stages of the design!

    Ideas? Suggestions?
     
    23 people like this.
  2. n87

    Same as it ever was

    Joined:
    30/4/14
    Messages:
    1,657
    Likes Received:
    399
    Gender:
    Male
    Location:
    NSW
    Posted 23/6/16
    one question....
    Do you have calculations of weight based on FG and ABV? as these will change the weight.


    One suggestion.
    Have the ability for 'guests' to download the app, login to your account (as a guest) so they can read up on what they are drinking, and leave comments, ratings etc without blocking everyone elses access to the beer.
     
    4 people like this.
  3. Grott

    Beer Embalmer

    Joined:
    25/3/11
    Messages:
    2,337
    Likes Received:
    1,249
    Gender:
    Male
    Occupation:
    Drinker of fine ales
    Location:
    South of Adelaide
    Posted 23/6/16
    I love this type of thought, experimentation. Keep it up, keep us informed. I know AJS2154 will love you endeavour.
    Cheers
     
  4. wynnum1

    Well-Known Member

    Joined:
    27/9/09
    Messages:
    1,382
    Likes Received:
    179
    Posted 23/6/16
    Can you put a meter on the taps in bars they have automation to stop free or over size drinks.
     
  5. paulyman

    Well-Known Member

    Joined:
    11/7/14
    Messages:
    873
    Likes Received:
    342
    Gender:
    Male
    Posted 23/6/16
    SG compares the density of a substance to the density of water, which is close enough to 1000kg/m^3, (1000 at 4C and 998.2 at 20C),so the density of our beer at FG is close enough to 1000FG kg/m^3.

    The density is the mass per unit volume of a substance, so the mass of 1 cubic metre of our beer is close to 1000FG kg.

    The actual volume of our beer then is its actual mass (remember to subtract off the mass of the empty keg) divided by 1000FG.

    It is now easy to continue this process to find the percentage volume left at any given time.

    It's not perfect, but it would be good enough and far better than just "lifting the keg".
     
  6. MastersBrewery

    Journeyman, the learning never stops

    Joined:
    7/6/11
    Messages:
    2,319
    Likes Received:
    681
    Gender:
    Male
    Posted 23/6/16
    Very cool! Will you be releasing for Android later down the track?

    Hell Gimme Gimme Gimme!!

    Shut up and take my money already!
     
    1 person likes this.
  7. paulyman

    Well-Known Member

    Joined:
    11/7/14
    Messages:
    873
    Likes Received:
    342
    Gender:
    Male
    Posted 23/6/16
    To be honest though, I think caring about the effects of SG etc is overkill. Given the keg is roughly a cylinder, it is emptying close enough to linearly. So the percentage of the current mass to initial mass should correlate really well with the percentage of beer left.

    Be easy enough to fit a linear model to the data you collect if wrong about the above.
     
  8. MHB

    Well-Known Member

    Joined:
    30/9/05
    Messages:
    5,054
    Likes Received:
    2,396
    Gender:
    Male
    Location:
    Newcastle
    Posted 23/6/16
    Interesting idea. just a couple of points that might help
    I think you only need to worry about mass.
    If all your kegs were the same weight you could build in an automatic offset that takes the mass of the keg away from whatever you load onto the scale then just express fill as a % of original load. or as Kg's effectively L+/- not much
    If all your kegs were Corneys it wouldn't be hard to weigh them and then add a bit of weight to bring the lightest up to the weight of the heaviest (stainless screws in the rubber foot comes to mind)
    If you could enter data, you could wright the keg mass on each keg - then enterer the mass (or a keg# that the system knows the mass of) when you put the keg on the scales - so it deducts the keg mass from the total... hell you could chip the kegs like you do the cat too many options!

    Good luck sounds like a fun project
    mark

    Oh just a thought, the mass of CO2 you add when force carbing, you will need to be aware of it, say you add 5g/L to 19L = 95g. Is the scale was accurate enough you might be able to build in a conditioning feature (if you work in Volumes 1g/L = 0.506 Volumes) - that feature actually appeals to me more than how full the kegs is, over the years I have trained my right index finger to be a pretty spot on keg scale - just a gentle vertical lift.
    M
     
    2 people like this.
  9. ChefKing

    Well-Known Member

    Joined:
    25/7/13
    Messages:
    92
    Likes Received:
    11
    Gender:
    Male
    Location:
    Port Douglas
    Posted 23/6/16
    Great idea... I love the thought of tech and beer going hand in hand via bluetooth/smartphone tech.

    A good idea for me would be a "safe keg" feature...

    For example:

    I am away from home for the weekend...

    I have 3 kegs full in my kegerator that have been carbing and settling for a week and ready for a session when i get back.

    My sneaky flatmate/kids/family/neighbours etc; think it would be cool to get stuck in to my brews in my absence!

    Thus setting off a real time alarm to my phone noting exactly which keg is being consumed and how much each time is being drawn from it...

    prolly would need a whole lotta more tech in it than ur current unit to enable sms msg/email etx...but damn it would have been useful for me a cpl of nights ago on my return to home noticed each and every keg had a 3rd or more drunk out of it...... I was livid to say the least!
     
    1 person likes this.
  10. megabyte

    Well-Known Member

    Joined:
    18/4/10
    Messages:
    376
    Likes Received:
    237
    Gender:
    Male
    Home Page:
    Posted 23/6/16
    Wow so many great ideas. I'll try to address some of them.

    Regarding the differences in final gravity mentioned by paylyman, MHB and n87, by my calculation the difference between a 1.006 and a 1.020 f.g beer is about 1.5% by mass. My thoughts were that when you get down to your last pint there's only going to be about 10 grams of error in a worst case scenario which probably wouldn't bother me enough that I would want to enter the f.g. for each beer I keg. Please share your thoughts on this.

    I love it! The app will definitely be free and I've been brainstorming an elegant way to make sure your guests can't just log in and change your keg weight, or rename your beers. I think it's nice if your guests can interact using their phones too.

    Will we do android? Yes definitely. Android represents about half the mobile market these days so I see it as being essential for this project (no current plans for windows phone though). Most of our costs are going to be for the injection moulding (about $8-16k) and certifications (about another $10k) so writing a second app to reach twice as many brewers will help amortise those costs. As for your closing statement - music to my ears! (I'm a massive Futurama fan)

    Exactly. I've implemented a zero function (to allow the scale to know what zero is without a keg) and a tare function (to weigh the empty keg and subtract it from all beer calculations) into the iOS app and it stores these against your keg (which you must name or number individually). That way no matter what style your keg is, you should be able to weigh it perfectly using the bluetooth scale. I'd love to simplify it even further and allow you to use a drop-down list to choose your keg (e.g. 19L corny or 9L corny) and it would use a default weight but I think the first method is going to yield better results when you consider that your individual beer and gas lines will add some weight that should be accounted for.

    By knowing the weight of the keg, we know exactly how much beer is left, and if we enter the volume of the keg we can also display that as a percentage which may be nice.

    I hadn't considered CO2 weight, great point! Now that you mention it I think that will be fine too. With about 100 grams of CO2 per batch, that only represents about 0.5% in error, so it may be off by a fraction of a pint for a full keg, but by the time you're down to your last pint the error is only about 3 grams.

    Note: In my above points about F.G and CO2 weight, I'm making the assumption that you care more about the accuracy of your measurements as you're drawing towards the end of the keg and it's ok if it's out by a few hundred ml with a full keg. This is one of the benefits of weighing the keg over using flow sensors. Weighing results in proportional errors and it will become more accurate towards the end of the keg, whereas using flow sensors the errors accumulate over the course of emptying the keg so your final readings are the most prone to error.

    Yeah I love the idea of being "connected" with your beer and brewing no matter where you are. My first prototype and sketch involved WiFi and sending notifications to your phone, but when I did the math it turns out it would be a lot more expensive and getting power to it would add cords or big batteries.
    Here was one of my earliest sketches, but it no longer applies:
    early sketch - 1.jpg

    I have planned an alternative which is to log the beer levels into the memory inside the bluetooth scale at regular intervals, so when you do open the app later and connect, it can download a chart of the usage over time and you can tell at exactly what times the beer was consumed. It's not as good as your suggestion because it's not immediate, but the hardware I'm using can easily handle this, it's just a few weeks more coding on my part.

    Thanks for all of the great suggestions so far! There is such a wealth of knowledge here! Also I think Yob mentioned in another thread how dry hopping could be an issue too. I still haven't solved this one yet :)
     
    1 person likes this.
  11. megabyte

    Well-Known Member

    Joined:
    18/4/10
    Messages:
    376
    Likes Received:
    237
    Gender:
    Male
    Home Page:
    Posted 23/6/16
    I almost missed this part. This suggestion is totally next level and I love it because I'd use it for force carbing too. Just turn up the gas and leave it until you've gained X grams of CO2.

    In my tests without temperature compensation (images documented in my first post), the error for a full 19L keg of water was around 100 grams which won't be good enough. By adding temperature compensation I know I can make it a lot more accurate, I just don't know *how much* more accurate yet so no promises. I'll definitely keep this concept in mind.
     
  12. MHB

    Well-Known Member

    Joined:
    30/9/05
    Messages:
    5,054
    Likes Received:
    2,396
    Gender:
    Male
    Location:
    Newcastle
    Posted 23/6/16
    The weight of a liquid in a closed container doesn't change with temperature! it's density does, if you want the equation - let me know
    I strongly suspect that the variance is more to do with the electronics and how they respond to cooling. The other possibility that occurred to me was that it might be from gas and beer lines contracting as they cooled/heated, some plastics have fairly impressive response to temperature. Which leads to thinking about how your lines are laid out and effect on apparent mass, and when and how you adjust for the mass of the connections.
    To me it would appear that you need to be able to put in a full keg (the mass of which you know) record the mass of the beer, make all your connections, then have the system "forget" the extra mass, something similar for taken up CO2, except that needs adding to the mass of beer

    The other thought I had was if you don't want to compensate for variable SG's you would be better defaulting to a density of 1.010 or so rather than 1.000
    I think its fair to say that a very large proportion of beer has an FG between 1.008-1.012, very few less than 1.000.
    Re % error as discussed above, I suspect that there is something a little misleading with the relative error, SG might be the wrong scale, try doing the numbers in oP gets rid of that pesky nonunitary 1.000 part (SG =(4*oP)/1000+1) close enough unless you want the ridiculously precise quadratic form of the conversion.

    Still think it would be easier to just express it as a % of full weight. Or % full weight + CO2
    I do like the idea that as the keg empties error goes down - that's smart!
    Mark
     
    1 person likes this.
  13. MastersBrewery

    Journeyman, the learning never stops

    Joined:
    7/6/11
    Messages:
    2,319
    Likes Received:
    681
    Gender:
    Male
    Posted 23/6/16
    New rule: no reading Marks posts before 6am.

    Mark maybe you should colate all your posts and publish a book. I wouldn't be the first on the list to buy one, but that'd be down to my slow reflexes and net speed.
     
    1 person likes this.
  14. GibboQLD

    Well-Known Member

    Joined:
    6/10/14
    Messages:
    195
    Likes Received:
    67
    Gender:
    Male
    Posted 23/6/16
    I wondered if a QR code on your regular kegs would be a good way to speed up the setup process as kegs are changed out -- scan the code, pick from your saved list of brews (or enter a new one) and away you go, but then if you were in the habit of hosting "guest kegs", you'd need to zero/tare them anyway.

    You could always add an optional "watchdog" mode that only enables wifi/sends a text when it needs to. As a DIY project it's easy to set up something like Grovestreams or Twitter/IFTTT to send messages/notifications, but that becomes a little harder if you plan on either releasing an open source project to the wild or commercialising it.
     
    1 person likes this.
  15. mstrelan

    Well-Known Member

    Joined:
    9/8/15
    Messages:
    424
    Likes Received:
    227
    Gender:
    Male
    Posted 23/6/16
    If your guests have to download an app you should put a NFC tag on your kegerator to redirect them to the app store.
     
  16. n87

    Same as it ever was

    Joined:
    30/4/14
    Messages:
    1,657
    Likes Received:
    399
    Gender:
    Male
    Location:
    NSW
    Posted 23/6/16
    One idea on this, is to have an optional BT>WiFi doohiky that can sit outside the fridge connected directly to the power
    Pair your doohiky to your scale(s) and it can send updates to wherever.
    Modular, no need to modify your current design, no need to run wires, out of the way.

    Regarding the app at parties, you would want a 'party mode' on the main device, that when selected, puts all the information in a more 'viewer friendly' format (verses beer nerd format) but also locks the device down so noone can move away from that screen or change anything.


    Have a print out with a QR code (much cheaper and easier than configuring an NFC tag).
    once they download the app, they can scan the second QR code that will log them into that 'event'
     
    1 person likes this.
  17. klangers

    Well-Known Member

    Joined:
    10/9/14
    Messages:
    739
    Likes Received:
    301
    Gender:
    Male
    Posted 24/6/16
    Does no one else just tap their kegs and listen to the pitch?

    It varies with pressure, and the height of the liquid. So since we all have different serving pressures it's not as nice as a loadcell, but after a bit of experience it works well to someone with a musical ear.

    This method was used in old filling height measurements in industrial bottling lines - and the brand is still around - "Taptone". They don't use this method anymore though as machine vision blows it out of the water.
     
  18. n87

    Same as it ever was

    Joined:
    30/4/14
    Messages:
    1,657
    Likes Received:
    399
    Gender:
    Male
    Location:
    NSW
    Posted 24/6/16
    One question just occurred to me, have you tested how well BT is transmitted in fridge<>out?
    I would have thought the metal casing on most fridges would work as a Faraday cage
     
    1 person likes this.
  19. MastersBrewery

    Journeyman, the learning never stops

    Joined:
    7/6/11
    Messages:
    2,319
    Likes Received:
    681
    Gender:
    Male
    Posted 24/6/16
    The brewometer uses the same sort of tech they say about 3m outside the fridge. Note with better aerial or any aerial, coverage would increase, and the brewometer is submerged which would also interfere with signal strength.
     
    1 person likes this.
  20. megabyte

    Well-Known Member

    Joined:
    18/4/10
    Messages:
    376
    Likes Received:
    237
    Gender:
    Male
    Home Page:
    Posted 24/6/16
    You're a wealth of information Mark!

    Yes, it's definitely the electronics, sorry if I made it seem like the liquid would change mass. The load cells use a piece of metal under strain and as they heat and cool their output changes a little.

    Yes. This is one of the drawbacks of using weight instead of flow sensing, also if the kegs and beer lines rub up against each other it could affect the readings as well. I don't foresee any troubles with monitoring keg levels where it doesn't really matter if you're out by 100g which is less than a quarter of a pint but 100g of error could make the CO2 measuring concept impossible.

    Awesome, I had it hard coded as 1.008 but I'll make it 1.010.


    Let me know if I'm missing something here. I thought calculating the error between f.g was like 1.020 / 1.006 = 1.0139 which is about 1.4% difference in mass. I can't envisage a need for quadratic equations unless you want to factor in the expansion of the liquid and the mass of air it displaces? I could be totally wrong here so please let me know if I've oversimplified things. Hopefully the error is still small even when the math is done right :D

    QR codes may be a great idea if we can get them to work. I'm not sure how hard scanning will be to implement in an app (there might be a library for it, or it could be a major undertaking) but I'll look into it. Alternatively, just draw a "1", "2" etc. on your kegs with a sharpie.


    n87 you are reading my mind!

    Yes. Having a BT/WiFi bridge is on the cards for the future and there are so many other value adds it could offer. Just gotta get this project finished first :)

    As for party mode. YES exactly, you're tha man!. Here's a sketch I made back in Feb. Wow I have been thinking about this project for a while...
    party mode - 1.jpg
    I even called it party mode, so that's how I know you're reading my mind :lol:

    Regarding signal strength. Yap, I've tested in my kegerator and the range seemed a little reduced, but still ample. I could walk into another room 10m away and still get reception. I think this was an embarrassing oversight for the original BrewNanny project that needed to connect to your house's WiFi, but with Bluetooth (BLE) our use case is easier because you're not trying to reach a router that might be at the other end of your house.
     

Share This Page