You are on page 1of 12

instructables

Science With Rainbows! - Spectrophotometry

by Daniel Hingston

Rainbows, natural phenomena that produce beautiful In this Instructable, we're going to make a basic
spectrums of coloured light in the sky, inspire myth Arduino-powered spectrophotometer, using a little
and legend and art and give happiness to millions of prism to create and use our own rainbow. We'll make a
people. Just as natural rainbows are created by how lot of use of 3D printing, and also learn about lots of
sunlight plays through water droplets in the other things along the way.
atmosphere, we can arti cially create our own
rainbows using prisms. There are many scienti c The project video gives a short overview of the
applications of rainbows, and one is project, but please read on through the Instructable
'Spectrophotometry'! for full instructions too!

A spectrophotometer is a scienti c instrument used to


measure how di erent wavelengths of light (the
di erent colours of light seen in the rainbow are
ht t ps://www.yout ube.com/embed/vP9oaMI_R7s
di erent wavelengths) are absorbed by a sample. This
analysis can tell us all sorts of things, and these
instruments ( rst made in the 1940s) have played a
huge role in modern science, especially biochemistry.

Step 1: What You Will Need

These are the components I used to build my prototype. Please read onto the next step to read a more full
explanation of how a spectrophotometer works, and how we can make our own at home!

M a in Co m po ne nt s
Science With Rainbows! - Spectrophotometry: Page 1
Triangular prism (30mm each side)
Arduino Uno
LDR (light dependent resistor)
16-Bit LED pixel ring
9g Servo
Mini Test Tubes
DC-DC boost converter 5V-9V
USB cable (one end cut o , and the power lines soldered to the boost converter)
Wall plug that can supply 5V DC 0.5A
USB cable to connect Arduino to PC

M ino r Co m po ne nt s

Ball bearings
Toggle switch
Momentary push button
E10 lament light bulb
Bulb holder
10k ohm potentiometer (or larger)

Co ns um a ble s

Heatshrink
Header pins
Hookup wire
Solder
Electrical insulative tape
3D printing lament

Suppo rt ing

Windows PC
3D printer (my print bed is 210x210mm)

S o f t w a re

Arduino IDE
CAD Software if you want to modify the les and view the assembly

Science With Rainbows! - Spectrophotometry: Page 2


Step 2: The Rainbow and Science

Science With Rainbows! - Spectrophotometry: Page 3


Ho w do e s a Spe ct ro pho t o m e t e r w o rk? The images above show me experimenting with the
Fundamentally, a spectrophotometer measures the angles needed between the prism and the light
transmission properties of a substance with respect to source to create a spectrum of the right size and in
wavelength. So what does this mean? Di erent the right place, within the planned dimensions of the
colours of light (the colours of the rainbow that you housing.
can see) have di erent 'wavelengths', it is this that
makes them appear to be di erent colours to our Side no t e : He rs che l' s Inf ra re d Expe rim e nt
eyes. We know that di erent materials and chemicals Infrared is the component of the electromagnetic
absorb and transmit di erent wavelengths di erently spectrum that lies just beyond the red end of our
to each other - we see a green leaf appearing green visible light spectrum. Invisible to the human eye,
because the green part of the spectrum is the main infrared light plays a huge part in our lives - over half
part that the leaf does not absorb, and hence it is of the energy from our Sun arrives on Earth as
passed onwards to our eyes. A spectrophotometer infrared light, which warms us and helps give our
creates a light spectrum, and then selectively passes a planet the conditions we need. William Herschel, the
portion of that spectrum (e.g. just red light) through great German/British astronomer of the 18th century,
the sample, and then measures the light intensity was the rst to notice the existence of infrared, and he
recorded. Doing this in turn for each band of did this by just using a simple prism, like the kind
wavelengths (or each colour) of light within the visible you'll have bought to work on this Instructable. If you
light spectrum allows you to measure how this like, you can try replicating this before using your
substance absorbs each portion of the spectrum, prism for the spectrophotometer.
from this data you can plot an absorption chart. This
analysis can tell you a lot about a substance or Herschel pointed a beam of strong sunlight into a
chemical reaction, and it is why it is such a useful darkened room, and angled his prism it so a beautiful
scienti c tool! When researching this, I read that one rainbow shined out from it. He then took a
Nobel prizewinner for Chemistry said that the thermometer, and noticed that when holding it in the
spectrophotometer is "probably the most important dark region beyond the red part of the spectrum,
instrument ever developed towards the advancement there was a noticeable increase in temperature,
of bioscience." I have to admit, I don't really need a although there was no visible light there at all! He
spectrophotometer at home, but I thought that it wasn't looking for it, but with this simple observation
would be a really interesting project to try and he'd just discovered a whole previously unknown type
replicate one using basic components and Arduino. So of light!
here goes!

Science With Rainbows! - Spectrophotometry: Page 4


Step 3: Richard of York Gave Battle in Vain

This little mnemonic is how I was taught to remember the colours of the rainbow in order 'Richard - Red, Of -
Orange, York - Yellow, Gave - Green, Battle - Blue, In - Indigo, Vain - Violet' and references a tiny snippet of English
history - referring to the defeat of the Richard, Duke of York, claimaint to the throne, at the Battle of Wake eld in
1460, in the early years of the Wars of the Roses. I nd little historical references like this really satisfying to know, so
I thought I'd share this one with you.

O ur Spe ct ro pho t o m e t e r De s ig n
Let's now have a look at our design, and discuss the main components.

The Prism - we shall use a simple triangular prism to generate our spectrum. The prism assembly will
be held in bearings and be able to rotate, this will allow only a part (or single colour) of the light
spectrum to be shined through through a narrow slot and into the sample.
Servo motor drive - a miniature 9g servo motor will rotate the prism assembly to point di erent
parts of the spectrum through the slot towards the sample.
Test tube hole - a mini test tube holding the sample will be inserted into this deep hole in the
housing. One one side of the test tube will be this narrow slot from which light will pass through the
sample, and on the other side of the test tube will be mounted the light sensor which will record
readings and pass those to the Arduino microcontroller. I initially used a BH1750, but later changed
this to a Light Dependent Resistor (LDR).
Light source - for this design we shall use a 9V torch battery. It is mounted in a small assembly that
adds a parabolic re ector behind the bulb (coated in tin foil) to held direct light, and has a small slot
at the front so that only a narrow beam of light can emerge. This allows the light to be precisely
directed into the prism.

So those are the key components for the design!

Step 4: She's a Rainbow

Science With Rainbows! - Spectrophotometry: Page 5


All the .stl les for printing, as well as .step les (which overnight. As such, I had to use the settings in my
you can import into your CAD software if you want to slicer software (Ultimaker Cura) to keep the print time
make modi cations to the design) are uploaded to down to within the window of a single day. I
this GrabCad page I created to store the les. I eventually tuned it to take 12.5 hours, but if I was
strongly recommend you open this assembly to see printing to more desired quality it would be 22+
for yourself all the detail of the assembly, so it's easier hours!
to understand how it all ts together. As well as the
les for the spectrophotometer itself, this also The fun pack of lament colours (PLA lament) I
includes the mini test tube rack that I designed to bought came with about 30g of a whole variety of
hold my samples. colours (even glow-in-the-dark which you'll de nitely
see appear in a future project!). This I used to add the
For me the most nerve-wracking part was printing rainbow spectrum decoration to the side of the
the main case by far! Almost all of the complexity of casing, which I think adds a lot to the project in terms
the project is contained within that single part, and so of aesthetics. The rst photo shows how I built this up
printing this correctly was so fundamental. My 3D - you'll need to fettle the ts a little with a knife/ le to
printer (a modi ed Anet A6) is quite basic and lacks make sure they all t snugly, but I didn't actually need
certain safety features that more sophisticated to glue them.
printers have, so I am not comfortable running it

Science With Rainbows! - Spectrophotometry: Page 6


Step 5: Rainbow Connection

Electrical details! It doesn't need to be too neat as all this will be


enclosed by the housing lid later!
The wiring in this project is actually relatively simple
you'll be pleased to hear! I haven't included a The DC-DC boost converter needs to be trimmed (by
schematic as it's very simple to describe, and you'll be rotating the screw and testing the output with a
able to replicate it without di culty. Bear in mind that multimeter) to provide 9V, which is what the torch
there are two distinct circuits within the project, the battery requires.
9V DC circuit (powered from a wall plug) that runs the
bulb, along with a toggle switch to turn this on and A tiny piece of stripboard was cut which was used to
o , and also the Arduino circuit (powered via USB make a mini 5V rail and GND rail from the Arduino, to
from a PC) that also provides 5V DC to run the LED which the other electrical components are interfaced.
pixel ring, and the LDR (light dependent resistor). Please follow the speci c instructions for the speci c
LED Ring you purchase, as there are some very similar
I recommend soldering all of the electrical models that have slightly di erent wiring, so I
connections together and building the wiring into the wouldn't want to advise you incorrectly. A 10k
main casing before doing any other assembly. That potentiometer is used to connect the LDR in a voltage
way the wiring will already be laid before you add any divider circuit, but a larger value would probably be
other printed parts. You'll see I allowed plenty of slack better, as I used this set to the maximum 10k position.
in the cable lengths, and then laid it roughly into the
recesses of the casing, held down with electrical tape.

Science With Rainbows! - Spectrophotometry: Page 7


Science With Rainbows! - Spectrophotometry: Page 8
Step 6: Assembly Time!

Time to complete the mechanical assembly. It's going to get quite tight inside the housing!

After the prism assembly in is inside, a rubber band is used to go to the servo motor head (the servo
motor is super-glued in place on the rails that support it). Due to COVID-19 related lockdown, I
couldn't go out to source another in time, so this is an old one from the kitchen that once was
wrapped around a bunch of asparagus! This rubber band is a little loose, but it still works.
The nuts for the M2.5 bolts are embedded into 9 locations in the housing, and super-glued in place.
The Uno and boost converter are just pressed into place, which was nice and easy.
After passing the USB power cable through the housing, I wrapped a little electrical tape around it
on the inside, to prevent it from being pulled through the hole and damage the connections.
The LDR ts into a little plate, that ts into the void originally designed for the form factor of the
BH1750 light sensor. This pushes into the housing, but I decided to secure it with extra electrical tape.
Underneath, four little self-adhesive rubber feet make for a nice grippy base to the unit. I think this
adds a nice touch of quality to the feel of the device.
The light source assembly, even when printed in black PLA still leaked some light through the sides,
so I wrapped black electrical tape around it too, which properly insulated it

Science With Rainbows! - Spectrophotometry: Page 9


Step 7: Testing!

Please download the attached Arduino code and get are paint in solution). The portion of the plot that is
it uploaded to your Uno, but make sure to pay relevant is bounded by the vertical lines, which show
attention to the libraries that the code references that the portion of the prism's rotation that the colour
you'll need to install into your Arduino IDE if you don't spectrum is shining through the sample. Outside of
already have them. It's necessary to check the pin those bounds we're not interested in, and the light
attachments too, so make sure they match to how recorded is extraneous from other errant light
you've wired your system. sources. It's interesting to see how the LDR picks up
di erent levels of the di erent colours of light, and
Testing time, and running the code will produce the how it shows variation within the spectrum for each
sequence seen in the video (Section 1 of this colour too. I need to conduct more testing to further
Instructable!). Copy the data that comes in from the understand the response of the LDR to di erent
Serial Monitor in the Arduino IDE into Excel or similar, wavelengths of light (there are di erent types of LDR
and you can produce a plot similar to that shown which respond di erently), and analyse more samples,
above. This shows the traces from all 8 colour samples but I think it's a promising result so far.
I tested (the ones shown in the test tube rack, which

Science With Rainbows! - Spectrophotometry: Page 10


Download
https://www.instructables.com/ORIG/F57/M5K6/KDX3QFI2/F57M5K6KDX3QFI2.ino

Step 8: Conclusion: Somewhere Over the Rainbow!

I very much enjoyed working on this project over the loose), and also print the housing with thicker walls or
1.5 months it took from start to nish, it's taught me a paint the insides with matt black paint to minimise
lot about design, and also about the use of light in the capture of light from sources other than the
experiments. prism.

If I had the opportunity to make improvements, a Thank you very much for reading, I hope that this
version 2 of this project would use a brighter light interested you. If you do your own experiments based
source so that more light could reach the sensor. It on this design, I would love to hear from you how you
would also employ a larger value (larger than 10k got on, and improvements that you could make!
ohm) resistor alongside the LDR sensor so that the Please also comment if there are details you need that
device would be more sensitive to variations in low I've missed out, and I'll do my best to help.
light levels. I would nd a better sized rubber band to
drive the prism assembly rotation (mine was too

Science With Rainbows! - Spectrophotometry: Page 11


Science With Rainbows! - Spectrophotometry: Page 12

You might also like