Hi everybody,
I'm trying to make a water-drop sensor with 2 IR LED, an emitter and a receptor.
The installation is quite simple to test the IR LED: See the enclosed image. The two LEDs are face-to-face, like 1cm away from the other so that if a drop of water fell through the IR bridge, it would be detected on the analog input.
The code:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(analogRead(5));
}
If something pass through the bridge, the displayed values switch from 0 to 950, more or less. So it is working.
Problem:
The displayed value are 0 when nothing is standing between the LEDs, then after a few seconds they start to increase with no reason, from 0 to 10, sometimes even 20.
My guess is that it's a false ground, but I'm not sure.
Do you have any idea?
Sorry for the english...
Simon
[EDIT] I forgot to say, I put the IR reception LED on analog pin because a drop of water give me a value no more than 20 or 50, which is not enough to give me an HIGH on a digital pin. I hope I made myself clear enough.