Home / English Posts / DIY Webcam Diffraction Grating Spectrometer

DIY Webcam Diffraction Grating Spectrometer


In this post we propose the construction of a diffraction grating spectrometer based on webcam and software Theremino Spectrometer. The spectrometer is a fundamental tool that allows measurement of the spectrum of a light source, ie the properties of light as a function of its wavelength. The spectrometer that we propose uses the principle of interference in a diffraction grating in order to decompose the light radiation in its wavelengths and subsequently measuring its intensity with a high-resolution webcam.

Diffraction Grating

A monochromatic light beam that is incident on a grating gives rise to a transmitted beam and various diffracted beams, at angles that depend on the ratio between the distance between the lines of the grating and the wavelength of the light. So, if the light beam is composed of multiple wavelengths, the decomposition of the beam into its components is obtained.

The light with a longer wavelength is deflected to a larger angle with respect to the incident direction (angle of diffraction ) . For each wavelength more rows can be observed. The number of rows that are counted from the middle line, which is not skewed with respect to the incident beam and is taken as a reference , it is said “order” and is often denoted by the letter m.

Light Beam Diffracted by a Grating
Lamp Spectrum obtained from a Diffraction Grating
Portable Diffraction Grating Spectroscope

Design and Components

Diffraction Grating : olographic grating 1000 lines/mm monoaxial
Optics: Telescope Lens
Optical Slit : manual micrometric slit


Spectra Examples

Fluorescence Lamp


Imagine and Spectrum of a fluorescence lamp (mercury UV emission at 546nm, 438nm and 406nm andRed Europium fluorescence)

Neon Lamp

Neon lamp spectrum (Discrete Spectral lines)

Alogen Lamp

Halogen lamp spectrum (continuos spectrum)

Sodium Lamp

“cold” lamp- detail of sodium doublet at 589nm

Warming up Lamp

“warm” lamp – sodium absorption line at 589nm

Wood UV Lamp

Wood lamp spectrum (UV emission)


Near infrared emission

Laser and LED

Various LED

Comparison between Red LED and Red Laser

Green Laser Diode

In the image below there is the 532 nm green laser diode functioning scheme. There is IR pumping emission at 800 nm. Nd:YVO4 crystal converts  this wavelength into 1064 nm emission, the latter is frequency-doubled, at 532 nm, from a KTP crystal.

Green laser diode – detail of the emission line with two peaks at 532 and 530 nm

Green laser diode – the pumping emission lines are shown

Electric Arc Plasma

Near UV Emission

Quinine Fluorescence

Blu quinine fluorescence – UV lamp excited

Uranium Glass Fluorescence

Green Uranium glass fluorescence – UV lamp excited

Sun Spectrum


Maximum at ~ 530nm => T = 5500K° (from black body radiation / Wien law)

Evidence of UV (<400 nm) and IR (>750 nm)

Evidence of the following absorption bands / lines :

  • Atmospheric oxygen absorption band O2 760 nm – Fraunhofer A
  • Atmospheric water vapor absorption band 720 nm
  • Atmospheric oxygen absorption band O2 684 nm – Fraunhofer B
  • Absorption Hα 657 nm (Balmer series) Fraunhofer C
  • Absorption Hβ 480 nm (Balmer series) Fraunhofer F
  • Absorption Hγ 430 nm (Balmer series) Fraunhofer G
  • Sodium absorption line at 589 nm Fraunhofer D
  • Iron absorption line at 530 nm Fraunhofer E
  • Magnesium absorption line at 520 nm Fraunhofer b

Absorption Spectroscopy

The absorption spectra are obtained by means of an halogen lamp and a xenon lamp with constant emission over a wide wavelength range. The variations in the emission intensity are compensated with a software algorithm. The useful bandwith starts at 370 nm till to 1000 nm.

Absorption Spectroscopy Setup

Halogen and Xenon Lamp

Absorption Spectra Examples


Carotenoids are organic pigments that are found in the chloroplasts and chromoplasts of plants and some other photosynthetic organisms, including some bacteria and some fungi. There are over 600 known carotenoids; they are split into two classes, xanthophylls (which contain oxygen) and carotenes (which are purely hydrocarbons, and contain no oxygen)

In general, carotenoids absorb wavelengths ranging from 400-550 nanometers (violet to green light). They serve two key roles in plants and algae: they absorb light energy for use in photosynthesis, and they protect chlorophyll from photodamage. In humans, three carotenoids (beta-carotene, alpha-carotene, and beta-cryptoxanthin) have vitamin A activity (meaning that they can be converted to retinal), and these and other carotenoids can also act as antioxidants.
Carotenoids belong to the category of tetraterpenoids (i.e., they contain 40 carbon atoms, being built from four terpene units each containing 10 carbon atoms). Structurally, carotenoids take the form of a polyene hydrocarbon chain which is sometimes terminated by rings, and may or may not have additional oxygen atoms attached.

  • Carotenoids with molecules containing oxygen, such as luteinand zeaxanthin, are known as xanthophylls.
  • The unoxygenated (oxygen free) carotenoids such as α-carotene, β-carotene, and lycopene, are known as carotenes.

Their colour, ranging from pale yellow through bright orange to deep red, is directly linked to their structure. Xanthophylls are often yellow, hence their class name. The double carbon-carbon bonds interact with each other in a process called conjugation, which allows electrons in the molecule to move freely across these areas of the molecule. As the number of conjugated double bonds increases, electrons associated with conjugated systems have more room to move, and require less energy to change states. This causes the range of energies of light absorbed by the molecule to decrease. As more frequencies of light are absorbed from the short end of the visible spectrum, the compounds acquire an increasingly red appearance.

Absorption Spectrum of β carotene, the two absorption maxima at 480 nm and 450 nm are evident


Hemoglobin is a globular protein whose quaternary structure consists of four sub-units . It is soluble, red (is a chromoprotein), and is present in the red blood cells of vertebrates, excluding some Antarctic fish. It is responsible for the transport of molecular oxygen from one compartment with high concentration of O2 to the tissues that need it. Each of its four protein cells, called globin, contains inside a molecule of protoporphyrin coordinating an iron ion Fe (II), located slightly outside the plane of the molecule, collectively called Eme Group. When it binds to oxygen hemoglobin is called oxyhemoglobin, and it is called deoxyhemoglobin in the unbound form.

Absorption Spectrum of Hemoglobin. Absorption peaks at 579 nm, at 540 nm and at 413 nm and for λ less then 390 nm

Pdf document with complete description of the spectrometerSpettrometro_ENG

Application of the Spectrometer on Atomic Spectrometer : Atomic Spectroscopy

Application of the Spectrometer on Fluorescence : What is Fluorescence

Check Also

Photogates with Theremino

Two “general purpose” photodiodes, two LEDs, some front-end electronics for photodiode reading, and a Theremino …