A spectrometer is an optical instrument for measuring the absorption of light by chemical substances; typically it will plot a graph of absorption versus wavelength or frequency, and the patterns produced are used to identify the substances present, and their internal structure.
White light is split up into its component frequencies by passing it through a diffraction grating. By rotating the grating,light of any particular frequency can be made to pass through the slit. At the same time as the grating rotates, the recording table on top of the machine is made to move. The amount of movement corresponds to the frequency of light being passed through the slit.
After leaving the slit,the beam is split into two. Both halves pass through a series of lenses and prisms to make sure they are focused properly. Then one beam passes through the sample tube, and the other beam through the reference tube. After passing through the tubes,the beams are compared by a rather complicated piece of electronics. In effect,the electronics subtracts one beam from the other. The final signal that is sent to the pen is therefore due to the sample rather than to the reference,which is in both tubes. The higher the pen moves up the chart paper,the more light is being absorbed.