Easy infrared UART data link

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.

Join the Conversation


    1. 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!

Leave a comment

Your email address will not be published. Required fields are marked *

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