This week’s question comes from Kevin: I heard that you can use
an LED as a light sensor. How? LEDs are diodes tuned
specifically to emit light and packaged in translucent
enclosures. A photodiode is essentially the same thing, but
sensitive to a wider range of light wavelengths. From the very
informative Wikipedia page on the subject: For example, a green
LED will be sensitive to blue light and to some green light, but
not to yellow or red light. Additionally, the LED can be
multiplexed in such a circuit, such that it can be used for both
light emission and sensing at different times. In Dietz et al.,
a scheme for implementing this multiplexing is presented: - A
LED is connected to two bidirectional CMOS I/O pins on a
microcontroller (or a microprocessor with an I/O bus). - To emit
light, both of the I/O pins are set to output mode, and the LED
is driven with current in the forward direction, resulting in
current through the LED and emission of light. - To detect
ambient light: - The I/O pins are set to outp