Buried double p-n junction (BDJ) structure designed and fabricated in a standard CMOS process is presented. Under reverse-biasing conditions, it provides two measurable photo-generated junction currents I-1 and I-2, which have a linear dependence on the incident photon flux. Over the visible range, the ratio I-2/I-1 is a monotone-increasing function of the wavelength, which can serve as a reference curve for wavelength determination. The reference curve r(lambda) can be obtained by measurement or by calculation. A physically-based model is suggested for the simulation of photocurrents and the computation of the curve r(lambda). Two application examples of the BDJ detector are presented. For the development of microspectrophotometry, replacing photodiodes by BDJ detectors offers a solution to problems of wavelength calibration. In the case of colorimetric pH measurement. the BDJ detector is used to detect spectral changes of absorption.