Bubbler-Logger - A fermentation logger measusing CO2 sound-bubbles to calculate SG!

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

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

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

kbaggen

Well-Known Member
Joined
May 19, 2017
Messages
88
Reaction score
17
Location
Roskilde, Denmark, EU!
Dear All,
I have been working on a ferment Bubble-Logger to measuring the CO2 activity and hence to be better to foresee the fermentation, Dry-hopping, temperatur increase, etc.! It calculate the SG though a 3rd degree polygonum, based on know amount of water in airlock (4ml) and brew-seize vs. a know set of gravity measurements for a real brew.

It is based on a Arduino and a digital sound detector, a temp probe and a relay to control in my case 14W warming-mat/belt.

You can say it is a DIY PLAATO!

Cost is a nodeMCU, a ds18b20 + resistor and the digital sound detector, e.g. around 7-8$, if a relay is need the cost is likely 10$ in all!

It post to Ubidots!

The idea is to have one device to measure activity and give an idea on SG, and at the same time controlling the temperature! As I live in cold Denmark there is seldom need for more than one channel temperature control (e.g heating)!

So just to make an appetizer for people and to get a feeling if people would like to see more, please see here:

https://app.ubidots.com/ubi/public/getdashboard/page/34PfeVSlCYvi_2V9wT3byvlC1h0

Some other (no SG istalled though):
https://app.ubidots.com/ubi/public/getdashboard/page/r0pc0eKCRDfaSxJ9hjaoT-axBqU
https://app.ubidots.com/ubi/public/getdashboard/page/jGfU5I_Ob8XHUPP_HYAd6r5tTxg

A video:
https://1drv.ms/v/s!An5QQQ1io7W7iPpdsnN_Sb-q9Ra61A

Pictures:
https://1drv.ms/u/s!An5QQQ1io7W7iPpN4AFgv9J42BjgPQ
https://1drv.ms/u/s!An5QQQ1io7W7iPtPrFBJTANNeF9czw
https://1drv.ms/u/s!An5QQQ1io7W7iPsvWk4Cize8Rr1uIw

Issues!
  • The sensor needs a "condom" (small water ballon) as else mosture will bugger it soon or later!
  • A blow-out is likely also needed, or you need to have at last 25-33% headspace!
  • Calibration a bit buggy!
  • Fermenter needs to be 100% airthigt, so forget your buckets!
  • High sound is ofcouse an issue!
  • Prone to interfering from electronics, so not sure it can be put in frezzer at all (needs testing)
 
Last edited:
I will.........meaning I will post info/code/guide on grithub, and update here when I think it is ready!

I just need to verify the right 3rd degree Polyniumal for the SG estrimation, and as such need a couple more brews!

Keep you posted!
 
I have also messed around with a bubble counter. I made mine with an IR gate and keep track of the fraction of the time that has air in the air lock. Mine tests every 5 ms and then keeps track of the fraction of time that the gate is open. I dont know if this will be helpful, but here is what I have learned about using bubbles to estimate SG:

-Bubbles and C02 release is non-linear, such that more gas is released per bubble as the rate of gas release increases. The bubble rate squared works as a decent indicator of the gas release. The cumulative sum of the gas release * a scaling factor, will give a good indication of CO2 release or extract consumption.

-The scaling factor is dependent on a bunch of dynamic things that make it really difficult to reliably estimate SG. It is altered by the height of liquid in the air lock- this relationship is really sensitive. It is also altered by the type of fermenter (SS vs plastic were different) and the headspace. All of this makes sense, if you consider that the amount of gas released per bubble is all dependent on the difference in the pressure between the inside and outside of the fermenter.

-The bubble counter works great as an indicator of fermentation rate, but unless you actually measure the gravity at some point during fermentation it is impossible to accurately predict the extract consumption during fermentation based on the OG alone. But it works pretty decently if you measure the gravity during each fermentation and use that to determine the scaling factor.

-I spent way more time than I should have going down this rabbit hole. If I had it to do over, I would buy/make a tilt so that you have a 'gold standard.' Not to discourage you- I learned alot though the whole endeavor.

In the end, I still use the gas monitor because it looks cool and allows me to gauge the vigor of my fermentation without trekking to the basement. My ferment control system uses the same temp probes as yours to measure the ambient and beer temps and uses that info to turn heaters and coolers on/off. I have made ML models based on this info to estimate gravity and think that it will ultimately work well. But these models are also sensitive to the type of fermenter, placement of the temp probes, and the insulation around the fermenters...

Good Luck and I look forward to hearing what you find!
 
Hi Muchaco,
everthing is posted on, https://github.com/kbaggen/Cheapfathers-Bubble-logger- , now!

And the idea is not to get excact SG estrimation, but get an idea on it.....so I do not have hopes it will turn an excact, but if I can get 3-4 error of mean then I am fine and happy! Will post next brews!

I am totally aligned to you statement the amount of water in airlock, and shape of it, diameter, likely to play part of the game!

I am not sure the size of the Equipment, or metal v. plastic do make an impact, as the release of CO2 is counted in many liters, and hence a big headspsace might delay some release an set the SG off by 0.5 point or so, but if the same airlock is used, same amount of water in the airlock, and foremost a calibrated sensor, there thereby hold same calibration from brew to brew, then I hope to overcome some on the issues you mention!

Secondly, to use CO2 ad measument......the foremost important factor is....it must be completly airtight to make any sense, and brew bucket is **** in this sense (pardon my france)!

Sofar, the issues seems to be here with my setup, was I ahd no way to Calibrate before I got the idea as psoted at grithub…...so did you had a calibrated sensor?

We will see, when next brew is running....hopefully yeast is added Monday evening!
 
Last edited:
At peak fermentation, especially with big beers and ales, you get multiple bubbles at once. For example, a three second pause then blurb-blurb-blurb, then three second pause, etc. I suspect that a bubble counter simply can't pick up the activity correctly then, so I'm very skeptical this concept is workable. Good luck though.
 
Dear SpeedYellow/All,
thanks for the consideration! I decided to add "angle" detection tough a MPU6050 today (did some testing with some 4-5 brews ago)! Hence, you can say a wired version of Ispindel and give a +/- 2 SG detection!!

Hence, it shows yeast activity though the CO2 bubble detection and the SG is then now based on a petling tube floating in the wort, e.g. angle or tilt.

SpeedYellow…….regarding your question, then it do pick up the bubbles rather good, and the testing I did in slow-mode of Mobil do seems to be "good", but some bubbles is missed, hence, also the reason it might be fine for a activity indicator, but less good as SG estrimation!

Will post this run tommorow, bedtime in DK!
 
Cool project, I did something similar with a microphone and Pi to capture the bubble sounds :

https://www.anfractuosity.com/projects/bubbleometer/
https://github.com/anfractuosity/bubbleometer

The graph I generated -
Seemed to match roughly with the IR approach from sparkfun, interestingly I also have the same dip as theirs, i'm not sure if I found the reason for that dip relating to the fermentation though.

Like others mention I think it's rather difficult to discern multiple bubbles happening in a short time though, but maybe that's not too much of an issue, if the general trend is the main thing.

Look forward to seeing your graph of estimated SG! (I don't think you've posted that yet, unless i've missed a post?)
 
chris2012 and all,
I had to take away the SG from the above brew, issues in calclauting the SUM bubbles from my script....!

I taken one hydrometer this afternoon (more to be added at the HTML section at Ubidot):
20may Kl 16.30; 106000 ~SBM/L = 4600 ~ SG_SBM/L=1036; Hydrometer=1035

The model I use is:
(excel link: https://1drv.ms/x/s!An5QQQ1io7W7iPspjgkQS8NKWmEgzg)
y = 2E-12x3 - 1E-07x2 + 0,0041x + 0,6957
R² = 0,9985

(data from former brew "PIP black IPA", just adjusted by 1 SG as I turned down the resolution of the sensor as it else was very sensitive)

Where x= SBM/L ("SBM"/"brew size" (if written fully: Sound bubbles pr min/batch size)).

Hence, to reach:
SG=1030, I need 150000 bubbles ~ 6522 SBM/L
SG=1024, I need 200000 bubbles ~ 8696 SBM/L
SG=1018, I need 250.000 bubbles ~ 10870 SBM/L
FG=1014, I need 285.000 bubbles ~12391 SBM/L

Hence, I guess you can follow it this way!

Note, The "SBM_sum" at Ubidot currently only show half as the script only send every second min, and hence only shows the half, hence the reason to multiply with 2!

I guess I have got the hang of the calibration of the sensor, and will need to prove if or not it can work by a few more brews
! Also The reson I have maked it private on github agian!

(Btw.....I also tried a bit with the wired tilt/angle detection in the above brew.......not sure it is the way, to much hassel)
 
Last edited:
It looks like your code is not longer posted.
If I remember correctly, you had a 20 ms pause in your loop. I think you would get better data if you changed from trying to count bubbles, to keeping track of the fraction of the time that the sensor is returning 1 with a smaller pause. For me I got really nice data with a 5 ms pause and calculating the fraction of time when there was air rather than water in the air lock over a few minute time interval.
 
Hi Muchacho, I tried with less then 20ms, and seemed to me to give some ehco…….wich is an issue you dont see in opti-sensor/detection. Hence, I am not happy to lower it :)

I took it off GitHub to re-consider text a bit, guess it is maybe 1-2 brew to early! But I attach the code as a txt file here for you or anyone to look at! (Will likely put it up again tomorrow or next days).

The code seems steady now (no glitches in the off-brew- version I testrun on) and calibration for a not to sensitive setting of pontimeter of sound sensor seems done. Hence, main thing is to make a few brew and from those compile a final polynomium to use (the other brews in above excel file all got some glitches from code, to sensitive calibrated, yeast-particles making a fuzz by no blow-off setup, or moisture playing it game on sensor and foremost I had no way to calibrate wich I think I do have now!!!)!

The 2 brew I got running (just incase it got lost in all the other stuff):
https://app.ubidots.com/ubi/public/getdashboard/page/34PfeVSlCYvi_2V9wT3byvlC1h0
https://app.ubidots.com/ubi/public/getdashboard/page/oryUSQPFTyZBZYJ23le4xzNlOtk

So when the latest brew (Moe Stout) is done, I will compile a more bullet-proof polynomium to rely one!
The current polynomium is at least 4 SG off here midway, and even that is till a good indication I try to do better :)
 

Attachments

  • Bubble logger_ver1.0.txt
    9.4 KB · Views: 16
Last edited:
I have also messed around with a bubble counter. I made mine with an IR gate and keep track of the fraction of the time that has air in the air lock. Mine tests every 5 ms and then keeps track of the fraction of time that the gate is open. I dont know if this will be helpful, but here is what I have learned about using bubbles to estimate SG:

-Bubbles and C02 release is non-linear, such that more gas is released per bubble as the rate of gas release increases. The bubble rate squared works as a decent indicator of the gas release. The cumulative sum of the gas release * a scaling factor, will give a good indication of CO2 release or extract consumption.

-The scaling factor is dependent on a bunch of dynamic things that make it really difficult to reliably estimate SG. It is altered by the height of liquid in the air lock- this relationship is really sensitive. It is also altered by the type of fermenter (SS vs plastic were different) and the headspace. All of this makes sense, if you consider that the amount of gas released per bubble is all dependent on the difference in the pressure between the inside and outside of the fermenter.

-The bubble counter works great as an indicator of fermentation rate, but unless you actually measure the gravity at some point during fermentation it is impossible to accurately predict the extract consumption during fermentation based on the OG alone. But it works pretty decently if you measure the gravity during each fermentation and use that to determine the scaling factor.

-I spent way more time than I should have going down this rabbit hole. If I had it to do over, I would buy/make a tilt so that you have a 'gold standard.' Not to discourage you- I learned alot though the whole endeavor.

In the end, I still use the gas monitor because it looks cool and allows me to gauge the vigor of my fermentation without trekking to the basement. My ferment control system uses the same temp probes as yours to measure the ambient and beer temps and uses that info to turn heaters and coolers on/off. I have made ML models based on this info to estimate gravity and think that it will ultimately work well. But these models are also sensitive to the type of fermenter, placement of the temp probes, and the insulation around the fermenters...

Good Luck and I look forward to hearing what you find!

Hi again and especially Mucgancho,
I guess I a bit have a come to same conclusion that every time I think I had got the hang of it, it twist, and number goes off! Hence, the statement of above and also what I hear from PLAATO users is the use of bubbles is so hard to turn into a usefull SG estrimation. The doubt will always be high we still need a few FG Measurements by hydrometer to be sure we reached FG (that is not a suprise nor the idea of the proejct to overcome this need)! So I geuss I settle on just a "acivity" logger and the "heat" source relay part of my script!

I might take it up in winter time but wife dictates I spend time in garden (and not just drinking beers :)
 
Back
Top