The spectrometer uses a diffraction grating to split the different spectral components of the incident light.
The incident light goes through a narrow slit located in the focal plane of a converging lens which produces a beam of parallel rays for each point of the slit.
The produced passes through a diffraction grating which deviates each wavelength differently. Each wavelength produces a parallel beam in a different direction
Finally the webcam lens converges each spectral component on a particular point of the sensor located in its focal plane (the webcam is focused at infinity)
In the first order, the angles $i$ and $r$ are related by :
The angle `i` is fixed by the spectrometer geometry and the angle `r` gives the position `x` on the webcam sensor corresponding to the wavelength `lambda` with the relation amath x = f tan r endamath. Practically, one measures the position on the sensor of two known wavelengths to find $f$ and $i$, the grating used has 1000 lines/mm hence $a=1µm$.
The entrance slit of the spectrometer is made of two pieces of brass sheet fixed on an aluminium plate by screws. This system makes the slit width adjustable (but not really easily). The borders of the brass sheet have to be well polished to make the width as regular as possible.
The entrance lens of the spectrometer was scavenged from the objective of an old camcorder. It has the advantage of already containing fixation screws and allows to adjust the slit-lens distance.
The grating is an holographic grating containing 1000 lines/mm bought on eBay.
The webcam is a Logitech Quickcam Pro 4000 which has a CCD sensor and is (was) widely used by amateur astronomers.
In order to control the spectrometer, I created a small piece of software which retrieves the pictures captured by the webcam and processes them to extract the spectrum. It is still full of bugs but allows for example :
Solar spectrum view through atmosphere (presence of absorption lines : Fraunhofer lines)
Transmission spectrum of the infrared spectrum of a digital camera or webcam . It blocks IR where the sensor in very sensitive.
Transmission spectrum of the filter located in front of infrared remote control receivers. It blocks the visible light to prevent interference with ambient light.
Spectrum of a Compact fluorescent lamp (energy saving). It presents emission lines of atomic elements, especially mercury (details)
Transmission spectrum of Grenadine syrup. It mainly absorbs green light which produces its pink-red colour.