The invention relates to the detection of the cofactor reduced nicotinamide adenine dinucleotide phosphate (NADPH). Provided is a sensor molecule for the resonance energy transfer (RET)-based detection of NADPH, the sensor comprising a segment A connected via a linker to a segment B, wherein each of segment A and segment B comprises a member of a RET pair comprising a donor moiety and an acceptor moiety, further characterized in that (i) segment A comprises a binding protein (BP) for NADPH, the BP being dihydrofolate reductase (DHFR; EC 1.5.1.3) or a functional homolog, fragment, derivative or variant thereof, showing the desired NADPH binding properties, and wherein the BP comprises a heterologous protein domain inserted at or replacing at least part of the region corresponding to positions (20) to (27) of E. coli DHFR, said heterologous protein domain comprising the member of the RET pair; (ii) segment B comprises a ligand (L) capable of intramolecular binding to said BP only in the presence of NADPH; such that the donor moiety and the acceptor moiety are in a suitable juxtaposition to yield a RET signal when L is bound to BP, and wherein NADPH-induced binding of L to BP results in an increase in RET efficiency.