DIY Photometer for EBC measurement

The forum for discussing all kinds of brewing paraphernalia.
andybiochem

DIY Photometer for EBC measurement

Post by andybiochem » Mon Jun 13, 2011 3:12 pm

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! :shock:

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
Image


2) Take lens & board out of webcam
Image


3) Gather other components for light box.
Image


4) Assemble light source. This is an LED from a torch, with a switch.
Image


5) Cram everything into the box
Image


6) Aaaand we're done
Image


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).
Image


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%.
Image


9) Loading a sample into the photometer
Image


10) Here are the readings from the software. Quite a nice curve, not quite logarithmic, but at least there are no anomolies.
Image


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.
Image



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!

User avatar
gregorach
Under the Table
Posts: 1912
Joined: Wed Jun 08, 2011 10:07 am
Location: Edinburgh
Contact:

Re: DIY Photometer for EBC measurement

Post by gregorach » Mon Jun 13, 2011 3:16 pm

Sweet! :)
Cheers

Dunc

Shadowknight
Piss Artist
Posts: 291
Joined: Sun Oct 24, 2010 11:16 am
Location: Plymouth, Devon.

Re: DIY Photometer for EBC measurement

Post by Shadowknight » Mon Jun 13, 2011 3:48 pm

That is impressive, well done.
Needs more Cowbell.

kane

Re: DIY Photometer for EBC measurement

Post by kane » Mon Jun 13, 2011 4:09 pm

Excellent job!
I love seeing little projects like this.

Dr. Dextrin

Re: DIY Photometer for EBC measurement

Post by Dr. Dextrin » Mon Jun 13, 2011 8:12 pm

Excellent stuff. =D>

Greenbeast

Re: DIY Photometer for EBC measurement

Post by Greenbeast » Mon Jun 13, 2011 9:14 pm

geek-tastic!

unclepumble

Re: DIY Photometer for EBC measurement

Post by unclepumble » Mon Jun 13, 2011 9:35 pm

Now this is taking home brewing a little too seriously.

I like it =P~ =P~ :D =D>

Graham

Re: DIY Photometer for EBC measurement

Post by Graham » Mon Jun 13, 2011 11:59 pm

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:
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.
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.

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!

Shippo

Re: DIY Photometer for EBC measurement

Post by Shippo » Tue Jun 14, 2011 7:33 am

There seems to be a problem on this thread... I can't find the "Buy it Now" button :lol: :lol:

andybiochem

Re: DIY Photometer for EBC measurement

Post by andybiochem » Tue Jun 14, 2011 9:04 am

Cripes! lots of replies...cheers! And a wealth of information from GW :D !

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) :lol:

leedsbrew

Re: DIY Photometer for EBC measurement

Post by leedsbrew » Tue Jun 14, 2011 9:09 am

=D> =D> =D> =D> =D> =D> Hats off to you my man! :D

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!" :D :D :D :D

I wouldn't have known where to start. Fantastic :D

andybiochem

Re: DIY Photometer for EBC measurement

Post by andybiochem » Tue Jun 14, 2011 9:32 am

lol!

This is just the beginning.... I'm thinking of a new version (bigger & better) already. :lol:

User avatar
Blackaddler
Under the Table
Posts: 1326
Joined: Thu Jun 11, 2009 9:28 am
Location: Addlestein, Surrey

Re: DIY Photometer for EBC measurement

Post by Blackaddler » Tue Jun 14, 2011 11:25 am

andybiochem wrote:What I can do is see how the 'photometer' responds to known EBC beers
Nice work.

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].
Image

simco999

Re: DIY Photometer for EBC measurement

Post by simco999 » Tue Jun 14, 2011 4:47 pm

Nice project - well done.

Right where's my soldering iron...............

WishboneBrewery
CBA Prizewinner 2010
Posts: 7874
Joined: Sun Nov 30, 2008 9:06 pm
Location: Keighley, West Yorkshire
Contact:

Re: DIY Photometer for EBC measurement

Post by WishboneBrewery » Tue Jun 14, 2011 6:02 pm

I have an Old webcam somewhere!! ha ha

Clever stuff, I'm well impressed :)

Post Reply