disc1
-RT * ln(k)
Ever wonder how your Hanna meter works?
With the weekend off and stuck at home with nothing better to do, I decided to do a little weekend project. The challenge was to build a working spectrophotometer out of parts I had on hand. It will never have the power, resolution, or ability of a commercial spec, but it's neat to see how one works. I will consider it a success if it can tell red from green at the end.
I started with a concave mirror and a diffraction grating that were among some parts that I had collected over the years fixing HPLC detectors. I also have a 256 pixel photodiode array that I bought for sensing the position of a laser and never finished the project. Of course I have my handy Arduino board to handle all of the data. I need a tungsten lamp so I get a good visible spectrum. The best I have is a little 15W flashlight bulb. I wish I had something brighter, but we'll make it work.
To begin, I used the fan light from a laser level to find the focal point of my mirror. If the laser is more than 2 times the focal length from the mirror, then the line will converge to a single spot at the focal point. Then I put the lamp in a shoebox (which ended up being my case, but that wasn't the plan then) and cut a little slit in it with a razor blade. That way I got a little beam of light that I could play with to find the geometry of the mirror and grating.
The grating works like this. It reflects one image just like a mirror would, and a second image at an angle to that one that is split up into a rainbow of colors. There is a direction marked with an arrow on the grating and labeled "blaze". That is the direction of the best rainbow.
Eventually I realized I needed a better slit. The one I cut in the cardboard was too wide and too jagged. So the next mission was to build a little cardboard separator from the top of another box and mount my light to it. Then, I cut a hole in front of the lamp and used two razor blades to make a slit. It took some time and patience to get them just right, but eventually I superglued them down into something that looked to me like it would work.
Then I put white paper around inside my shoebox and started playing with focusing my rainbow.
Two razor blades superglued to the cardboard edge to edge to form the slit.
The grating is mounted on top of a cuvette. It falls over all the time. Alignment is key and I wish I had secured it better.
I worked with several conventional monochromator designs, but nothing seemed to work with the mirror I had. I eventually settled on an unorthodox solution where the slit is at a distance greater than the focal length of the mirror. The mirror is essentially focusing the image of the slit off the grating and onto the PDA. It's a little complex to explain, but surprisingly easy to set up. In all honesty I can make a much more in focus rainbow but it is way too large to fit on the PDA and I don't have the optics to make it smaller. So for this test, we're just going to have a sort of focused rainbow.
With the rainbow in the spot where I wanted, I needed to set up the detector. The PDA I used came from Mouser. It's a TSL1402R. Here's a link to it on Mouser. There is a link to the data-sheet there.
http://www.mouser.com/ProductDetail/TAOS/TSL1402R/?qs=sKasJQfA%2bi5t6//qMqmpuA==
There are two ways that a spectrophotometer can work. I've actually combined the two. The diffracted light (the rainbow) can be focused on another slit so that only one wavelength (color) can pass through. Then a photodiode behind the slit detects how bright that color is.
The second method has the rainbow focused on a photodiode array (PDA). The one I used has 256 photodiodes (pixels). By focusing the diffracted light rainbow on the line of sensors, each one detects a different wavelength. When you read it out, the PDA gives you a series of analog voltages that are proportional to the amount of light falling on each sensor.
I'll spare you the details of building it out. Read the data-sheet if you want to know how to set it up. Here's a picture of the circuit.
The chip beside it is an LM358 dual op-amp. When I first set up the PDA and got the rainbow focused on it, it only gave me about 0.3V out of 5.0V. The dark signal is 0.1V. So I put the op-amp next to it. One side gets a voltage from a 10K pot to generate an offset to take away the dark signal. The other side is a difference amplifier that kicks the signal up about 10X.
Here's a pic of it set up to read the rainbow. The testing process was long and drawn out. All the lights had to be turned off including the computer monitor to keep from interfering with the signal. And with nothing locked down, everything had to be continuously re-aligned to get the rainbow on the PDA.
Notice the flash reflecting off the back of the diffraction grating.
The second little black breadboard back there is a second stage amplifier to boost the signal up to something suitable for the Arduino and buffer it. Using this setup, I get a signal of around 3.7V for a saturated detector and very near zero for a dark detector. With the lights off and the rainbow focused on the detector I get between 2V and 3V on each pixel. That's enough to begin with.
I started carefully turning out all the lights and taking readings, but it wasn't working out the way I planned. It seems too much stray light from the slit was getting to the detector despite my best efforts to shield it. I guess with all that amplification I should have expected as much.
So I had to build a little house for the grating and the PDA. This was actually the hardest part of the project. I cut pieces of black posterboard to fit and then pieced them together in place. Anytime anything got bumped or moved, the whole thing had to be re-aligned so that the rainbow fell on the detector. Once it's put together, you can't see the PDA, so each time it had to be taken apart and rebuilt. It was a huge PITA.
There's a little opening in the front for the light from the mirror to come in through. Notice the slit behind it has black paper around it now too.
Once I had the little house built and darkness on the PDA, I spent a little time tuning the amplifiers to give me a decent voltage range. Then I mixed up my first test samples. This is where the rubber meets the road.
The test samples are made with a drop of green or red food coloring in about 20mL or so of water. I filled a cuvette with each one and placed them one at a time in front of the slit and took a reading.
Holy Mackerel the thing WORKS. It doesn't respond well to blue (read the data sheet to find out why) so the voltages are always higher on the red end. The focus is very rough, so there's no wavelength data here. Just look at the trend.
Not bad for something built in a shoebox and aligned by hand.
The black line is clear water. The green line is a solution of green food coloring and the red line is a solution of red food coloring. Notice that for the green solution, the red end goes down and vice versa. The red solution was a little too dark and shifted the whole thing down, but you can see the difference at the end. The green solution is beautiful data. Notice it comes back up to match the white signal at the end.
You can see I have one dead pixel.
These data are surprisingly reproducible. I took 10 or 12 measurements for each and they were pretty much all identical. So I think I have my little definition of being able to tell red from green.
This thing actually works a lot better than I expected. There is a ton of room for improvement. If I put the PDA on a piece of perf board I could position it better. I could also lock the PDA and the grating together so they stay in alignment. There are so many ways to improve this thing I can't list them all.
If I end up working on it any more, I will keep you posted. This was really just a personal challenge for a weekend project, not intended to be useful for anything. But who knows, if I took some time to play with it, maybe it could read nitrate tests or something.
Let me know what you think. Questions?
With the weekend off and stuck at home with nothing better to do, I decided to do a little weekend project. The challenge was to build a working spectrophotometer out of parts I had on hand. It will never have the power, resolution, or ability of a commercial spec, but it's neat to see how one works. I will consider it a success if it can tell red from green at the end.
I started with a concave mirror and a diffraction grating that were among some parts that I had collected over the years fixing HPLC detectors. I also have a 256 pixel photodiode array that I bought for sensing the position of a laser and never finished the project. Of course I have my handy Arduino board to handle all of the data. I need a tungsten lamp so I get a good visible spectrum. The best I have is a little 15W flashlight bulb. I wish I had something brighter, but we'll make it work.
To begin, I used the fan light from a laser level to find the focal point of my mirror. If the laser is more than 2 times the focal length from the mirror, then the line will converge to a single spot at the focal point. Then I put the lamp in a shoebox (which ended up being my case, but that wasn't the plan then) and cut a little slit in it with a razor blade. That way I got a little beam of light that I could play with to find the geometry of the mirror and grating.
The grating works like this. It reflects one image just like a mirror would, and a second image at an angle to that one that is split up into a rainbow of colors. There is a direction marked with an arrow on the grating and labeled "blaze". That is the direction of the best rainbow.
Eventually I realized I needed a better slit. The one I cut in the cardboard was too wide and too jagged. So the next mission was to build a little cardboard separator from the top of another box and mount my light to it. Then, I cut a hole in front of the lamp and used two razor blades to make a slit. It took some time and patience to get them just right, but eventually I superglued them down into something that looked to me like it would work.
Then I put white paper around inside my shoebox and started playing with focusing my rainbow.
Two razor blades superglued to the cardboard edge to edge to form the slit.
The grating is mounted on top of a cuvette. It falls over all the time. Alignment is key and I wish I had secured it better.
I worked with several conventional monochromator designs, but nothing seemed to work with the mirror I had. I eventually settled on an unorthodox solution where the slit is at a distance greater than the focal length of the mirror. The mirror is essentially focusing the image of the slit off the grating and onto the PDA. It's a little complex to explain, but surprisingly easy to set up. In all honesty I can make a much more in focus rainbow but it is way too large to fit on the PDA and I don't have the optics to make it smaller. So for this test, we're just going to have a sort of focused rainbow.
With the rainbow in the spot where I wanted, I needed to set up the detector. The PDA I used came from Mouser. It's a TSL1402R. Here's a link to it on Mouser. There is a link to the data-sheet there.
http://www.mouser.com/ProductDetail/TAOS/TSL1402R/?qs=sKasJQfA%2bi5t6//qMqmpuA==
There are two ways that a spectrophotometer can work. I've actually combined the two. The diffracted light (the rainbow) can be focused on another slit so that only one wavelength (color) can pass through. Then a photodiode behind the slit detects how bright that color is.
The second method has the rainbow focused on a photodiode array (PDA). The one I used has 256 photodiodes (pixels). By focusing the diffracted light rainbow on the line of sensors, each one detects a different wavelength. When you read it out, the PDA gives you a series of analog voltages that are proportional to the amount of light falling on each sensor.
I'll spare you the details of building it out. Read the data-sheet if you want to know how to set it up. Here's a picture of the circuit.
The chip beside it is an LM358 dual op-amp. When I first set up the PDA and got the rainbow focused on it, it only gave me about 0.3V out of 5.0V. The dark signal is 0.1V. So I put the op-amp next to it. One side gets a voltage from a 10K pot to generate an offset to take away the dark signal. The other side is a difference amplifier that kicks the signal up about 10X.
Here's a pic of it set up to read the rainbow. The testing process was long and drawn out. All the lights had to be turned off including the computer monitor to keep from interfering with the signal. And with nothing locked down, everything had to be continuously re-aligned to get the rainbow on the PDA.
Notice the flash reflecting off the back of the diffraction grating.
The second little black breadboard back there is a second stage amplifier to boost the signal up to something suitable for the Arduino and buffer it. Using this setup, I get a signal of around 3.7V for a saturated detector and very near zero for a dark detector. With the lights off and the rainbow focused on the detector I get between 2V and 3V on each pixel. That's enough to begin with.
I started carefully turning out all the lights and taking readings, but it wasn't working out the way I planned. It seems too much stray light from the slit was getting to the detector despite my best efforts to shield it. I guess with all that amplification I should have expected as much.
So I had to build a little house for the grating and the PDA. This was actually the hardest part of the project. I cut pieces of black posterboard to fit and then pieced them together in place. Anytime anything got bumped or moved, the whole thing had to be re-aligned so that the rainbow fell on the detector. Once it's put together, you can't see the PDA, so each time it had to be taken apart and rebuilt. It was a huge PITA.
There's a little opening in the front for the light from the mirror to come in through. Notice the slit behind it has black paper around it now too.
Once I had the little house built and darkness on the PDA, I spent a little time tuning the amplifiers to give me a decent voltage range. Then I mixed up my first test samples. This is where the rubber meets the road.
The test samples are made with a drop of green or red food coloring in about 20mL or so of water. I filled a cuvette with each one and placed them one at a time in front of the slit and took a reading.
Holy Mackerel the thing WORKS. It doesn't respond well to blue (read the data sheet to find out why) so the voltages are always higher on the red end. The focus is very rough, so there's no wavelength data here. Just look at the trend.
Not bad for something built in a shoebox and aligned by hand.
The black line is clear water. The green line is a solution of green food coloring and the red line is a solution of red food coloring. Notice that for the green solution, the red end goes down and vice versa. The red solution was a little too dark and shifted the whole thing down, but you can see the difference at the end. The green solution is beautiful data. Notice it comes back up to match the white signal at the end.
You can see I have one dead pixel.
These data are surprisingly reproducible. I took 10 or 12 measurements for each and they were pretty much all identical. So I think I have my little definition of being able to tell red from green.
This thing actually works a lot better than I expected. There is a ton of room for improvement. If I put the PDA on a piece of perf board I could position it better. I could also lock the PDA and the grating together so they stay in alignment. There are so many ways to improve this thing I can't list them all.
If I end up working on it any more, I will keep you posted. This was really just a personal challenge for a weekend project, not intended to be useful for anything. But who knows, if I took some time to play with it, maybe it could read nitrate tests or something.
Let me know what you think. Questions?
Last edited: