LEDs are extremely common in electronic devices. They are used as light emitters, but can also be used as light detectors since they are photodiodes. By quickly switching between light emitting and detecting, you can use the LEDs to determine the ambient lighting and even do bidirectional communication. MERL has a good paper covering the basics of how this system works and how they used it as a "last-centimeter" communication device. The system can be implemented using one LED, a resistor, and two I/O pins. So, it could be used cheaply in almost any device. The microprocessor quickly switches the LED between emitting light, detecting light (LED acts as a charging capacitor), and measuring the discharge rate of the LED to determine light level. Jeff Han has a neat video demo of how this system can be used as a proximity sensor.
UPDATE: [hawkeyeaz1] pointed to a blog covering one person's investigations into LED sensors.
[thanks branen]


41. i'm sorry straus that you're stuck in ignorance, read up a little - this is near ground-breaking stuff. I had no idea an LED could hold a charge. Simply by reading the RC time from it, you can use it to sense light. Wondering if the BASIC Stamp RCTIME is quick enough to handle this.
Posted at 3:09PM on Sep 3rd 2006 by grendelt