DIY Photometer for EBC measurement
DIY Photometer for EBC measurement
Hi!
Thought I'd share my morning's activities with the forum.
One of the few things I don't measure in my beer is the end colour. Everything else I've got pretty much covered...gravity, temperatures, etc. So I thought I'd have a go at making a photometer which (eventually) should be able to tell me the EBC of my brews.
Here's the theory.
According to wikipedia, EBC is estimated by measuring the absorbance of 430nm light through a 1cm sample of the beer. Standard practice to measure absorbance like this is to split light through a prism to isolate 430 nm, then use photon detectors/multipliers to measure the attenuation of the lightpath through the beer. Riiiight!
So, I recon a suitable alternative to all this is the humble web-cam. My argument is that RGB CCD devices can act as a photon detector, isolated to aorund 430nm by discarding the red and green channels and keeping the blue. This page shows that the blue component of RGB is roughly 440nm. That's close enough to 430 for me! Of course, this will vary from manufacturer to manufacturer, but I'm only really interested in if this is possible at all rather than achieving great accuracy.
All I need to do now is create a light-box of some sort to give a steady source of light, and use a web-cam to record an image of a beer sample. The image can then be programatically broken down into RGB components, and the blue channel can be used to give an estimation of EBC. Et voila!
So here goes...
1) Obtain (old) webcam
2) Take lens & board out of webcam
3) Gather other components for light box.
4) Assemble light source. This is an LED from a torch, with a switch.
5) Cram everything into the box
6) Aaaand we're done
7) Now the software. It doesn't look like much at the moment, but the basics are there. The box on the left is the feed from the webcam.
The graph is showing the intensity of the blue channel (from 0 - 255).
8 ) Ok, it's ready for reading beer samples. Now to see if the photometer can detect differences in beer colour.
Here I've prepared a range of dilutions of Meantime's London Stout. The dilutions are: 0% (water), 10%, 20%, 30%, 50%, 70%, 80%, and 100%.
9) Loading a sample into the photometer
10) Here are the readings from the software. Quite a nice curve, not quite logarithmic, but at least there are no anomolies.
11) I put the data into zunzun.com to get an equation for the curve (simple power curve, it turns out), and add this into the software.
The idea now is that the photometer should be able to tell me what the dilution of a sample chosen at random is. And it bloody works too!
Here it is with the 70% dilution sample.
With all the samples, the predicted dilution is within about +/- 3%. This is as far as I have got up to now.
Next steps will be to obtain beers with known EBC (the Meantime London Stout used here is a known 50 EBC) to get a feel of how the unit reacts to different styles of beer. From there, a calibration curve can be prepared, which will allow direct estimation of the EBC of an unknown beer.
I'm not to au fait on the EBC/SRM calculations at the moment, but I'll have a good read over the week. If anyone has working knowledge of EBC calculation, I'd love to hear your comments/critisim.
Cheers!
Thought I'd share my morning's activities with the forum.
One of the few things I don't measure in my beer is the end colour. Everything else I've got pretty much covered...gravity, temperatures, etc. So I thought I'd have a go at making a photometer which (eventually) should be able to tell me the EBC of my brews.
Here's the theory.
According to wikipedia, EBC is estimated by measuring the absorbance of 430nm light through a 1cm sample of the beer. Standard practice to measure absorbance like this is to split light through a prism to isolate 430 nm, then use photon detectors/multipliers to measure the attenuation of the lightpath through the beer. Riiiight!
So, I recon a suitable alternative to all this is the humble web-cam. My argument is that RGB CCD devices can act as a photon detector, isolated to aorund 430nm by discarding the red and green channels and keeping the blue. This page shows that the blue component of RGB is roughly 440nm. That's close enough to 430 for me! Of course, this will vary from manufacturer to manufacturer, but I'm only really interested in if this is possible at all rather than achieving great accuracy.
All I need to do now is create a light-box of some sort to give a steady source of light, and use a web-cam to record an image of a beer sample. The image can then be programatically broken down into RGB components, and the blue channel can be used to give an estimation of EBC. Et voila!
So here goes...
1) Obtain (old) webcam
2) Take lens & board out of webcam
3) Gather other components for light box.
4) Assemble light source. This is an LED from a torch, with a switch.
5) Cram everything into the box
6) Aaaand we're done
7) Now the software. It doesn't look like much at the moment, but the basics are there. The box on the left is the feed from the webcam.
The graph is showing the intensity of the blue channel (from 0 - 255).
8 ) Ok, it's ready for reading beer samples. Now to see if the photometer can detect differences in beer colour.
Here I've prepared a range of dilutions of Meantime's London Stout. The dilutions are: 0% (water), 10%, 20%, 30%, 50%, 70%, 80%, and 100%.
9) Loading a sample into the photometer
10) Here are the readings from the software. Quite a nice curve, not quite logarithmic, but at least there are no anomolies.
11) I put the data into zunzun.com to get an equation for the curve (simple power curve, it turns out), and add this into the software.
The idea now is that the photometer should be able to tell me what the dilution of a sample chosen at random is. And it bloody works too!
Here it is with the 70% dilution sample.
With all the samples, the predicted dilution is within about +/- 3%. This is as far as I have got up to now.
Next steps will be to obtain beers with known EBC (the Meantime London Stout used here is a known 50 EBC) to get a feel of how the unit reacts to different styles of beer. From there, a calibration curve can be prepared, which will allow direct estimation of the EBC of an unknown beer.
I'm not to au fait on the EBC/SRM calculations at the moment, but I'll have a good read over the week. If anyone has working knowledge of EBC calculation, I'd love to hear your comments/critisim.
Cheers!
-
- Piss Artist
- Posts: 291
- Joined: Sun Oct 24, 2010 11:16 am
- Location: Plymouth, Devon.
Re: DIY Photometer for EBC measurement
Excellent job!
I love seeing little projects like this.
I love seeing little projects like this.
Re: DIY Photometer for EBC measurement
Now this is taking home brewing a little too seriously.
I like it
I like it
Re: DIY Photometer for EBC measurement
Very good. Well Done!
I recall somebody like John Palmer on a podcast a couple of years ago, putting forward the idea that photographing beer with a digital camera, filtering out everything except blue in photoshop, should give a a good idea of colour. I don't think that he went very far with it.
For a long time I have been toying with the idea of making a simple photometer using a blue LED, some of which peak at 430nm, a photocell and a PIC microprocessor to do the crunching, but that never got much further than a bit of paper.
You said:
Colour = 10*(PLn/PLa)*LOG10(Li/Lo)
Where:
Li = light in (The count given through clear water, preferably 255 or 254 counts in your case)
Lo = light out. (The count given through a test sample)
PLa = actual path length in cm (the internal diameter of your tubes)
PLn = normalised path length in cm. (2.5 for EBC : 1.27 for SRM)
Pay attention to stray light. Not understanding stray light and detector noise was one of the schoolboy gaffs that George Fix made with his infamous Michelob colour / dilution measurements. Stray light is light reaching the detector that is not of the proper frequency, and this might be an issue without adequate filtering. It might give the false impression that beer does not follow the Beer-Lambert law and also restricts the practical dynamic range of the detector. It will probably be the reason for the apparent flattening of your curve at the low end. It is normal to filter the lamp, not the detector, so I am unsure if the blue-sensitive detector will work properly or have a narrow enough bandwidth.I don't suppose that there is much difference between filtering the lamp or filtering the detector. White light probably will not help in this respect, but there are blue leds that could be considered for future enhancements, if there is an issue, and if they are bright enough and of narrow enough bandwidth.
You also have to be careful about light bypassing the sample and reaching the detector and ambient light coming in from outside the box. Detector noise may be a issue too at low light levels, but that might be able to be reduced by multi-sample averaging, depending upon how the detector works.
It might be a good idea to make your sample holder capable of holding different sized cuvettes. Using different path lengths will increase your effective range and is less troublesome and less prone to error than dilution. Don't believe anybody who tells you that beer does not follow the Beer-Lambert law - it does. Do not concern yourself with the Morey colour equation; it is flawed.
Bloody good idea though!
I recall somebody like John Palmer on a podcast a couple of years ago, putting forward the idea that photographing beer with a digital camera, filtering out everything except blue in photoshop, should give a a good idea of colour. I don't think that he went very far with it.
For a long time I have been toying with the idea of making a simple photometer using a blue LED, some of which peak at 430nm, a photocell and a PIC microprocessor to do the crunching, but that never got much further than a bit of paper.
You said:
Actually you do not really need to do anything like that. As long as you can assure yourself that your detector is linear, and you have got your stray light under control (very important, your detector will not be linear if you have a significant stray light issue). Then you can calculate EBC directly thus.Next steps will be to obtain beers with known EBC (the Meantime London Stout used here is a known 50 EBC) to get a feel of how the unit reacts to different styles of beer. From there, a calibration curve can be prepared, which will allow direct estimation of the EBC of an unknown beer.
Colour = 10*(PLn/PLa)*LOG10(Li/Lo)
Where:
Li = light in (The count given through clear water, preferably 255 or 254 counts in your case)
Lo = light out. (The count given through a test sample)
PLa = actual path length in cm (the internal diameter of your tubes)
PLn = normalised path length in cm. (2.5 for EBC : 1.27 for SRM)
Pay attention to stray light. Not understanding stray light and detector noise was one of the schoolboy gaffs that George Fix made with his infamous Michelob colour / dilution measurements. Stray light is light reaching the detector that is not of the proper frequency, and this might be an issue without adequate filtering. It might give the false impression that beer does not follow the Beer-Lambert law and also restricts the practical dynamic range of the detector. It will probably be the reason for the apparent flattening of your curve at the low end. It is normal to filter the lamp, not the detector, so I am unsure if the blue-sensitive detector will work properly or have a narrow enough bandwidth.I don't suppose that there is much difference between filtering the lamp or filtering the detector. White light probably will not help in this respect, but there are blue leds that could be considered for future enhancements, if there is an issue, and if they are bright enough and of narrow enough bandwidth.
You also have to be careful about light bypassing the sample and reaching the detector and ambient light coming in from outside the box. Detector noise may be a issue too at low light levels, but that might be able to be reduced by multi-sample averaging, depending upon how the detector works.
It might be a good idea to make your sample holder capable of holding different sized cuvettes. Using different path lengths will increase your effective range and is less troublesome and less prone to error than dilution. Don't believe anybody who tells you that beer does not follow the Beer-Lambert law - it does. Do not concern yourself with the Morey colour equation; it is flawed.
Bloody good idea though!
Re: DIY Photometer for EBC measurement
There seems to be a problem on this thread... I can't find the "Buy it Now" button
Re: DIY Photometer for EBC measurement
Cripes! lots of replies...cheers! And a wealth of information from GW !
When I was thinking of a way to do this, I did start off along the "blue LED solar cell" route, based on what I read at this site and this site.
However, I'd have to order the LEDs and cells, so I just went with what I had available...a webcam and a torch. Thus, strictly speaking, this isn't really a photometer at all, as there is no light path. This is just a bulb in a box. This is more akin to the idea by JP you (GW) described.
Thus, unfortunately, I can't employ the typical absorbance formulae described. What I can do is see how the 'photometer' responds to known EBC beers, and compare an unknown beer to it....hopefully generating a ball-park EBC figure for that beer. I was certainly suprised to see the curve it generated!
I'm working night shifts at the moment, so I can't really do any further testing until the weekend. Bed now (8:50 am)
When I was thinking of a way to do this, I did start off along the "blue LED solar cell" route, based on what I read at this site and this site.
However, I'd have to order the LEDs and cells, so I just went with what I had available...a webcam and a torch. Thus, strictly speaking, this isn't really a photometer at all, as there is no light path. This is just a bulb in a box. This is more akin to the idea by JP you (GW) described.
Thus, unfortunately, I can't employ the typical absorbance formulae described. What I can do is see how the 'photometer' responds to known EBC beers, and compare an unknown beer to it....hopefully generating a ball-park EBC figure for that beer. I was certainly suprised to see the curve it generated!
I'm working night shifts at the moment, so I can't really do any further testing until the weekend. Bed now (8:50 am)
Re: DIY Photometer for EBC measurement
Hats off to you my man!
Any you just gave us all a great 'out'..................next time the Mrs calls me a beer geek............"oh no my dear! Have a gander at this guy!"
I wouldn't have known where to start. Fantastic
Any you just gave us all a great 'out'..................next time the Mrs calls me a beer geek............"oh no my dear! Have a gander at this guy!"
I wouldn't have known where to start. Fantastic
Re: DIY Photometer for EBC measurement
lol!
This is just the beginning.... I'm thinking of a new version (bigger & better) already.
This is just the beginning.... I'm thinking of a new version (bigger & better) already.
- Blackaddler
- Under the Table
- Posts: 1326
- Joined: Thu Jun 11, 2009 9:28 am
- Location: Addlestein, Surrey
Re: DIY Photometer for EBC measurement
Nice work.andybiochem wrote:What I can do is see how the 'photometer' responds to known EBC beers
It could be a problem finding "known" EBC beers, though. I have a feeling that most brewers just guesstimate a calculation based on the maltster's expected figures [which can also vary, somewhat].
Re: DIY Photometer for EBC measurement
Nice project - well done.
Right where's my soldering iron...............
Right where's my soldering iron...............
-
- CBA Prizewinner 2010
- Posts: 7874
- Joined: Sun Nov 30, 2008 9:06 pm
- Location: Keighley, West Yorkshire
- Contact:
Re: DIY Photometer for EBC measurement
I have an Old webcam somewhere!! ha ha
Clever stuff, I'm well impressed
Clever stuff, I'm well impressed