A Simple Spectrometer

A Simple Spectrometer
Richard Harrison, September 2014
Having investigated using a digital camera to obtain RGB information for coloured stars, I realised
that the value of the data was limited by the unknown colour response of the camera’s sensor and
by the unknown degree and nature of the processing used by the camera to create a jpg file. In
principle, these issues can be resolved by obtaining photographs of spectra from a variety of light
sources.
Since spectrometers tend to be very expensive pieces of equipment, I wondered if it would be
possible to construct one of sufficient quality and accuracy, using simple, cheaply and easily
available materials, plus a camera as the detector. I was encouraged by finding a number of internet
sites that showed how to make a simple spectrometer, using the grooves on a CD or DVD as the
dispersing element (see, for example, http://coolcosmos.ipac.caltech.edu/cosmic_games/spectra/makeGrating.htm,
http://www.cs.cmu.edu/~zhuxj/astro/html/spectrometer.html or http://store.publiclab.org/products/desktop-spectrometry-kit).
These spectrometers are limited in resolution, partly by the optical arrangement and partly by the
use of the curved grooves of a CD as a diffraction grating. The resolution can be improved by either
using a narrower slit or by increasing the distance between the slit and the dispersing element, but
both of these will reduce the amount of light reaching the image. I thought it should be possible to
do better by introducing a few optical elements and using a cheap transmission diffraction grating
rather than a section of a CD or DVD. The principle of the design is shown in the diagram below.
The essence of this arrangement is that the collimating lens illuminates the grating with a parallel
beam of light – effectively placing the spectrometer slit at infinity, but without reducing the amount
of light passing through the system. I decided to place the diffraction grating at an angle to the
parallel beam, so that the diffracted light emerged closely perpendicular to the rear surface of the
grating. This not only makes it easier to position the camera lens close to the grating, but also means
that the resulting spectrum ought to have a reasonably linear dispersion scale.
In a well-designed spectrometer, where it is important to gather as much light as possible, great care
is needed to ensure that all the optical components are well matched. In this case, however, there
will be no shortage of light, so mismatched components should not be of any great significance. I
therefore selected the cheapest approximately suitable components that I could find. I ended up
with a cylindrical lens of about 7 cm focal length to gather light onto the slit, a simple collimating
lens of about 14 cm focal length and a 35 x 24 mm, 1000 lines/mm replica transmission grating in a
5x5 cm cardboard mount. With a home-made 0.1 mm slit and my existing camera, the remaining
optical components, together with a dual flash bracket that I adapted to hold the camera in place,
cost less than £20. The choice of lenses means that the parallel beam is significantly too wide for the
size of the grating but, as I mentioned earlier, shortage of light should not be a problem for the types
of use that I have in mind. To avoid any of the stray light reaching the camera, I added a mask
between the collimating lens and the grating.
The most difficult part of the project – for me – was the design and assembly of the enclosure to
hold all the components in place. With limited tools, I made use of an assortment of odds and ends
of wood and other materials that I had lying about in the shed, to minimise the amount of cutting
and shaping that were needed. The final assembly is shown below and, excluding the camera
bracket, fits in a 15 x 15 x 30 cm enclosure.
The camera bracket is designed to swivel so it can be used in the straight-through position to aid
focusing of the collimator. This has the added advantage that the camera angle can be varied to suit
other gratings, should I decide to use them.
First Results
A few of my initial spectrograms are shown below.
Fluorescent Tube (mainly Mercury emission lines)
Incandescent Lamp
The Sun
The solar spectrogram is slightly overexposed but clearly shows dark, Fraunhofer lines, caused by
absorption of light by atoms of Hydrogen, Sodium, Iron and other atomic species in the upper
atmosphere of the Sun.
Using cheap optical components – and an assembly in which they are not perfectly aligned – causes
some distortion of the image and, as can more or less be seen in the above illustrations, the spectral
lines are neither perfectly straight nor perpendicular to the long edge of the image. However, the
spectra seem to be of sufficient quality for meaningful measurements to be made on light emitted
from pyrotechnic compositions.
Handling the Data
I wrote a few simple programs to extract the data from a selected area of a photographic image, to
derive a wavelength scale from reference spectra of a fluorescent lamp and to plot graphs of
intensity versus wavelength. Each point in the spectrum is calculated by averaging the values from a
vertical column of fifty or more pixels which, at the intensities found in a typical image, gives a
relatively noise-free measurement.
The wavelength scale turned out to be, as I had hoped, highly linear. The resolution, measured by
the width of spectral lines at an intensity of half the peak value, is about 2.5 nm. This is not quite as
good as the theoretical value for the grating I use, but quite adequate for the intended purpose.
Measuring a number of spectral lines in images taken with a variety of exposures allowed me to get
a good idea of the camera’s response to changing levels of light. The result was highly linear up to
light levels of around 75 to 80% of the maximum recordable value, beyond which the response starts
to level off. There was evidence of departures from linearity at extremely low light levels – around
1% of the maximum or less – which might be real, or might be caused by the fact that the spectral
lines in an image are not perfectly parallel to the columns of pixels. In the future, it might be worth
considering modifying the software to align the pixel measurements with the images – especially as
it would also be likely to result in a modest improvement in the measured spectral resolution.
Another future task is to use a known, standard source in order to determine the spectral response
of each of the three types of colour sensor, as that would allow me to produce spectra with a true
(relative) intensity scale. Some initial work in this area suggests that the camera’s response falls to
zero at wavelengths shorter than about 410 nm and longer than about 690 nm, and that there is a
dip in sensitivity around a wavelength of 500 nm. Fortunately, the wavelengths at which coloured
pyrotechnic compositions emit significant amounts of light are all within the detectable range.
The Spectrometer in Use
Once the spectrometer was up and running, I found that it was useful for a far wider range of tasks
than my original, limited intention of improving the accuracy of my RGB measurements. As an
example of the value of taking spectra of pyrotechnic items, I will briefly describe the measurements
I made on a blue star composition.
Early visual and photographic trials of the composition showed that the blue colour was paler than
expected, and rather disappointing. Taking a spectrum of
the light emitted by a star quickly revealed the probable
cause; it showed – in addition to the expected blue and
green bands due to copper monochloride – very strong
yellow-orange emission at 589 nm, indicating that sodium
was present in the mixture.
In an attempt to determine how the sodium
contamination was entering the composition, I took
spectra of a variety of coloured stars, using several
different compositions, moistened with a range of
solvents. The results strongly suggested that the sodium
impurity was associated with the potassium perchlorate I
was using.
I therefore purified a sample of the perchlorate by
recrystallisation and tried again. The result was a
spectrum showing very little sodium emission – and a visibly much better blue.
Without using the spectrometer, I might not have discovered the effect of the sodium impurity – and
might have given up on what eventually proved to be an excellent blue star.