Follow an IR signal

Hi Guys,

I have an emitter set to send an IR signal at 38 kHz pulsed at 1 kHz.

I have a 3 pin sensor.

Question:

How do I sense this with an arduino uno? -theory -which pins are needed

The sensor will be attached to a servo that will try to follow the signal, and turn it to the direction of the emitter.

Thanks for any suggestions!

What is the sensor? Does it have a number on it?

What do you mean by 38KHz pulsed at 1 KHz?

lar3ry: What is the sensor? Does it have a number on it?

What do you mean by 38KHz pulsed at 1 KHz?

The sensor is like this: http://1.bp.blogspot.com/-sStGcLtf2kE/UTTAXKL4-iI/AAAAAAAAA_k/I4L-ZMuRt00/s1600/infrared+sensor+(5).jpg

The signal looks like this: http://www.gammon.com.au/images/Arduino/Arduino_forum_102430.png

38kHz for 1ms then off for 1ms then repeat

augre:

I have a 3 pin sensor.

Question:

How do I sense this with an arduino uno?
-theory
-which pins are needed

The receivers typically have +5V, GND and signal out (check the pinout as it varies for different models from the same suppliers)

In theory, you just need to connect the signal out to an interrupt pin on the Arduino (2 or 3 = INT0 or INT1 on Atmega328x Arduinos) and you should get a standard square wave 1kHz signal if you write the appropriate coded & Interrupt handler. If you are not comfortable with Interrupts you should be able to poll any pin - at that frequency(500Hz).

Just noticed 1ms on & 1ms off = 500Hz not 1kHz.

Caveat: some IR receivers cannot handle a continuous signal and turn off. You need to check the data sheet for your IR receiver.

Either of these should work fine: TSSP4038 TSSP58038 from Vishay (they run at 5V or 3.3V)

I think it will be easier with 2 sensors, facing in different directions about 30 degrees apart. With a single sensor, if the emitter moves and the sensor loses the signal, you can't tell which way to turn. With two sensors, one of the signals will be lost before the other one, and from which one loses the signal first, you can tell which way the servo needs to turn.

Hi,

Yeah I am thinking about two or even three sensors.

Right now I am using one and the way I check if the signal is there or not that I measure the frequency with the arduino. So if I have a 500Hz signal then fond the direction.

What is the method usually used to check if the signal is there or not?

augre: What is the method usually used to check if the signal is there or not?

Based on what I think you are trying to do - write an interrupt function (search for examples of attachinterrupt) and measure the the time it takes for the signal to change. If you get a time of 1ms then you are 'locked' on. (within the angle of the IR receiver which can be quite large, so read the data sheet of your sensor).

It is unlikely that this will work well with only one sensor(IR Receiver)

Those receivers often have a wide acceptance angle, so it might be a good idea to fit barn-door style baffles, or put them at the bottom of a short tube, so that the only way they can both "see" the source is in the straight ahead position.