Let's Make Robots!

Fun with LEDs

About time I post something here... :)

I have been experimenting with an alternative use for LEDs. What most people don't know is, that part from emitting light, LEDs can be used as light detectors. To try this, use a picaxe 28x1 or other picaxe that has ports that can be used as both output and input.  I have connected a standard green LED (the detector) with anode to port c1 and cathode to port c0 with no resistor on either pins. Also, I have a stanard red LED (indicator) with a 330ohm resistor on the standard output port 0 and GND.

The theory is, that if you supply the green detector with power in the reverse direction, that is from cathode to anode, instead of anode to cathode, as you normally do, the diode is charged like a capacitor. After a small charge time, the cathode pin is switched from output to input. Then wait a bit, read the cathode pin and send the value to the indicator LED and restart the process.

What I have observed is, that in normal light, the indicator LED is turned off, but if I move my hand over the detector LED, the indicator LED is turned on. This must be because the capacitor effect in the LED is dependent on the amount of light comming to the LED and that the LED hasn't "decharged" yet, when it is in shadow.

I will have to experiment with timings etc. for a while and will get back with more info. The goal of these experiments is, of course, to see if cheap LEDs can be used as detectors for a line follower. If not, it's just a fun experiment. If I get my webcam to work, I'll record a small video of this to post here.  

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I stumbled upon this article from David Cook which you may find relevant:


- Jimmy

Thanks, looks interesting. Interesting idea, to use them as color detectors. I'll try to play with that some more.