Pages: [1] 2 3   Go Down
Author Topic: Infrared Sensor  (Read 2478 times)
0 Members and 1 Guest are viewing this topic.
Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got this IR Detector:
http://www.sparkfun.com/products/10266
from sparkfun.

I hooked up an LED to the output, and it blinks when I press a button a remote. But when I plug the output into the Arduino, nothing.

Help please!

(my hookup is simple: 5V to Vcc, GND to GND, Vout to pin 2.
Logged

Offline Offline
Full Member
***
Karma: 8
Posts: 147
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The output should be a series of digital pulses.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And what software? And what are you expecting it to do?
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am expecting it to read a string of ones and zeroes when I press a button on an infrared remote. But I get nothing. Why would it work with the LED, but not on the arduino?

I am following ladyada's tutorial at
http://www.ladyada.net/learn/sensors/ir.html

Look at her diagrams. The first one (with the LED) works. But the next one, exactly how she has it (with the arduino) does not work. I am using her code.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So you need to see where it is going wrong.
1) Just write a simple program that looks at the digital input pin and lights up the LED on pin 13 depending the input state. That will tell you if the hardware is wired up correctly.
2) If that works then put some print statements in the code and see where it is getting stuck.

The results of these two tests will point you in the right direction.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the example digital read serial under the examples folder. The program works if I, say, wire up a button. But not with the ir sensor. It just stays at 0 (at least it's tied to ground!)
Could serial comm. be too slow for the sensor to read the pulses? (but why won't ladyada's optimized program work?)

Odd.

Also... If there is NO ir light, should the sensor be off, or sort of off? Mine says 1.5 V w/ a 5V source if no ir light is being turned on.

I hope it's not broken... I haven't done anything to it!
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's broken. datasheet from vishay (see above link) says MAX low output is 100mV.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Mine says 1.5 V w/ a 5V source if no ir light is being turned on.
That doesn't sound good. It should be zero volts with no light.
It is a modulated light receiver so it won't be affected by stray light. The data sheet (and my experience) says they are very sensitive to power supply ripple. It recommends a 100R series resistor and a 4u7F capacitor on the power line. If you are lucky the small voltage you see is the chip oscillating, if not it has broken.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But I am setting it up exactly as ladyada has it, and she has no problems!

It's being powered by arduino's 5V, too, so its probably regulated enough, no?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But I am setting it up exactly as ladyada has it, and she has no problems!
That is the problem with the internet, just because someone tries something once and has no problems doesn't mean it is a good robust repeatable design.

Quote
It's being powered by arduino's 5V, too, so its probably regulated enough, no?
No - decoupling is little to do with regulation, it is to do with interference on the power line, causing interference to the device. A company I used to work for made the same mistake of not decoupling this very part. It went all through the development process and testing and it wasn't until they had built several thousand boxes that it came to light that a significant number of IR detectors failed through lack of decoupling.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I add a cap now as vishay says, can i get the sensor to work? or is it dead? smiley-sad smiley-sad(
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know.
It's not just the cap but the resistor as well. It's worth a try.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

k.

Thinking back on it, when I was testing the voltage with my multimeter, I may have shorted the GND and out pins. Would that do anything?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31436
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well if the block diagram in the data sheet is to be believed then no that would not damage it.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 16
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But why such a high low voltage? And why nothing on the arduino?

(Then I aimed a remote at the IR sensor, with the multimeter on, and I the voltage droppe by about 100mV, but it worked, sort of, with the LED.)
Logged

Pages: [1] 2 3   Go Up
Jump to: