Nanotube transistors are coated with optically responsive agents to form optoelectronic detectors. In response to illumination, an electronic property of the inventive detector changes from one value to another. It retains the new value when the illumination is removed, so that the detector remembers having been illuminated. The detector can be reset by changing a gate voltage. Spectral response of the detectors can be changed by using different agents as coating. Multiple detectors with different agents can be combined on one substrate to form a combined detector that discriminates between radiation of different wavelengths.