Infrared Sensor

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.

The output should be a series of digital pulses.

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

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.

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.

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!

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

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.

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?

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.

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.

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

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

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?

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

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

But why such a high low voltage?

Because the output transistor is either damaged or it is oscillating.

but it worked, sort of, with the LED

That could be the problem the absolute maximum rating of that output transistor is only 5mA. How much current was the LED drawing in that test? That could have fried it.

It still works with the LED, though. And it was always dim. I was using a 10k resistor, and it didn't turn completely off.

With 10k it should be fine. The tutorial said 200 to 1000R. Try enabling the internal pull up resistor and seeing if you can sense anything.

Should I pull it high or low?

And why, why, Grumpy Mike, would the LED change its brightness if there was only a change of about 100mV!?

baum: Should I pull it high or low?

And why, why, Grumpy Mike, would the LED change its brightness if there was only a change of about 100mV!?

You set it in high state to activate pullup.

regards