An implantable unit includes fluorescent sensor molecules, each of which includes a binding site for an analyte, a donor fluorophore, and an acceptor fluorophore; and a first light source. An external system includes an external reading unit, which includes a light sensor; and a processor, which is configured to (i) during a first time period: (a) drive the first light source to generate light having a first illumination peak wavelength appropriate for excitation of the donor fluorophore, and (b) receive, from the light sensor, a first measurement of the fluorescent light emitted from the acceptor fluorophore, (ii) during a second time period: (a) drive a second light source to generate light having a second illumination peak wavelength appropriate for direct excitation of the acceptor fluorophore, and (b) receive, from the light sensor, a second measurement of the fluorescent light emitted from the acceptor fluorophore, and (iii) calculate the concentration of the analyte based on the measurements.