A standard LED, connected to a pair of microcontroller bidirectional I/O pins with a high-impedance capability, can act as a photodiode to detect light intensity
Figure 1. A standard LED, connected to a pair of microcontroller bidirectional I/O pins with a high-impedance capability, can act as a photodiode to detect light intensity