Arduino beacon for IR Seeker v2 (Mindstorms NXT Sensor) – Pulse IR at 38Khz Carrier and 1200 Frequency

arduinoinfraredModulationpulsesignal

I hate to ask a question like this, that is kinda just like "give me the code" but seriously. I've tried reading up on it everywhere, and I just don't seem to get a thing of having both a carrier signal AND a frequency.

I have the IR Seeker V2 ( http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NSK1042 ) for my Mindstorms NXT, and I want to make a base that it can home in on to recharge. I've seen a couple of 555 Timer designs floating around the internet, but my stockpile of 555 timers are out and we don't have any "part shops" in DK, so I will literally have to wait WEEKS for them to arrive. So I thought: "The Arduino can control a TV at 38KHz, so why not do this?"

Can someone point me in the right direction, or maybe just provide me some code (yeah I know, but I'm seriously LOST!), for how to do this?

I need to flash the IR LED at 1200Hz on a 38KHz carrier signal, to get the sensor to read it clearly!
Actually it can be anything from 600Hz to 1200Hz, but 1200Hz is the prefered as far as I can see.

Best Answer

The Arduino can be used to transmit the 1200 Hz signal with 38 KHz carrier required, using any of the several Arduino IR libraries out there. One such is described in A Multi-Protocol Infrared Remote Library for the Arduino.

Use the raw send mode of this library, which takes duration of on and off ("mark" and "space") in microseconds. Specify a sequence of equal mark and space duration, for the desired 600 to 1200 Hertz signals: That would be between 417 and 833 microseconds of mark and of space.

If you want it to be close to 1200 Hz the 417 number applies.


Regarding the matter of having both a carrier frequency and a code frequency: Typically, implementation of such sensors uses "TV remote sensor" IR receivers designed for a specific carrier frequency, such as the Vishay TSOP and TSSP integrated IR sensor modules, e.g. TSOP1738.

TSOP1738

This part detects IR signals coming at it with a carrier frequency of 38 KHz, and ignores all baseline (no carrier) IR signals or with carriers of significantly higher or lower frequency. This means stray IR such as from heat sources or daylight, or signals from a remote control other than the one of interest, will be ignored.

Similar modules are available for other carrier frequencies as well:

TSOP17xx modules

The output of this part is low when a 38 KHz signal is present, high when it is not (inverted logic), and this resultant pulse stream is typically used to carry a remote control protocol.

Some examples are the Phillips RC-5 protocol (which originally was designated for 36 KHz carrier, not 38 KHz) or the Sony InfraRed Control protocol (SIrC) used in many TVs and other consumer devices.

The sensor in the question most likely uses a device like the TSOP1738 or its smaller SMD equivalents, for its ubiquitousness and low cost. It tests the output of the part for a pulse rising (or falling) edge at 600 to 1200 times per second, to identify the source as a designated one, and acts upon it if such is found.


A signal processing way of looking at this is:

  • Pass incoming infrared through a colored plastic filter that passes only Infrared, not visible light.
  • Use a photodiode or similar to convert this incident IR light to electrical signal.
  • Pass the resultant signal through a very narrow band-pass filter of 38 KHz, thus ignoring any signal with a different carrier frequency
  • Integrate the resultant output, i.e. peak-detect it
  • Pass this resultant signal through another not-so-narrow band-pass filter of 600 to 1200 hertz, thus ignoring any signals that do not fall within this range
  • If a resultant signal is found by integrating this output, then indicate a "success" condition

For further understanding perhaps my other answer here may be useful, it includes a detailed analogy for the working of such IR devices.

Related Topic