A device for the periodic determination of a quantity to be measured from a sample, comprising a radiation source, and a test volume containing the sample, and a reference volume free of any substance to be detected, both of which volumes are irradiated by said radiation siurce, a detector fed via a selector unit with at least one measuring signal from said test volume and at least one reference signal from said reference volume, arriving in alternating order, an evaluation unit connected to said detector for forming the difference of the respective signals and for inferring the quantity to be measured from it, said evaluation unit including an A/D converter for determining signal intensities and connected to said detector via a compensation unit including an amplifier, a D/A converter connected to said A/D converter via an intermediate memory for generating a compensation voltage from the previously determined reference signal level (X), and having an output connected with an input of said compensation unit, and the output of said A/D converter being connected to an input of a micro-processor of said evaluation unit.