Introduction: Light Spectrometer From a "battery Powered" Head Inspection Lamp
Hello if you like this please take the time to vote in the competitions
At the end of my light sensing instructable where I played with the measurement of reducing sun light levels as well as making it into a laser game , I mentioned that I wanted to have a go at making a full spectrometer. This instructable is a step closer.
In the instructable I said I wanted to add a diode array, unfortunately I have not been able to get hold of one, so this will be a scanning spectrometer.
Diode array spectrometers
These work generally by having no moving parts. The light passes through the sample and is split into its separate spectral components using a prism or similar device. The separate wavelengths then fall onto the detector where each absorbance value is measured at the same time.
These work slightly differently in that the light is first split by the prism, it the passes through a narrow slit which helps to reduce the number of wavelengths of light that can fall on the sensor after it has passed through the sample.
In this type of system there is a single detector that has to measure each value in turn and because of this the light splitting device has to rotate to direct the sequence of wavelengths onto the sample and so onto the detector.
The spectrometer in this guide will use a diffraction grating a hologram printed onto a price of glass, I got this from work (a spare from a service visit).
If you don't have access to a gratting, you can make one by cutting a piece of a DVD.
HOW Usefull is this instrument
The usefullness of this instrument is limited only by your imagination examples are as follows:
- Analysis of the light spectrum (measuring the amount and colour of available light
- Measurement of spectral reflectance transmitance and absorbance of materials
- Food colourants analysis
- Environmental analysis - pollution in water - its inexpensive and connect to a laptop and not a big issue if it gets field damaged
- Training tool (educational) A great way to get your children into progamming and developing imaginative solutions.
The above and many more would of course all require calibration of the equipment
Step 1: Parts List and Software
|Ten||Light Emitting Diodes|
|One||Light Dependent Resistor 10 K Ohm up to approximately 130 K Ohm|
Batteries : The light source uses 'AAA' x 2 for the LED's you can also make the unit portable by powering the Arduino using a 9 volt battery and of course if you do go portable you will need a battery in the laptop you use to collect your data
The light source for the spectrometer is a battery powered head inspection lamp - I got a cheap one to canablise from the pound shop
The Arduino is an UNO, the LED's are low values and the Pot is one I had laying around.
The LDR is one salvaged from my Cybot which was modified in a previous guide see
I found a good site for calculating the values for resistors - see the first picture on this guide, the link to which is just below here. I used 33 ohm resistors - these where considerably smaller than my first attempt using some a rescued from an old alarm system - they where way too big leaving me wondering why nothing worked when I switched the "finished thing on"?.
There are two bits of software and one add on required for this project to work:
The Arduino IDE is free to download from the following location and comes as either an install of zip file - I like the Zip (easier to use and and be run from a flash drive for portability)
MICROSOFT EXCEL - unfortunately not free - I have office 2013 on a windows 7 computer
Finally the most important bit is the add on - this is for Excel and comes from a site called PRALAX
The file you want is PLX-DAQ and runs as a macro from inside Excel. This is a great little file as it can be used to monitor any serial port and gather the resultant data sent through it. All that is required is some specific lines of code in the Arduino sketch to tell it the send data to specific cells in Excel.
You also need to specify the port speed and ensure that the Arduino is set to the same speed - initially I tried 9600, but although this worked for the test spreadsheet that only sent text to excel from the Arduino, I needed to set it to 128000 for the final project as I would be monitoring the response times for the LED's dependent upon the resistance of the LDR at any given time.
Step 2: Why Black
Spectrometers work by taking measurements of light, either the transmittance or the absorbance. So allowing any additional light into the sensor while in use would adversely affect the results.
Painting everything black helps to eliminate reflection and reduce light
Step 3: Sample Holder
The sample holder is just that. When you are performing an analysis your sample solution is held in what is called a Cuvet, a glass container that is as optically pure as possible. This Cuvet is placed in the instrument in a holder that is in the path of the light coming from the diffraction grating.
For this instructable I have made one on the lathe. I started by turning one end which would later be held in the jaws on the lathe church, this would ensure that it was centered. Once flipped I drilled a hole in the end that would hold the Cuvet - see the third picture and went on to drill two holes one opposite the other at the square end of the piece. This would be the path through the sample for the light reaching the sensor.
As I wanted as much light to reach the sensor as possible I made one of the holes slightly larger. I tidied the piece up and cut a tenon just below where the bottom of the Cuvet sat in the central hole and parted it off once it had been rounded and smoothed.
None of the prices for this project need polish as they will all be painted black.
Once the paint was dry,inside and out I used a hot melt glue gun to secure the LDR sensor in place, this in turn was also painted as the glue itself is slight translucent. I had put a hole into the piece of MDF intended for the base and held the sample holder in place using a wooden washer and screw which would allow me to rotate the sample holder to improve alignment with the light beam.
Step 4: Slits
Once the light is split by the diffraction grating there is a need to limit the portion of the spectrum from hitting the sample at the same time. To do this you use a device called a slit and as it sounds this is just a very thing parallel gap in front of the sample holder.
For mine I hot glued two Stanley knife blades over an opening in a small panel that would be glued in front of the sample holder along with another piece to form a small "dark room" around the sample. This too was painted black.
Step 5: Defraction Gratting
The diffraction grating was mounted onto an R.C. servo and hot glued in front of the slit at a slight angle. The exact angle is not important as the software used later will control the direction of the grating.
You will see on the pictures that it cut a hole to take the servo, in the end the was not needed as I needed to lift the servo up so that the grating was in front of the slit and not below it. The hole was filled with hot met glue which also held the servo solid.
Step 6: Light Source
For the light source I started using a household torch, but found that the incandescent bulbs produced a very diffuse spectrum (pattern of split colour) once the light left the grating. So a quick visit to the local pound shop and I had one of those battery powered led lights that you strap to your head. It takes three AAA batteries.
To hold it again I turned to the lathe to make a hollow tube and support, which would be kept in place by another tenon through the base.
I had only intended to take one of the led lights from the torch, but when I took it apart found that just about the whole cluster fit into the tube and would only require a little shielding for the stray light
With all the parts made, or in place I used the hot melt glue to fix the sides in place and completed the box by painting it black.
Step 7: Making a Light Shield
Once I started collecting data(see the end of the guide) I decided the spectrometer needed additional light shielding.
Enter my wife's hobby - card making - I borrowed her scoring board to make creases in the cardboard used for the shield.
I have not included a template for this as its shape and size will depend upon your device dimensions. just to say that I used double sided sticking tape to hold the joints together and when I came to cutting the hole for the Cuvet I put the cover in place then pressed on the top to make an indentation for the hole I needed to make then a craft knife was used to make the cut.
Just a word of caution make sure you line up the slit carefully or you will block the source.
Step 8: Wiring Up the Arduino
Please see the images for the wire diagrams
You will note that I have given two options one includes a battery, a better way to power the system than relying on the USB power from a computer, although you will still need to attach the USB cable as it is needed to collect the live data as you carry out experiments.
Step 9: Arduino Code
The Parallax install file creates a couple of example spreadsheets which are really all you need on the Excel side. Once installed all you need do is open the example file and accept the use of macros- at which point the PLX DAQ control will open. Set it up as per the previous image in step 1 making sure that you select your com port and not the one I have used (unless yours happened to be COM 3 as well)
The attached code has been written to allow the Arduino to read the potential difference between. The potential value is firstly calibrated using the Potentiometer.
The calibration is done by completely covering the LDR so that its resistance drops to as close to nothing as possible (this makes the LEDS change very quickly) then you adjust the POT until the cycling light change from the LEDs is visible.
The more you adjust the POT the great you can make the time changes registered at Excel, but be careful not to go too far or you will not see data at the other end of the scale (i.e. when you expose the LDR to light again)
Step 10: Collecting the Data
I have tested the system a number of times (see the charts) the tests where performed on the following
- Air with no obstruction
- Through a cuvet
- Through yellow dye
- Through red dye
- Through green dye
- Through green dye, but adjusting the degrees of rotation to one per step
The additional chart is an enlargement of the red chart due to the scale of the data points.
You will note on the charts that there is a definite difference between the different sample types, you need to look at differences between the samples and the air blank, and then camp are thinks like missing steps in the charts or the ratios between the steps.
Look at the yellow dye chart as well as the enlarged red chart.
Also if you take a look at the Green dye chart where I reduced the angle of rotation per step to 1 degree, then you will see that its possible to get a lot more data as the number of steps increases quite a lot. Unfortunately with my current servo I was unable to go lower than 1 degree. I did try but the servo just sat there not moving, so at present until I get a small enough stepper motor my limit is 1 degree of rotation per step.
If you take a look at the three plotted charts at the end, of the green dye at 1 degree rotation/step you will see that for the most part they are quite uniform, except near to the end this was during the readings for the darker blue light from the diffraction grating - you can clearly see a step change (the last chart shows this the best).
Step 11: Improvments
This is a good basic spectrometer, however everything can be improved on and for this instructable I think this would be in the addition of adjustable slits to enable better discrimination between wavelengths, as well as some means of focusing the light from the LED's more accurately onto the gratting.
Thanks for looking and please don't forget to vote if you liked or found this interesting.