I've been making wine with my family ever since I can remember. It's a fairly straight forward process that is nearly impossible to master. The wine my family made always started a grape varietal (such as Merlot
or Sangiovese). We would crush the grapes and throw the slurry into
primary fermentors where we would add a specially cultured wine yeast.
After a few days of this harsh smelling fermentation, we would then press
the grapes and put the liquid into glass carboys where you would then
add chemicals, sugar, and put the liquid under a water lock to keep
natural-air yeasts from infecting the brew and turning it to vinegar.
This goes on and on for months, until you might end up with something
that tastes pretty good.
Now let’s say you’re a poor college student. How to brew cheap wine? You can combine grapes (or cheap Welch’s grape juice), some water, and some yeast (I even sunk so low at one point where I used bread yeast) and you will undoubtedly end up with something that resembles wine. It won’t taste good! But it should get you snake-eyed. Either approach uses a very straight forward biological process of yeast, eating sugar, and giving off CO2 and alcohol. Wouldn’t it be fun to see how this biological process acts over time?
I decided to return to my roots and whip up a batch of world (in)famous homemade wine. And while I was at it, why not log the bubbles that are given off during fermentation?
Step 1 was to get all the materials together. Grape juice, acid blend, yeast, sugar, hydrometer, journal, a fermentor with water lock, and a big spoon.
Mmmm! Grape juice goes in. What will come out?
- 4 cans Welch’s Concord 100% Grape Juice
- Tap water to 3 gallons
- 2 tablespoons acid blend
- 1 spoon pectic powder
- Lalvin K1-V1116 wine yeast
After adding the water and acid blend chemicals, I took an initial hydrometer reading to get the sugar level.
I found the initial sugar level from the frozen juice was about 1.025. I wanted the level to be near 1.080. Time to add sugar!
1.040 - getting there!
After dumping nearly 5 lbs of sugar into the mix, I finally hit 1.085! 5lbs!
Now the point of this experiment is to capture the rate at which bubbles (we presume CO2) are vented off the fermentation. I found that this ‘double bubble’ air lock
worked great with our IR photo gate
Now the idea is to take the Logomatic
and reprogram it to record when a bubble goes by.
With a little testing, I was able to confirm that the photo gate would trigger each time a bubble went by. Then I spent a few days streamlining the Logomatic code to fit my purposes. The Logomatic is a fantastic little product. Ryan’s USB bootloader
makes it easy to reprogram the Logomatic with new firmware specific for my needs. Here is a link
to my cleaned up Logomatic code. It doesn’t support the regular config file parsing that makes the stock Logomatic so great, but I think this code is easier to understand and should serve as a good starting point for people wanting to edit the firmware for their own purposes.
Ok - so the brew is brewing. The Logomatic with Bubble Logging firmware is installed and running. Now with the magic of TV, we can fast forward 10 days.Stats:
- 3,118,000 bytes of logs
- 159,098 bubbles
- 851,580 seconds
- 14,193 minutes
- 9.85 days
As with any logging project, getting the data is easy, visualizing it is the hard part. One of the problems with the logs is how the events were saved. The logs looked something like this:
Bubble #, Seconds elapsed
This made it very difficult to graph in Excel (or Calc because we use Open Office). These spreadsheet programs expect time to be linear. In my logs, time jumped around as the bubbles rolled through. I also had 7 or 8 logs as each morning I would reset the system to make sure I didn't overflow any given text log file. So to stitch the logs together and fix the time-base problem, I created this quick and dirty Visual Basic program
. I publish it so that hopefully you can use similar text file parsing tricks as the basis for your own log challenges.
Can someone show me how to write something similar in Python? I should really learn Python one of these days.
After stitching, I ended up with a nice linear time-based CSV file (check it out!
) that can be easily imported into your favorite graphing program. In this case, I used the very limited Excel to graph the bubbles per minute over a 10 day period:
I am so bad with Excel, I can't even get the axis labeled correctly. On the left axis we have bubbles per minute. On the bottom axis we have seconds elapsed. Wouldn't it be nice if that axis was in hours or days? Man I hate excel. Can someone take this excel file
and show me how to get the axis in days?
Graph submitted by JWood (user comments):
Ahh! Much easier to read. Thanks JWood!
What can we learn from this graph? Assuming the data is sort of correct, it fits with what I would expect: the fermentation heats up quickly and (logarithmically?) dies as the yeast consumes all the sugar.
There is some interesting behavior on the tail. There are rhythmic dips in bubble production. This could be an interesting yeast behavior, or it correlates with each morning that I got up and reset the system (tapping the bucket and disturbing the system).
Perhaps those dips are around when I would come home and the vibrations of walking around caused latent pressure to be given off? No, that doesn't really make sense with the data. But I did notice that my walking around was enough to cause the air lock to shake out a bubble.
In the end, the system seems to work. But I did notice that the photo gate did not
catch every bubble. A bubble could slip by undetected. The system was also unable to capture multiple bubbles within the same second (possible during peak fermentation). I believe I captured the rough nature of the fermentation process but it certainly could be run again.
Oh, and the wine? It was murky, smelly, horrible concoction that got sacrificed down the sink.
Questions to answer:
What is the best way to visualize data stored in text files? Phython scripts? There must be something online?
How to beat excel into shape?