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

    Homebrewing Facebook Group

Can it even be done? Measuring Specific Gravity using Arduino or Raspberry Pi

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I could be wrong, but there are accelerometers out there for $5-15 that claim to measure tilt. Their proof of concept was a Wii remote, that's a cheap sensor.
 
Many ppl here smarter than me. If someone can prototype an effective design and effectively writeup some DIY instructions, I'm sure many here would like to build one.

If something like this can be linked to a BrewPi type solution, that may be the dream. Then change temp control via style profile. The whole fermentation process would be automated with real-time data.

Nice dream.
 
That's an exciting approach, too. Could the abundant chinese range finders even be suitable for that?* I'm wondering if you might get (reproducibly) different point-blank readings from different materials based on density, and then it's just a question of resolution.

*(I'm guessing the answer is "no, but it will cost me all of $4 and shipping to prove it")
 
You could certainly try, I'm not sure how accurate that would be though.

I'm trying to measure the speed of sound using a 100MHz ADC to try and get fine grained information.
 
Chris, that is very similar to the coriolis effect sensors. If one could measure volume with precision, the weight options would be very inexpensive
 
creekrat, I'm not sure what you mean exactly by weight options. Do you mean where you dangle a weight in the beer, like beer bug, if so I've tried that approach, but found massive problems from creep from the load cell.
 
Volume precision shouldn't be necessary with a load cell/weight system, right? And if it were you should be able to use known OG as a baseline.

Also inelegant, but maybe you could account for creep with a second load cell, with a matching weight above the beer line? Nothing says they'll be exactly the same but I gather load cell creep is fairly consistent and depends on materials.

I guess slight buoyancy might mean less creep than the control weight (depending on how little weight we're talking), but if you lightened the second weight slightly assuming the "in liquid" weight was in 1.000 or 1.060 or whatever assumed SG... I don't know at this resolution that might not even be necessary.
 
Wouldn't this all be simpler if you use the principal of bending light like a refractometer? It's certainly a proven and reliable concept. The difficulty is in automating it and getting it to work over a period of time in the fermentation environment.


Sent from my iPhone using Home Brew
 
I think once you're looking at a digital refractometer that can interface with arduino you are passing the cost of more expensive, tested methods (coriolis or off the shelf)
 
I'm skeptical on the accuracy of refractometers in general once there's fermentation.

Ideally spectroscopy would be the solution, but the sensors are ridiculously expensive (currently).
 
Actually... I mean why would you do this with tilt when you could install a stationary rotation sensor, which should be more accurate and cheaper?

As far as I can tell you'd just need a waterproof port with a rod that can spin, and a unit on the outside with a rotation sensor. You could calibrate with water before each brew.

Thanks for bearing with my kindergarten drawing (and possibly kindergarten engineering)

Untitled.jpg
 
You should be able to overcome friction without a problem and still have a seal. I can't figure out what kind of off-the-shelf seal to use, but vinyl/silicone tubing with a food safe lubricant should do the trick if you can get a rod to fit snugly.
 
The wort OG was 1.043, and it ended at 1.018 (it was fermented in a too cold basement with too little WLP400, which is probably why it stopped early. No oxygen added or shaking wort either..) The values on the graph is voltage * 1000 so there is a 300 mV difference from start to finish.

Hello Øyvindt!

I just found this thread and was very interested in your post.

I'm trying to make sense of the numbers, please help me out!

Your sensor has a pressure range of +-25 mbar, which should be represented by 80% of the Vsupply of your chip, which I'm guessing is 3.3V. That would mean that 2.64 volts is 50 mbar, or about 19 mbar per volt.

Your reading of 300 mV between the start and end of fermentation would mean a pressure difference (or difference of difference of the pressure) of 5.7 mbar, or 570 Pa.

Static pressure in a liquid as I can tell is density * depth * accelleration of gravity. The difference in pressure between two depths is density * depth difference * accelleration of gravity.

The initial pressure difference should be 1043 kg/m^3 * 0.15m * 9.81 = 1535 Pa or 15,35 mBar. The final pressure difference should be 1018 kg/m^3 * 0.15m * 9.81 = 1498 Pa or 14.98 mbar. The change in pressure difference should be 37 Pa or 0.37 mbar.

Yet you seem to be getting 5.7 mbar (15 times more than expected). Have I calculated something wrongly? Or could there be a change in pressure in the CO2 between the beer and the airlock or something else causing the change?

Regards from Stockholm.
 
You should be able to overcome friction without a problem and still have a seal. I can't figure out what kind of off-the-shelf seal to use, but vinyl/silicone tubing with a food safe lubricant should do the trick if you can get a rod to fit snugly.


You wouldn't even need to seal it, just have the entire assembly immersed and install a sight glass to see the position of the unit. You could even integrate the fitting/sight glass/'sensor' into one unit.
 
Good luck with this. I'd be curious if you managed to get it done cheaper than a beerbug :)
 
I've been playing with this on and off for a few years now.

The most effective solution I've come across so far is to use a mass flow meter to track the total quantity of CO2 blown off. This is an imperfect (though quite good) correlate to gravity and a perfect correlate to ABV. I use a mass flow controller that I got off ebay for around $65...works a treat and makes a great spunding valve for pressurized fermentations (if you're into that).

I could never get the floats and suspended stuff to work properly. Fermentation is just too gunky.


Bringing up an old post here, but i thought I'd ask. I have a couple of mass flow meters I bought years ago to do exactly this. I've always felt like it would be the most painless method for real time fermentation monitoring. Did you ever put together a thread/post on how you implemented? Are you totalizing the CO2 or just getting the live readings? Do you have any temp correction for CO2 saturation in the beer? How are you keeping gunk out of the meter? Sealed knockout?

Sorry lots of questions. I want to get my system implemented this summer so I'm gearing up.
 
I really should put my money where my mouth is before posting. Especially when I want to try something a lot of people have tried, but it never caught on. But, if anyone reads this and wants to run with my ideas, you'll probably outpace my trying to find time for the project.

I want to use a microcontroller for fermentation temperature control, and I've wanted to try my hand at Peltier thermo electric coolers. I know, sounds like there are some moderate successes at this, but not enough it's taken off. My take is this. I want to ferment directly in a cooler in order to insulate from outside temperature. I also want to use an aluminum heat transfer plate in the wort to directly couple the heat out of the cooler. (Many just use the fans to cool air above.)

With that background info, the relevance to this post topic is that I had considered fermentation monitoring since you have the microcontroller there anyway. That was to be an add on project *if* the TEC succeeded. Then I realized, fermentation should produce an amount of heat proportional to alcohol production. The thought is, if I (or you) can characterize the amount of heat that the TEC has to pump out of the cooler in order to maintain a temperature difference, you can then subtract that from the amount of heat you are pumping out of fermenting wort and get an estimate for free.

One more explanation? If you build a device that will keep water at a specified temperature, and you measure how much power it is taking to do it. Then if you use it to keep fermenting wort at that same temperature and count how much more power is required, the difference is an indication of heat produced and is proportional to alcohol production.

I'd never thought of it, but duty cycle on everyone's chest freezers might do the trick as well?

Any thoughts?

I am accumulating some parts for the experiment, and will post if I have any success, or maybe even a failure post.
 
I really should put my money where my mouth is before posting. Especially when I want to try something a lot of people have tried, but it never caught on. But, if anyone reads this and wants to run with my ideas, you'll probably outpace my trying to find time for the project.

I want to use a microcontroller for fermentation temperature control, and I've wanted to try my hand at Peltier thermo electric coolers. I know, sounds like there are some moderate successes at this, but not enough it's taken off. My take is this. I want to ferment directly in a cooler in order to insulate from outside temperature. I also want to use an aluminum heat transfer plate in the wort to directly couple the heat out of the cooler. (Many just use the fans to cool air above.)

With that background info, the relevance to this post topic is that I had considered fermentation monitoring since you have the microcontroller there anyway. That was to be an add on project *if* the TEC succeeded. Then I realized, fermentation should produce an amount of heat proportional to alcohol production. The thought is, if I (or you) can characterize the amount of heat that the TEC has to pump out of the cooler in order to maintain a temperature difference, you can then subtract that from the amount of heat you are pumping out of fermenting wort and get an estimate for free.

One more explanation? If you build a device that will keep water at a specified temperature, and you measure how much power it is taking to do it. Then if you use it to keep fermenting wort at that same temperature and count how much more power is required, the difference is an indication of heat produced and is proportional to alcohol production.

I'd never thought of it, but duty cycle on everyone's chest freezers might do the trick as well?

Any thoughts?

I am accumulating some parts for the experiment, and will post if I have any success, or maybe even a failure post.

This all sounds good theoretically if your ambient temperature never changes. My wild guess is it becomes difficult to determine exactly how much energy is being used to maintain 65F at different ambients versus how much is used to offset the small amount of heat energy generated from fermentation activity. This may work during the most rigorous part of fermentation but as fermentation activity slows down the heat generated goes to almost nothing for the small batches us home brewers make.
 
Agreed, but a temperature probe outside the cooler should be able to track the temperature difference. I suspect temperature difference will be the deciding factor (ie it takes x amount of energy to keep the inside at 30 degrees in a 60 degree room and x amount of energy for 60 in a 90 degree room.) If that curve can be modeled and is reliable, then you're in. Much experimentation will be required, of course.
 
Agreed, but a temperature probe outside the cooler should be able to track the temperature difference. I suspect temperature difference will be the deciding factor (ie it takes x amount of energy to keep the inside at 30 degrees in a 60 degree room and x amount of energy for 60 in a 90 degree room.) If that curve can be modeled and is reliable, then you're in. Much experimentation will be required, of course.


You'd really need a good handle on the thermal properties of the cooler. The heat lost to the environment will change fairly significantly with liquid level, interior temp, exterior temp, exterior convection sun exposure, etc, etc. If it was a steady state, stable process it would be one thing, but the transient nature of fermentation would make it a bear to attack the problem from the angle you're thinking of. To test all the conditions necessary to control for each variable in that system would probably take you a year of testing and modeling.
 
You'd really need a good handle on the thermal properties of the cooler. The heat lost to the environment will change fairly significantly with liquid level, interior temp, exterior temp, exterior convection sun exposure, etc, etc. If it was a steady state, stable process it would be one thing, but the transient nature of fermentation would make it a bear to attack the problem from the angle you're thinking of. To test all the conditions necessary to control for each variable in that system would probably take you a year of testing and modeling.

Good points. I'll watch for those variables and continue to consider others.
 
Bringing up an old post here, but i thought I'd ask. I have a couple of mass flow meters I bought years ago to do exactly this. I've always felt like it would be the most painless method for real time fermentation monitoring. Did you ever put together a thread/post on how you implemented? Are you totalizing the CO2 or just getting the live readings? Do you have any temp correction for CO2 saturation in the beer? How are you keeping gunk out of the meter? Sealed knockout?

Sorry lots of questions. I want to get my system implemented this summer so I'm gearing up.

Sorry, I never quite got around to writing things up, and most of my gear is in storage far, far away from me for the foreseeable future. Happy to help from memory as I can, though.

  • My mass flow controller didn't have a totalizer built in, but it did have a serial connection. I used that to log gas output rates, and then I just calculated the area under the curve to produce a live estimate of the total.
  • I was doing fermentations under pressure, I was already keeping track of my CO2 saturation for that. For a normal ferment, however, I can't imagine that the CO2 dissolved in the wort is going to substantially disrupt your gravity estimates.
  • My fermentor fed into a sealed blowoff container, which fed into a moisture filter, which fed into to mass flow controller.

Good luck! Let us know how it goes.
 
.. I'll have to do some digging for more details ;) And the Beaglebone stuff probably wouldn't be that useful if your more used to Arduino or the like, but I'm up for helping out and doing more experiments with this! :D

You wouldn't happen to have the details of the Beaglebone stuff available. I'm looking into doing something similar, but I'm playing around with Arduino, Raspberry Pi and Beaglebone stuff.
 
@Malfet, I looked into mass air flow sensors some years ago but abandoned the idea because I thought that the first blow-off event would destroy them (fragile hot-wire, difficult if not impossible to clean etc.).

Was your sensor tolerant to blow-off events or did you use other measures to prevent such an incident?
 
@Malfet, I looked into mass air flow sensors some years ago but abandoned the idea because I thought that the first blow-off event would destroy them (fragile hot-wire, difficult if not impossible to clean etc.).

Was your sensor tolerant to blow-off events or did you use other measures to prevent such an incident?

Nope! Not tolerant at all. I've got mine hooked through via a closed blowoff container (water filter housing) and a moisture filter.
 
I was looking into measuring SG while sparging, to ensure sparge is stopped before tanin extraction.
I was going to go down the digital refractometer route, using a simple 'drip feed' from the output of my mash tun to moitor the brix of the wort coming out. ie drop a drip of wort into the electronic refractometer's test well, digitaly read the brix after a few seconds to allow the sample to settle and cool, then displace the drop with the next sample and test etc. Taking a measurement every minute or so.

Also was going to include a rinsing mechanism, that simply squirts the well clean with RO water. COuld be simply implemented with a solenoid.

Still plan on implementing this at some stage, but would need some help to hack into the refractometer to triger it and read the results.

Steve
 
Has anyone tried measuring SG with the resonance of a piezo driver? I imagine if a piezo speaker were immersed into a liquid its resonance should alter along with the S.G of the liquid. I don't know how reliable the results would be but it might be worth investigating.
 
Has anyone tried measuring SG with the resonance of a piezo driver? I imagine if a piezo speaker were immersed into a liquid its resonance should alter along with the S.G of the liquid. I don't know how reliable the results would be but it might be worth investigating.

I've had similar thoughts. This would be akin to an oscillating U-tube densitometer. The principle would be to determine the density of the wort/beer using a piezo transducer immersed in the liquid running a frequency sweep. The impedance would spike at the resonant frequency of the liquid. This would be fairly easy to implement, but I just don't know how much of a shift in resonance would take place given the relatively small difference in density of unfermented wort vs. beer. I think it's certainly worth some investigation though.
 
I read an article over here that makes it sound do-able, but I also wonder if it could be easier to just use a 3 lead driver and the traditional feedback circuit to drive it. I doubt they make sanitary versions of these piezos though.
 
Back
Top