elektronika kifo
hrvatski jezik

Led Sensor

From the beginning, Leds are used in many applications for signalization purposes. For what else can be Led used except for signalization or lighting? You can use it in another way, and some times that may be very useful. Usual Leds can be used as ambient light sensors, where Led can be used for signalization or as ambient light sensors. The idea is very simple, just look at schematic.


led sensor

početna stranica
send e-mail
hex file

As we see, Led is connected between two pins of microcontroller, GP0 and GP1 (it can be any pins). If GP0 = 1, and GP1 = 0 then Led is ON (that is a normal situation). If we change state so that GP0 = 0, and GP1 = 1, then Led has inverse voltage and it is OFF (that is also normal). But if we put GP1 after this state to high-z state and measure the time until GP1 came to zero state, we will take different result for different level of ambient light. Short falling time = more ambient light.

I think that you may not use Led in some special device for measuring ambient light, but it is interesting to use that Led-sensor in some simple and not commercial application.

Here is a sample code – Led Sensor.bas. When you turn on this device, Led is off (it must be daylight), but when you make a shadow around Led, it will begin to shine!

I think that I changed your thinking about Led, as we gave a new way of use.

You can download the hex file here: Led Sensor.hex



If you use the software, hardware or informations from these pages, you do it at your own risk. All projects are copyrighted and you shall not in any manner distribute, use or make copies of, or otherwise duplicate any materials and projects contained on the Website, without permission of author

send e-mail