Measurement Of Contaminants In Water Using A Custom-Made Laser Spectrometer.

Measurement Of Contaminants In Water Using A Custom-Made Laser Spectrometer.


We, GeekBits hereby declare that the work presented in this post is original work under our team, knowledge and testing. We grant permission to any reader to explore and expand on the work presented here.

©2022 GeekBits. Atrium, 741 Lenana Road, Kilimani, Kenya

Tables in this Project

  • Table 1: Work plan for the research project. 7
  • Table 2: Budget for the research project. 8

Figures in this Post

  • Figure 1: The order of diffracted wavelength. 5
  • Figure 2: Top view of the design of the spectrometer. 8
  • Figure 3: General design of the spectrometer. 8
  • Figure 4: Comparison between the standard fluorescent lamp and the custom-made fluorescent lamp 11
  • Figure 5: Diffraction images from the custom-made spectrometer and the standard spectrometer 12
  • Figure 6: Water sample peak and no sample peak. 13
  • Figure 7: Comparison between water sample peak and dye sample peak. 13

Acronyms and Abbreviations

  1. IR - Infrared spectroscopy.
  2. LASER - Light amplification by stimulated emission of radiation.
  3. NMR - Nuclear magnetic resonance spectroscopy.
  4. OES -  Optical emission spectrometer.


A spectrometer is an optical instrument that is used in the measurement of light properties. This instrument helps scientists to perform experiments to determine the materials that are present in different samples. However, the instrument is very expensive for use by most scientists and physics students.

Therefore, in this project, a custom-made laser spectrometer was designed. The spectrometer is not only cost effective but also, it can be used in the measurement of the components present in any sample. The project began with the identification of an appropriate light source to use, whose light beam passes through a slit that blocks away some of the light and then through a sample.

The light through the sample is then guided onto a diffraction grating that splits the light into different wavelengths. This spectrum is specific and unique for every material and thus it contains more information about the sample. After the dispersion of light, the different wavelengths are detected by a camera.

The resulting spectrum after the beam goes through the sample is analyzed. To test if the spectrometer works, the light source was turned on and directed through the slit., a photodetector on the other end was connected onto a computer and a neat diffraction spectrum was observed on the camera app.


Background Information

Laser spectrometer is an instrument that works under the idea of light interaction with matter. This idea has turned up to be very useful in the analysis of various samples. Different techniques have also been developed to improve on this idea. Some of them include NMR, IR, Gamma, Raman, and OES spectroscopy.

These techniques make it easy to get huge information about the chemical and physical nature of different samples which has led to a huge leap in scientific development. Nowadays, spectrometry is used in many fields including quantum physics, astronomy and even analytical chemistry.

A prism or a diffraction grating is what makes it possible to analyze different materials. They diffract the light incident on them into the different wavelengths.

Before the introduction of diffraction gratings, scientists used prisms to spilt the beam of light into its constituent wavelengths. To measure the angular deviations of the different wavelengths, they pivoted the eyepiece in place so that light exiting the telescope would be incident onto it.

The prisms have been replaced with diffraction grating over the years which serve the same purpose and the eyepiece has been replaced with an electronic detector that is connected to a computer. A diffraction grating is generally better than a prism in that they are efficient, and they do not suffer the absorption effect that prisms have.

Optical spectroscopy that involves the interaction of matter with photons within the range of 400 to 700nm(visible) is not so difficult and does not require complicated equipment like in Infrared spectroscopy. We can study the behavior of molecules in the excited state which makes it possible to study excited state chemistry and the physiochemical properties.

The knowledge of optical spectrometer is useful in understanding the characteristics of our environment. Despite the wide need for spectrometers and the information that has been acquired over the years, the equipment is costly and hence small institutions with financial constraints find it difficult to acquire the instruments.

For this reason, there is a need to come up with a cheaper alternative that will help in the optical analysis of different samples.

Problem Statement

A laser spectrometer is very useful in scientific development, however, apart from just being sophisticated, the instrument is very expensive. This goes overboard for most home scientists and undergraduates.


Scientists cannot do without performing experiments. Undergraduate physics students must also do practicals. However, due to financial constraints of an organization and individual home scientists, a spectrometer is off limits. Analysis of different samples requires experiments that require a piece of a spectrometer which goes for over ksh. 100 000. This is too expensive. Which is why a custom-made laser spectrometer that is cheaper may save the day. Most home scientists will also be able to make it on their own with materials that are easily obtained.


The measurement of water contaminants cannot be done using a custom-made spectrometer.


Main Objective

  1. To design a custom-made spectrometer for the measurement of contaminants in water

Specific Objectives

  1. To design and implement a custom-made spectrometer
  2. To record the resultant spectrum for water using the custom-made spectrometer.
  3. To compare the recorded spectrum with the standard

Literature Review


In order to understand spectroscopy, it is important to know how the diffraction grating works and how it came to be and the limitations of the previous methods. This is one of the main parts of a spectrometer.

In the early days, man could not understand the significance of the spectral nature of light. They could only observe the rainbow until 1666 when Newton showed that white light can be dispersed into different wavelengths. So, he introduced the word spectrum to describe the continuous series of colors. The instrument that he used had a small aperture that functioned as the source of light, a lens to collimate the beam, a prism that dispersed the light and a screen to show the spectrum. This was the beginning of the science behind spectroscopy.

In 1814, Joseph Fraunhofer advanced Newton’s discovery. He showed that when sunlight is dispersed through a slit, a series of dark lines are observed. He called these lines the Fraunhofer lines. He developed the diffraction grating which works in a similar way as a prism to disperse light. This diffraction grating is an array of slits.

The limitation to a glass prism was that it was difficult to compare different spectral measurements. This was because the angle at which a spectral line was dispersed was dependent on the type of glass that was used. This meant that the wavelength measurement was impossible.

Fraunhofer developed the transmission grating after the first slit experiment that produced a pattern of bright and dark fringes. He combined a series of slit separated by a close distance. This made it possible to measure the wavelength of the spectral lines.

A diffraction grating is an optical element that disperses polychromatic light into different wavelengths similar to prisms. The light incident onto a diffraction grating is dispersed in such a way that the different wavelengths are reflected at a slightly different angle.

A diffraction grating has a periodic structure with equally spaced parallel grooves formed on a reflective coating and deposited on a substrate. The shape of the grooves influences the wavelength specification. The distance between the grooves and the angle determines the efficiency of a diffraction grating. After dispersion, the light is re-imaged by a spectrograph and the wavelength range is directed onto a detector.

The diffraction of a grating is governed by the grating equation which is:

$$n.\lambda = d.(sin\theta_i)+sin\theta_d)$$

Figure 1: The order of diffracted wavelength.

Later on, Kirchhoff discovered that every element has a unique spectrum. If one could study the spectrum of an unknown source, you could get the chemical composition. This discovery made spectroscopy a scientific discipline. After this, many workers in 1800’s began to study different elements like flames (Hockey, 2009).

With different advancements in this field, spectroscopy has made it possible to analyze substances by projecting an electromagnetic spectrum to a sample and study the reflected, transmitted or refracted spectrum. This gives detailed information on the internal structure and the electron configuration of the sample being studied.

Materials and Methods


The spectrometer was made using 4 main parts. These are:

Optical input- This is the entrance in which the light source passes through which in this case, a fluorescent lamp was used. This is not a slit but an opening where the slit is placed. It allows light into the spectrometer through the slit.

Slit- This is a narrow opening in the spectrometer. This opening filters light and allows only a small percentage to pass through to the diffraction grating.

Diffraction grating- The diffraction grating is an optical element that separates light into its constituent elements.

Detector- The detector captures the intensity of light and displays it on a computer. The intensity of the separated wavelengths is incident onto a detector and this is displayed onto a computer.


Design and Implementation of the Custom-Made Spectrometer

The first step to designing the custom-made spectrometer was to gather the materials that are required. The cover casing was constructed using pieces of wood that are cut to measurements. The measurement of the box is 100mm by 60mm by 60mm. The size of the camera was considered when choosing the size of the cover casing.

The inner walls of these woods were painted black to omit reflections and glare.

  • 2 pieces 100 x 60 mm, 10 mm thick for the longer sides.
  • 2 pieces 100 x 60 mm, 10 mm thick for the top and bottom.
  • 2 pieces of 60 x 60 mm, 10 mm thick for the shorter sides.

A small opening was cut at the top part of the spectrometer where the sample being analyzed is inserted. This opening was placed between the slit and the diffraction grating. The opening was made by drilling a lot of holes in the place where the opening should be then joining the drilled holes and afterward straightening the walls with a file.

To design the optical input, one of the end sides will have an opening of about 10mm by 10mm. In this opening, 2 pieces of blades were attached with a separation of about 1mm which acted as the input slit. This opening was made in the same way as the opening at the top of the spectrometer.

Afterward, the diffraction grating was attached to the front of the camera so that the diffracted light enters the camera and is detected. This grating will produce the spectrum.

For the diffraction grating, a black compact disk was used. The two layers of the disk were separated using a razor blade. The half with writings on was discarded and the other half was used. The desired size was cut from this half piece and this was used as the diffraction grating.

For the detector, a web camera was bought putting into consideration the pricing. It was fitted on the other end that is opposite the slit. The camera was fit to the casing at an angle with room for adjustment just to make sure that a large portion of the infrared is recorded and that the light was diffracted. Choosing the right angle was experimental keeping in mind the resolution and amount of light collection. The cameras position was adjusted until a decent diffraction spectrum was observed on the computer.

Figure 2: Top view of the design of the spectrometer.

The diffracted light then undergoes a series of constructive and destructive interference which leads to the optical spectrum.

The fluorescent light gets separated into its constituent photons after diffraction. Afterward, these wavelengths are detected by the camera.

In more sophisticated designs of spectrometers, a collimator and a focusing mirror is used to achieve better results with higher resolution.

Figure 3: General design of the spectrometer.

Measurement of the Contaminants In Water Using the Custom-Made Spectrometer

Spectroscopic measurements involve the absorption, emission or scattering of electromagnetic radiation by a material to investigate the physical properties.

To measure the contaminants in water, pure water sample was inserted into the spectrometer. the light source was shone on to it. This showed the diffraction of the light that had passed through the water in the computer.

After, contaminants were introduced into another sample of the same water. This new sample was inserted into the spectrometer and then the fluorescent lamp was turned on. The envelope of this measurement was also seen on the computer.

Comparison of the Recorded Spectrum With the Standard Spectrum.

Data analysis was done using the theremino spectrum analyzer which is a free software for spectroscopic measurements. This software was used as the standard and it contains a library that has different recorded spectrums for different light sources and different materials.

This software scans the spectrum of signals that come in through the USB cable and displays them on a screen.

In order to ensure that the custom-made spectrometer was working with high accuracy, different light sources i.e., sunlight, different lasers with different wavelengths and fluorescent lamps were used to match with the spectrums of the same provided by the library from theremino spectrum analyzer. The matching was to ensure that the spectrums recorded from the custom-made spectrometer conforms to the standard spectrum provided in the theremino website. When a laser light with 632.8nm was used as the light source, a peak

wavelength was seen in the spectrum analyzer which meant that the spectrometer worked as expected although the wavelength seen in the spectrum analyzer was not correct.

Instrument Calibration

Now that the spectrum analyzer worked as expected, it was time to calibrate it. The 632.8nm laser wavelength peak observed did not match the value 632.8nm of the software which meant that it still could not be used to make measurements. Within the software, one is able to adjust the scale by reducing it or increasing it using the sliders provided. This are used for calibration of the spectrometer. Since the aim of this project was to test for contaminants of different samples, a fluorescent lamp was used.

The recorded spectrum of the fluorescent lamp was to be matched by the standard recorded spectrum of the fluorescent lamp. Instrument calibration helps to ensure that the custom-made spectrometer works with high accuracy.

From the standard spectrum of the fluorescent lamp, two characteristic wavelengths peaks are useful for calibration. These peaks are the ones produced by mercury 436nm and 546nm. These two wavelengths are accurate compared to the other wavelength lines which are not stable and can vary from one lamp to the other.

Using the sliders provided by the analyzing software for calibration, the two characteristic peaks (436nm and 536nm) from the standard fluorescent lamp were matched with the two peaks from the fluorescent lamp record using the custom-made spectrometer.

The measurements were taken after calibration.

Results and Discussion

Calibration of the spectrometer ensures that one takes the correct measurements and that the instrument is reliable. The envelopes below show the comparison between the two envelopes (one envelope from theremino spectrum analyzer library and the other recorded by the custom-made laser spectrometer)

Figure 4: Comparison between the standard fluorescent lamp and the custom-made fluorescent lamp

From these two envelopes, there is some similarity. And the peaks have been matched. The envelopes do not match exactly because the custom-made spectrometer had some reflections inside it which means that some unwanted light would enter the spectrometer and also the black paint used would also reflect light. The camera angle was also not perfect as recorded diffraction was slanting as compared to horizontal diffraction from theremino spectrum analyzer.

Figure 5: Diffraction images from the custom-made spectrometer and the standard spectrometer. The shift from using a laser to using a fluorescent lamp is because, different elements are present in samples and end every element absorbs different wavelength of light.

If we limit the spectrum to One wavelength of light for instance the 632.8nm wavelength, it means that the elements in the sample that will be excited are the ones that can absorb the 632.8nm wavelength. This is not helpful in the analysis of samples. That is why a fluorescent lamp was chosen instead of laser. A fluorescent lamp has the visible spectrum which expands the width of what can be measured.

Measurement of the Contaminants in Water Using the Custom-Made Spectrometer

After inserting water into the spectrometer and turning on the fluorescent lamp, there was a shift in the peaks as seen in the figures below.

Figure 6: Water sample peak and no sample peak.

Some of the red wavelengths were absorbed by the water sample leaving part of the yellow wavelength at 573nm and a little of the green wavelength at 506nm. This clearly shows that the water is not pure and some elements in the water absorbed some of the wavelengths.

In real sense, when atoms absorb energy, they rise to a higher energy level and they cannot stay at that level for long so they lose the energy in form of photons. The released energy is what is seen in the envelope with the water sample.

After measurement of the water sample, impurities were added to another sample of the same water. The resulting envelopes as seen in the figure below.

Figure 7: Comparison between water sample peak and dye sample peak.

It is clear that the dye sample absorbs more of the green wavelength and the remaining peak is at 572nm. The impurities introduced into the sample absorbed the red and the green wavelengths from the light source which clearly shows that the water has contaminants.

CHAPTER 5: Conclusion and Recommendations


From the results above, we can conclude that a custom-made laser spectrometer can be used to test for contaminants in a sample. This custom-made spectrometer is small in size and was made with materials that are easily accessible. The total cost of the spectrometer was USD 30 with the camera being the most expensive part to buy at 25 USD. This is still very less compared to the cost of a commercial spectrometer. To save on the cost, a compact disk was used as the diffraction grating and the cover casing was made from cheap wood. Even though the instrument was cheap to make, some desirable measurements can be made from it.


For proper functioning of the spectrometer, these should be put into consideration.

  • The inside of the spectrometer should be completely dark to omit the reflections. Regular black paint still has reflections so one can try using matte black paint. This may omit the reflections as expected.
  • The entrance slit should also be narrow. This will only allow a small portion of the light to pass through. Wider slit shows wider peaks which make it hard to read. The narrower the slit, the easier it gets to read the spectrum.
  • Something else to put into consideration is the angling of the camera. Ensure that the most significant part of the diffracted light is detected by the camera.


  1. Massachusetts Institute of Technology (2012). Spectroscopy. (

  2. Melles Griot Inc. (2002). Optics Guide on Material Properties. (http://www.mellesgriot. com/products/optics/mp-3-1, html).

  3. Palmer, Christopher. (2014). Diffraction Grating Handbook (7th edition).
    Sternberg, S., James, F. (1969). The Design of Optical Spectrometers. London: Chapman and Hall Ltd. pp.1-239.

  4. Theremino Spectrometer; downloads/automation (March 25, 2020).

Yours Truly, GeekBits.

If you enjoy our content, please consider buying us a coffee to support our work:

Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.