Hi i'v got plenty of those sensors and i would like to use them with arduino, can someone tell me how?
I suppose is one led and one photoresistor.
Hi i'v got plenty of those sensors and i would like to use them with arduino, can someone tell me how?
I suppose is one led and one photoresistor.
That looks like an interrupter, not a proximity detector
I suppose is one led and one photoresistor.
Yes and you can see the one on the right is the LED. So attach that to +5V through a 220R resistor and the other end to ground. Then from the other side the detector goes between ground and an analogue input, with a 100K from the input up to +5V.
Really thanks for the advise.
Another noobish question, how you know witch resistence must be plugghed?
In general topic, how you decide witch resistence must be used?
with a 100K from the input up to +5V.
you mean up to ground right?
you mean up to ground right?
No I don't.
how you know witch resistence must be plugghed?
Can we try that again in English?
In general topic, how you decide witch resistence must be used?
That's quite clear.
BTW i made the circuit and uploaded a serial println sketch, with analog port reading. The result is that i got allways "open" analog reading, without any change when i interrupt the sensor. It does not work.
Choosing a resistor is a matter of knowing what current you want to have flowing.
For an LED the resistor must limit the current to the operating value. So for 20mA LED current and a forward voltage drop of 1.5V for the LED then the resistor has to be:-
5 - 1.5 = 3.5V across the resistor
3.5 / 0.02 = 175 ohms.
The result is that i got allways "open" analog reading,
Do you mean you always get a reading of zero from the analogue reading?
Looks like the component isn't working or it is wired up incorrectly.
Serialreading gives me analog reading going to 190 to 210 and to 210 to 190.
And I assume it doesn't change when you put something between the slot?
What are you putting between the slot? Some materials like paper are transparent at IR wavelengths, metal is good at stopping IR.
Of course you could always have the sensor or the LED wired up the wrong way round.
I use plastic of course. The IR Led works, i saw the light trough my cellphone camera. I will make some change and let you know if it works. Thank you for the help.
Some plastics look opaque in visible light, but may be translucent or transparent to IR