The working of a spectrometer is based on the principle that when light falls on an optical device such as a prism or diffraction grating each wavelength is refracted or bent by a unique angle. A precise spectrum can be determined by measuring the angles at which light is refracted or bent.