A multilayered semiconductor acting as an optical sensor opens the way to miniaturized, adjunct spectrometers.