LED as Light Sensor

We all know that a LED emits light. But it also acts as a photodiode, that is, current flows through when the device is exposed to light and therefore producing a voltage drop across the terminals of the LED. The amount of light is proportional, although not linear, to the voltage across the terminals.

In this article, we will demostrate how this is done using an ordinary red LED and a Saleng Uno. For display, we will use a 16×2 LCD module with a Kimat I2C backpack.

Wiring:

 

Code:

Demostration:

Happy Hacking!

Leave a Reply

Your email address will not be published. Required fields are marked *