Pages: [1]   Go Down
Author Topic: Not a perfect 0 with IR sensor  (Read 687 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.


* emet-recept.png (27.69 KB, 1260x1098 - viewed 44 times.)
« Last Edit: October 22, 2012, 02:31:01 pm by SimonAndYou » Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1400
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 

Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5225
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: