How do I send signals from a 38 kHz Vishay's TSOP series IR receivers to an Arduino and make the Arduino act accordingly(eg. move a motor)?

  • \$\begingroup\$ Do you want to receive/decode remote control commands or is this on/off as in obstacle detection? \$\endgroup\$ – stevenvh Nov 28 '10 at 8:26
  • \$\begingroup\$ It's on/off as in obstacle detection. \$\endgroup\$ – gomek Nov 29 '10 at 3:27
  • \$\begingroup\$ I just realized that you also asked this question: electronics.stackexchange.com/questions/7208/… I guess my answer doesn't really help here. Apologies. \$\endgroup\$ – mjcarroll Nov 29 '10 at 6:47

The IR receiver will output a high or low level depending on the presence/absence of the 38kHz carrier in the received IR signal. The scope screenshot shows what that looks like in a typical remote control signal. The top trace shows the signal as seen by the IR-photodiode, the first component in the receiver chain. You can see intermittent bursts of the 38kHz carrier. After this signal is demodulated the pulses of the RC command (in this example RC5) show up, see bottom trace.

alt text

Now this is when you send data pulses like a remote control would. You will send the 38kHz signal continuously, so the receiver will see the carrier continuously, or not at all. In the former case the output of the receiver will be high, otherwise low. You just connect this signal to an input pin of the Arduino and test the level. A high level would mean an obstacle reflects the transmitted signal to the receiver, a low level means the way is clear.

(The scope screenshot was taken from my webpage on RC5)

| improve this answer | |

While there isn't an Arduino library available for this type of sensor, there are a few resources that you may find useful.

You can buy the sensor from SparkFun along with a breakout board. Keep in mind that these are very small, and you'll have to be careful when hand-soldering them.

As far as the software aspect, there is a project on tinkerish.com that has some AVR code (the chip that the Arduino is based on) for using the interrupt pin when receiving data from the IR receiver. In the example, he is using the INT1 external interrupt on the Arduino to receive the data, and processing the data in an interrupt included in his main.c file.

You should be able to duplicate this functionality using the Arduino software.

There is also a second project in pure Arduino, here. This example is using the hardware serial port on the Arduino to grab data off of the IR signal, and is unpacking the data in the getRC5Key function.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.