Let me first give credit where credit is due. My inspiration for this project comes from AlfonsVH with his "A simple DIY spectrophotometer". Having said that I have made some improvements to his design and I want to share what I have learned.

Why I built it:

This project was meant for one of my professors of instrumental analysis (chemistry required coursework). He had mentioned something about cutting back on the amount of chromatography labs and having the students build their own instrument to better understand how they work. I was really excited about that idea, and even though my class at the time wouldn't have been able to try it out, I wanted to show that it was possible. That way future students could have a template. Also so that my professor would be more inspired to test out different ideas for himself.

Step 1: The Specifications

Specifications / Limitations:

  • Visible spectrum (tungsten filament a.k.a an incandescent light bulb)
  • Minimum of 15 steps (using a servo motor)
  • Lens to focus spectrum
  • external 5V power supply for servo motor (AC adapter)
  • Separate 3V power supply for light source (batteries)
  • Protoshield for easy removal from arduino

Tools / materials needed:

  • An Arduino
  • Photoresistor
  • Resistors (10K x 2, 560)
  • LED
  • Button
  • Cuvette (a.k.a the sample holder)
  • Servo motor Razor blades (the slit)
  • Hot glue
  • light source (small flashlight with incandescent bulb)
  • Stuff to solder
  • Mini lens
  • CD (the diffraction grating)
  • Patience
  • Enclosure

When it's done it should be able to:

  • Compile a spectrum in a short amount of time
  • Give averaged values
  • Provide some characterstics of the compound being studied

Step 2: What's Important to Know

The attachment

I've written and attached a summery about building your own scientific instruments with Arduino if anyone is interested. It goes into a little more detail with the project and more. I want to keep this instructable as simple as possible because I could go much further in depth, so if you want more detail check out the attachment.

Lets keep it simple

What's important from the schematic:

  1. The order and location of the photoresistor and the 10K (circled in red)
  2. The external 5V power supply

Why it's important:

  1. The order of the resistor and photoresistor is important because the order defines the voltage divider equation. We want to measure transmittance*(see theory basics) so we need the numbers in the Arduino serial monitor to be proportional to the intensity of the light.
  2. The external 5V power supply is necessary to drive the motor because if the motor and the photoresistor are on the same 5V from the Arduino the signal will be really noisy. We avoid this by having an external 5V (Note: All grounds should still be tied together).

Theory basics

Transmittance is the light that makes it through the sample (measured)
Absorbance is just that, the light absorbed by the sample (calculated using A = 2 - log(%T)

For a more in depth explanation see attachment.

Step 3: Building It

I think the pictures say it all, and what they don't the schematic will. You can choose to lay it out slightly differently but it's all the same principle. The light from the incandescent bulb hits the CD (diffraction grating) hot-glued to the servo motor. As the motor moves the different wavelengths pass through the slit (two razor blades) and through the cuvette which holds the sample and then finally to the detector (in this case the photoresistor).

The protoshield was just a little added bonus, but the design could have easily worked the same with a bread board as long as the schematic is followed exactly.

Step 4: The Code

I'm not a coder but I know how to copy and paste. I modified a code that I got online see attachment.

Brief outline of what the code does

1. Waits for button press (assumes you turned light source on)

2. Indicator LED turns on (when button is pressed)

3. Motor takes 3 big steps then takes 5 measurement

4. Motor takes 15 small steps (repeating the measurement 5 times) Note: serial monitor must be visible!

5. Light shuts off and motor goes back to "home position"


After the data is in the serial monitor it needs to be uploaded into Microsoft excel. I find that copying and pasting it first into notepad works best. Then copy again from there and paste special into excel (it will go straight into columns). Then I recommend looking up a macro for excel that averages every five measurements (google it).

Note: for each sample there needs to be a blank. The sample data must be subtracted from the blank data and then you can use A = 2 - log(%T). Make sure you understand the x-axis so that you know whether the wavelengths are going from high to low (or vice versa).

Step 5: Results

The above spectrum is an extraction of chlorophyll a, b, and carotenoids from spinach leaves. Next to it I have the actual spectrum and they surprisingly match up quite well!

Step 6: Messing Around

I also did spectra of dilute wine and bourbon. I think it would be fun if I took a bunch of spectra of different wines and whiskys and then logged the taste data next to the spectra to see if I could place what tannin went with what wavelength.

Maybe in a future experiment!

Step 7: Closing Thoughts

Improvements from AlfonsVH's design:

  • Using the Arduino to do analog readings (using a separate 5V source for motor as necessary)
  • Using a lens to focus the light into a more concise wavelengths
  • Having a somewhat portable enclosure
  • Time it takes to run a spectra is less than a minute
  • Using a protoshield for easy removal from Arduino

Improvements from my design

  • It is definitely obvious that a different type of motor could be used to get more wavelengths (the downside is of course the amount of time will greatly increase)
  • A laser and a standard could be used to calibrate which steps correspond to which wavelengths
  • Maybe varying the slit width
  • possibly taking fluorescence measurements (after some alterations)
  • A sexier enclosure

P.S. if you guys want me to do spectra of anything cool (chemical sample in solution) post a comment and I just may update the instructable!

<p>Hi thanks for the project its really cool . I have a question can we use this spectrophotometer to study water quality for presence of ammonia , ph , dissolved oxygen etc ? </p><p>thanks </p>
For this specific instrument: only methods using the visible spectrum will work. That means if you are trying to build a similar instrument to say detect ammonia then you should search for a methodology for doing this in the visible spectrum. Now if you are only ever going to use the instrument for one (or a few) types of molecules then you might simplify the design by finding wavelengths where these molecules have a high peak in the visible spectrum and use specific LEDs that only have most of their intensity around those wavelengths (also they make LEDs in many wavelengths, so you are not restricted to visible). If you use this latter method then you can omit the diffraction grating (CD), light bulb, and motor. I'm not sure if ammonia or oxygen exhibit wavelengths in the visible (definitely check their IR and also what IR LEDs are available) but maybe you can find a paper where these molecules complex with a chemical to make a wavelength which can be detected by the instrument. Or who knows maybe you will find a better method. If you're trying to do quantitative analysis you need to take into consideration the limit of detection of your instrument (depending on how accurate you actually want to be). Finally, with pH you're better off buying a pH meter or making your own using arduino. If your knowledge of chemistry isn't very good I'd be happy to clear up anything I can, but your question is very broad so I can't really give you a yes or no.
<p>nice instructible, i've been looking forward to making this myself, but kept putting it off due to the lack of hotglue and a light source. I just recieved various 3W LEDs, including 4000k white leds (Because this color temperature has the best spectrum distribution). I was wondering whether you attempted to use a white LED as a light source. Indeed, the spectrum is not continuous (especially not in the green region), but this is why you take blank measurements anyway. The downside is that it will probably be less sensitive in the green area of the spectrum.</p><p>Also why didnt you use a servo motor? I think it might allow for a higher wavelength selectivity. Also using a DVD, compared to a CD would increase both wavelength resolution and spectral selectivity.</p><p>As addition for your spectra, i think a blackberry extract would be nice to see. (anthocyanin absorbance peak around 540nm, depending on sample preparation (pH, temperature, solvent)).</p>
Very interesting questions and points, thank you.<br><br>For one you are absolutely right about the blank! And with white LEDs it won't be as intense in bluish purplish region (scientific words I know) but like your statement implied: having a blank will subtract out the intensity anyway so as long as it's not too weak of an intensity it should theoretically work fine. In fact you brought up a very good point because tungsten isn't perfect either. It's just that it's so intense throughout the visible that it's a good choice. This topic specifically is one of the things I learned by building this instrument.<br><br>Moving on, I did use a servo, did you mean to say stepper? One improvement if you are still going to use a stepper is to have the spectrum closer to the slit that way each step results in a smaller overall movement and hence gives you more wavelengths.<br><br>And yeah changing up the diffraction grating to a DVD might be an option. Also going even further, one may be able to change the magnetic 1's and 0's on the DVD in a way that's benificial to the grating.<br><br>Anyway as for your LEDs I say go for it. You don't need to build anything at all to test out the optics. I recommend doing that first before building anything anyway. Then maybe if you're satisfied you will have the motivation.<br><br>I'll see about trying blackberry extract soon. If I do I will mention you in the section!
<p>Interesting. I think you'd write something about the source lamp which must have the highest CRI possible (100), not all tungsten lamps have the same CRI (color rendering index). Did you make the measures with only the lamp ? You should obtain a straight line, no ? </p><p>Anyway, very interesting. </p>
I did indeed do a measurement with just the lamp. It was not a straight line. To my knowledge, it's not supposed to be because the tungsten filament varies with intensity across its wavelengths (unless I'm misinterpreting your question). This isn't a problem though because having a blank will set a reference point for each sample. Then the blank will be subtracted from the sample so that the intensity of the filament at the different wavelengths doesn't make it's way into the measurement. You make a good point though, for example had I used a &quot;white&quot; LED the intensity at certain wavelengths might have been too low for a measurement.
<p>hai</p><p>** black body radiation // Wien displacment law - in Wiki .</p><p>** as it gets &quot;hoter&quot; - overdeive the lamp - goes to Infa red as experience , but more to UV as well</p><p>** correct re &quot;white&quot; LED </p><p>** few years back started to make own - but other &quot;projects&quot; captured the time </p><p>** the glass lens will stop uv and IR - whilst sample &quot;tube&quot; made of from silicon dioxide that pases those frequencies </p><p>** you learnt more by eve attempting to build an instrument than simply class lessons and set experiements - your instructor probably did as well </p>
<p>Hi nice - there are a couple of other versions as well - here are the two I made a while back - they have details for transfer of the data direct to Excel - save you copy and pasting </p><p>Single Beam <a href="https://www.instructables.com/id/Light-Spectrometer-from-a-head-inspection-lamp/" style="">https://www.instructables.com/id/Light-Spectrometer...</a></p><p>Dual Beam <a href="https://www.instructables.com/id/Linkit-One-Dual-beam-spectrometer/">https://www.instructables.com/id/Linkit-One-Dual-be...</a></p>
Cool thanks I'll look into it.

About This Instructable




More by satchelfrost:Wahfoekeep Handcrafted Magnetic-Top Storage Box Student Spectrophotometer 
Add instructable to: