Easy infrared UART data link

Posted on Wednesday, August 26th, 2009 in data transfer, techniques by Ian

Here’s an easy way to transfer data with an infrared LED and an infrared remote control demodulator. The example uses an Arduino, but the technique will work with any microcontroller.


The transmitting microcontroller powers an IR LED from a pin configured as a 38KHz pulse-width modulator. Another pin configured as a 2400bps UART switches the IR LED ground pin on and off. This converts the standard UART output into a train of rapidly-blinking light pulses.

The receiver is an IR remote control demodulator connected to a 2400bps UART input pin. The demodulator is specially tuned to detect IR light pulses at 38KHz. It converts the transmission back into a 2400bps UART bitstream.

How would you use a line of sight data link?

Via Make.

This entry was posted on Wednesday, August 26th, 2009 at 4:00 pm and is filed under data transfer, techniques. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

3 Responses to “Easy infrared UART data link”

  1. genn says:

    My IR detector is receiving some garbage values continuously. How to avoid this

    • IP says:

      Although the receiver should be fairly immune to ambient light, this might be your problem. Since this noise comes in as DC, and you are looking for a pulsed signal, you can AC couple your receiver with a capacitor on the ‘out’ pin. Something ~0.1uF will give you an impedance of ~41ohms to a 38KHz signal.

      The output of this receiver is an internally pulled up connector, so a 41ohm output impedance shouldn’t do much of anything in terms of attenuation if you are driving an Arduino or some other MCU…

      Hope this helps!

    • dakini says:

      Exactly… This is what i am also getting. How did you resolve it Sir???

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • Joe Desbonnet: Ya, I can recommend the low melting point solder. I used brand 'ChipQuik' and it's amazingly easy to use.
  • Jerome: I need a new BusPirate for the Fablab ;) Many thanks!
  • Max: Seems like an unexpectedly violent way to remove the chip indeed. A hot air station should of course do the job just fine, but in...
  • jose: Part removal described here is pure butchery, the cheapest hot air station will do a fast and clean job removing the QFP, heat air to...
  • Cody: Yes please