Measuring Alcohol Content With Time of Flight Sensors

[Chris] is a homebrewer – the tasty kind – and wanted a way to track the rate of specific gravity against temperature. Tracking temperature is easy, all you need is a 1-wire temperature probe hooked up to the microcontroller of your choice. Logging the rate of fermentation isn’t as simple, but with a time of flight sensor, a hydrometer, and some pool toys, [Chris] kludged something together that works reasonably well.

Specific gravity, and thus fermentation, has been measured for centuries with hydrometers. Not wanting to complicate matters with electronic sensors, [Chris] built a floating cage for his hydrometer out of a clear tube, a kick board, and a few bits of styrofoam. By placing a Sparkfun time of flight sensor at the top of the tube, and lowering the hydrometer into his fermentation bucket, [Chris] can measure the height of the hydrometer above the level of the liquid in his fermentation bucket.

Both the temperature and specific gravity are logged to a Raspberry Pi, and after combing through this data [Chris] can see a big ‘bump’ in the specific gravity due to a mass of foam, tapering down to the desired values after a day or so.

53 thoughts on “Measuring Alcohol Content With Time of Flight Sensors

    1. Actually the opposite of clever. The contamination by putting all sorts of who knows what bacteria attached to and living in the pores of that kick-board into your fermenting wort is a horrible idea.

      Not to mention you generally have to spin the hygrometer to get the yeast and foam off of it in order to get an accurate reading.

      I am sorry but this is way over complicated, if you control temperature, and initial yeast pitch all this is going to do is contaminate your batch and make it taste like band-aids/butterscotch. I would personally rather drink clean beer.

      1. Just sterilize it first. Any brewer knows that everything needs to be sterilized. The amount of yeast he is throwing will suppress other organisms.

        I agree with your assessment of the reading in-accuracy though. For the best possible reading the liquid sample would need to be degassed completely.

          1. Ok, it’s obvious you are a troll who has never brewed once in his life or has ever seen the inside of a micro-bio lab. I am just trying to help people out from having a bad batch wasting time and money.

            You know nothing about this subject, back under the bridge troll.

          2. I brew my own beer at home. My father has been brewing for years. Don’t claim to be an expert unless you are one. I do not claim to be a micro-biologist or an expert in brewing.

          3. Even with open or closed cells, if the material is something like polypropylene it can withstand sterilization temperatures no problem. The foam isn’t even a requirement, it could easily be swapped to something else with an offset and/or slope-correction applied to the reading.

  1. Neat. It’d be nice to collect the data and be able to predict about when a batch is going to finish. I do wine, and I find the rates can vary quite a bit based on condition and ingredients. I’ve got close to 10 gallons going right now that I have no idea when the bubbles are going to stop.

  2. This is pretty sweet. But don’t the bubbles clinging to the hydrometer affect the reading? When I do this measurement by hand I can spin or swirl the hydrometer to get some of the bubbles off, but this is in the tank all the time.

          1. -1

            It’s got all sorts of problems. Yeast and foam and detritus will travel up the tube, stick to the hydrometer and the foam hat and affect the reading in a random fashion that you can’t compensate for. The hydrometer will lean against the side of its hole, getting stuck easily or glue to place with the residue from fermenting. Bubbles and foam will form underneath the platform and lift it up in the wort, or pile up on top of the float and press it down…

            There’s no way I can see this will be reliable or accurate, and in the worst case scenario the hydrometer or bits and pieces of the aparatus get unstuck and travel to the bung, get stuck in the outlet and then *BLORT* the wort goes everywhere.

            And disinfecting the device is a world of difficult because of the large pieces of porous foam.

  3. Great project but the electronics can’t be sterilized so they’re no longer maintaining a clean brewing environment, and they’re going to have the same problem with an ultrasound transducer. I’d look into maybe placing a layer of foil around the scale of the hydrometer, securing it with a food grade sealant and then placing it inside a fixed tube containing an embedded coil. As the hydrometer height changes so should the inductance of the coil, and you won’t have to worry about inadvertently contaminating your wort.

    Another option might be to monitor vertical movement of the hydrometer with the electronics from an optical mouse sensor, although I can’t quite envisage how that would work without a very narrow tube which would be difficult to clean.

      1. It depends on the goal, you really only need accurate SG readings at the start and end of your fermentation stages. Where this (or something like it) would help is determining when a given stage is complete. I use one of my fridges for lagers and it’s a pain to pull the 20L tub out every time just to check if it’s finished yet.

        Also call me paranoid but I don’t like the idea of having non-food-grade materials anywhere near my wort, sterilized or no.

      1. CO2 bubbles don’t change the density a whole lot. Allowing the bubbling wort to go flat overnight in an open container changes the SG to the tune of <0.001 because the solubility of CO2 in water at STP is 1.45 g/L. To get all the CO2 out you'd need to pour the liquid back and forth between cups something like 50 times, but the effect of that would be just the 0.00145 at maximum.

        For all practical purposes, getting an accuracy below +-0.002 is good enough.

      2. Not to mention that research-grade equipment like oscillating u-tube densimeters aren’t cheap, so probably beyond the reach of any home brewer. Chris’ solution is a work in progress but it’s simple and inexpensive.

  4. Actually any home brewer who thinks he does more than sanitize is just using the word sterilize wrong. Unless you have access to an autoclave and all your gear can withstand 272 degrees for more than 3 minutes, and if it has any kind of lumen then 10 minutes, then it ain’t sterile.

        1. Sanitize. What do you think Sanitize means? Ever heard of Ethylene Oxide? I use povidone iodine myself in the fermentation vessel, but some people use sanitizing detergents. I use a sanitizing detergent for my bottles.

          1. This is a semantics argument, sanitize kills off most potential problem organisms. Sterilized means that all organisms (and any bacterial spores , etc.) are dead. What I do is sanitize. I’m not sure if beer is different, but for wine it’s worked every time so far.

    1. Thank you, someone else who has at least an inkling of understanding of microbiology. The incredibly high surface area of the foam is a much higher risk than the relatively lower surface are of the hdpe bucket.

      That being said it is much easier to sanitize a non-scratched bucket, than it would be to sanitize the Foam.

      Still when he takes a swig of that first beer from this set up, he will probably realize this should have been a hackaday fail.

  5. A hydrometers is pushed out of/into the wort by changes in density. In my mind if a tube were immersed in the wort, and extremely accurate changes in pressure were measured with a strain gauge inside the tube, after calibration, there would be a correlation between the pressure and density of the liquid in the wart. And the outside of the tube could be sterilised.

    1. That tube is going to catch fermentation gasses and become pressurized. Eventually it will be entirely filled with gas and no liquid with pressure equaling the hydraulic head of the mouth of the tube.

  6. For all those Brewing Experts beating up on this idea, saying it’s no good, that the foam can’t be sanitized, that it’s a solution in search of a problem… So What!

    Sure, there may be a microbial problem with being unable to properly sanitize the foam making the brew taste like back sweat filtered through a jock strap, and the idea may seem pretty useless given the ease you can sample and test the wort. But the guy wanted to be able to monitor the specific gravity electronically and he sat back and came up with a solution which is more than I can say for the rest of you arm chair critics.

    Instead of just sitting back and bashing the idea like every other garden variety troll out there perhaps try and come up with alternatives that will do the same job without the inherent weaknesses that seem to be apparent. “Truth” had the right idea, an alternative that sounds workable and the idea doesn’t bash the original one but instead is an alternative that has merit.

    This is after all how things get done. Have an idea, try it, learn from the mistakes, improve the design, rinse and repeat. If the beer does wind up tasting like jock strap then swap out the foam with something else, try other sanitization methods. It’s not like it’s really that big an issue and it can easily be dealt with if it is actually an issue.

    1. Yeah what he said. JonnyRico is being an argumentative prat.
      I can see too many problems, from the comfort of my armchair that is, with the current solution. Bubbles on the glass and contamination.
      Could the same thing be achieved with some sort of manometer?
      I think I remember someone doing a bubble counter on the airlock to work out fermentation rates here a while ago? SG=density so could another approach be to accurately weigh the fermentation vessel?
      Thats all I got for now.
      In saying that the biggest improvement I made to my brewing process (all grain beer) was having accurate control of fermentation temps. Hope [Chris] has that covered already.

      1. It seems like none of the commenters, including JohnnyRico, have bothered to actually read the project page. At the very bottom he says outright “Please note this is only an experiment, if it was to be used practically I would coat the foam with a plastic
        such as HDPE to make it sanitary.”

        You’d think that a ~Master Brewer~ (I can think of a similar sounding word that would go better here) like JohnnyRico would have looked at the pictures, noticed that an open plastic bucket is not a suitable fermentation vessel, and concluded that the guy is running an experiment and plans to dispose of the beer. But he was just too interested in showing off his supposed expertise to do even a little critical thinking of his own.

    2. Alright; I’ll give it a shot:

      A weight suspended by thin nylon string that is fixed to a lever above the liquid. The minute deflection of the lever by the weight is measured by strain gauges, effectively measuring the buyoancy of the weight which changes depending on the gravity of the liquid.

      You essentially build a simple digital scale and weigh the liquid indirectly. All you have to do is shape the weight such that floating yeast doesn’t pile up on top.

      1. The weight displaces its volume in liquid, so if you sink in an object that displaces 1 liters and is filled with lead shot to weigh 2 kilograms, the resulting pull on the string is exactly 1 kg at 1.000 density, and if the density is 1.050 then the reading on the scale will be 950 grams… etc. etc. so you subtract 2 kg from the scale reading and you get the specific gravity.

        You can use strain gauges to measure it, or you could measure the stretching of a simple steel spring, or have a tiny hole in the lid for the string and put a needle gauge outside for an analog readout…

      2. A perfectly ordinary kitchen scale will contain one of these:

        Kitchen scales have a precision of 1 gram, which is more than enough for the purpose. The sensor is an analog resistor bridge, so the quality of the signal amplifier and ADC will determine how precisely you can measure it.

        Even with 1 gram precision, the mass of the weight can be e.g. 200 grams with a volume of 1 dL for a rough estimate of the progress. You’ll get step information when the wort has gone from 1.050 to 1.040 to 1.030… and so on.

      3. And they say learning physics doesn’t lead to anything of relevance. It leads to beer. Hmm… Beer. *Homer Simpson drool*

        Aside from all that, Do you think something like plumb bob would work? They have a tendency to resist having anything “stick” to them. Or do you think their weight might cause a problem? I only ask because the setup you’re talking about reminds me a bit how surveying works. Hell, done right, it could be adapted to be optical and complaint of sterility becomes almost moot.

  7. Might it be possible to measure the liquid’s density directly? Light would probably move more slowly through pure water than through water with alcohol in it; could one point a ToF sensor at a mirror in the bottom of the container and use the reading to measure alcohol content?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.