How to use infrared emitter and receiver?

Hi everybody,

I'm working on a project using the UNO where I want to detect if something moves between an infrared emitter and transmitter, similar to the way that we could tell if something passes between a photoresistor and LED.

For this, I've purchased these parts:

I'm fairly new to Arduino, and am not sure what to do. All tutorials that I've seen are very complicated, and involve using a remote control to input infrared signals.

Are these the wrong parts? Is there something I'm overlooking?

Thanks!
Steven

Look at this project Sneak Thief It might be just the circuit you want.

Are these the wrong parts?

Yes they are a lot harder to use.

This is the data sheet. It shows you how to wire it up and also the signals you need. Basically you need to pulse the LED in bursts of 38KHz, with 600uS on and 900uS off and then you will get the same pulses out of the receiver. However after about 30 pulses like this then you have to rest for at least 5mS before you can get pulses out again.

This makes the driving of the LED complex and the interpretation of what you receive complex. These devices are designed specifically for IR remote controls.

Infrared receiver vs1838b-1.pdf (285 KB)

The TSSP4038 (not TSOP....) can be used for a continuous 38kHz beam-break or reflection sensor.
Leo..

That just eliminates the need for a 5mS gap from time to time, you still have to do the rest.

Grumpy_Mike:
That just eliminates the need for a 5mS gap from time to time, you still have to do the rest.

Sure, but generating 38kHz is easy, and the output of the sensor is just a logic level.
Leo…

const byte IR_LED = 11; // IR transmitter LED with 100ohm (minimum) CL resistor

void setup() {
  pinMode (IR_LED, OUTPUT);
  TCCR2A = _BV (COM2A0) | _BV(WGM21);
  TCCR2B = _BV (CS20);
  OCR2A =  209; // ~209 = ~38kHz | ~219 = ~36kHz
}

void loop() {
}

but generating 38kHz is easy,

Yes easier.

and the output of the sensor is just a logic level.

But the data sheet says:-

tpi 10/f0 is recommended for optimal function

Note the part TSOP4038 is also a light barrier sensor.

And the OP doesn't have one.

I think a lot of the info in those datasheets is not accurate (copied from a universal writeup).

I have used the PNA4602M in my own beambreak projects, and I know that that one definitely works with continuous signals.
Leo..