Go Down

Topic: Not a perfect 0 with IR sensor (Read 739 times) previous topic - next topic

SimonAndYou

Oct 22, 2012, 09:24 pm Last Edit: Oct 22, 2012, 09:31 pm by SimonAndYou Reason: 1
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:
Code: [Select]

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.

jackrae

I'd guess that the transparency of the water is the cause of your low output signal.  As to the drift, it might be that the current flowing through your receiver with no interrupting water is causing the LED to increase conduction and so drifting its output.

Have you tried reducing the 100k resistor down to say 10k.

You might get better results by modulating the transmitter LED signal to a pulsed, rather than fixed DC.

Alternative detection could be obtained by letting the drops fall onto a pair of contacts.  The droplet will cause slight conduction before it drops off the probe tips and this conduction should be easily detectable. 


SimonAndYou

Quote
Have you tried reducing the 100k resistor down to say 10k.


It's actually working better with a 120k instead of 100k. The thing is, I don't want to spoil the sensibility of the LED...
Thank you anyway!

pylon

First a question back: Are you really using a second IR LED to detect the IR light? Does that work? I only know the schematics with a IR detector (photo transistor) but would be interested to get the details how to do that with an LED. Do you have a link to more information?

To your problem: is the whole system within a closed box? If not, you might get some refraction from air temperature differences between the emitter and the receptor.

To be able to use the signal on a digital input you have to amplify it before feeding it into the Arduino.

SimonAndYou

Quote
First a question back: Are you really using a second IR LED to detect the IR light? Does that work? I only know the schematics with a IR detector (photo transistor) but would be interested to get the details how to do that with an LED. Do you have a link to more information?


As detector: IR LED SFH203FA (http://ronja.twibright.com/datasheets/pin/sfh203.pdf)
As emitter: IR LED SFH415-U (http://www.datasheetcatalog.org/datasheets/50/486551_DS.pdf)

The whole thing works good (see the image in my first post for the assembly). If nothing stands between the IR LEDs, 0-value. If a drop of water fall through them, more or less 20-value, and so on depending of the type of the object passing through them (0 to 1023-value).
Now with the 120k resistor instead of the 100k, the 0-signal is good.

Quote
To be able to use the signal on a digital input you have to amplify it before feeding it into the Arduino.

For my project all the digital pins are used. Moreover, I may use the different ranges of value to detect what kind of liquid is passing through the IR bridge... So I keep on using the analog input pin for this sensor.

Go Up