A compact spectrometer includes an excitation light source configured to generate excitation light and arranged to illuminate a spot on a sample. A dispersive element includes at least one movable component and spatially separates output light emanating from the sample in response to the excitation light into a plurality of different wavelength bands. A moveable component of the dispersive element causes the plurality of different wavelength bands of the output light to be scanned across a detector. The detector includes at least one light sensor that senses the wavelength bands of the output light and generates an output electrical signal in response to the sensed output light.