A main use of the diffraction grating is the accurate measurement of different wavelength of light in a given spectrum. If light is incident on a diffraction grating, the angles at which constructive interference takes place depends on the wavelength or equivalently, the colour, so different colours can be observed at different angles. Accurate measurement of the angle provides an accurate measurement of the wavelength of that particular light.
Spectrometers can be used to analyse emission and absorption spectra for example nd so deduce the energy levels of atoms.
They may be used to analyse solar spectra. Spectrometers were used to make several important discoveries - that each chemical element is associated with a set of spectral lines and the discovery of helium, very rare on Earth but abundant on the Sun. Analysis of the Sun's spectra led to the discovery of Helium, and more importantly, ultimately to the discovery that nuclear fusion powered the Sun.