As a result of the questions from lekirst
on this ible of my hand: LED-as-lightsensor-on-the-arduino/
and the cleaner code made by hansc44
it was time to come with a better Ible. So here it is. (I didn't solve lekirst's problems yet so she probably is open for suggestions)What is the idea?
You might know that a LED emits light when you put the right amount of volts on the right leads. The funny thing is that it also works the other way around. Not the leads, it doesn't work when you put the leads the other way around. But what does work is that when you shine light on a LED it will GIVE current. It is a very small current but just enough for an Arduino to detect.What will it do?
When you darken the sensor led, for instance by covering it with your hand, it will turn on the other LED.Does this work with any LED?
As far as I know, it works with any LED, but not with any LED as good.
green and red LEDs seem to work best.
If trough experimenting you find out that other colors even work better, let me know.Does it work with any light?
This sketch works very reliable with normal daylight. It is not fully tested in dark rooms or bright sunlight yet.