Close

UART data via infrared

A project log for Badge for Hackaday | Belgrade Conference

I have the honour to design the badge for Belgrade Conference. Here it is! VoilĂ !

voja-antonicVoja Antonic 02/07/2016 at 23:132 Comments

There are several modifications on PCB layout: Anode drivers are not so disorderly scattered over ports A and C - now they are arranged in proper order over port A only. Sink driver SCT2024 outputs are arranged in the similar way. Also, USB mini-A connector is replaced by micro-B, which is much more common today (thanks, @Tom).

My favorite upgrade is based on one schottky diode D3, which enables semi-duplex serial communication over 940 nm infrared channel. In the first version, there was IR LED and IR receiver TSOP6240TTCD, with contains photodetector, AGC preamplifier, 40KHz band-pass filter and demodulator. You were supposed to apply PCM signal to infrared LED and to pick data by the receiver at the other side, but it consumes 100% of processor time and disables LED multiplex refreshing. But if you use UART to transmit and receive data, you will have the undisturbed display all the time.

The only problem is how to apply 40KHz carrier to infrared LED. You could use external AND gate to do so, but it is much simpler to use the diode which modulates the driver. This carrier can be permanently generated by Output Compare Module, so the complete communication is obtained using internal MCU peripherals.

With such a low carrier frequency, you can not obtain too high data rate - don't even try (at least with TSOP family) to get more than 600 Baud, which is 60 bytes/sec. But this is a small MCU, with very limited data memory, so you are not supposed to transfer megabytes of data. You will probably transmit and receive some short text for moving message display or your business card details, so one of two seconds will be enough.

I was experimenting a little, and results are quite satisfactory. It is very easy to obtain the good data transfer in one room, even when transmitter and receiver do not 'see' each other, especially if the walls are white.

Discussions

RoGeorge wrote 02/14/2016 at 13:50 point

Hi Voja,

The IR Tx should work with just an IR LED hooked between the DATA and CARRIER pins, with no transistor driver. If you reverse the diode, you get the NDATA instead.
:o)

It was working for me many years, as an IR RC5 TV remote, even without the series resistor. Current was limited by the AVR MCU pins drivers, but for production it might be better to keep the resistor. One more corner cut, the receiver is very unselective regarding the carrier frequency. All receivers from the TSOP1730 to TSOP1756 worked just fine, and about the same 4m distance, for the same 38 KHz carrier.

  Are you sure? yes | no

Voja Antonic wrote 02/16/2016 at 10:23 point

Hi George, 

You are right, it is possible to drive it directly, but IR LED needs high pulse current and it will overstress the output driver. Sure it will work fine, but in such public projects you have to take care about the possible admonitions of your audience, so the formally correct choice is painless for sure :)

  Are you sure? yes | no