# High-speed Infrared UART link with photodiode

I need short-distance (about few centimeters) wireless IR UART link with 250k+ baud. I tried to use phototransistor (assume Q1 is phototransistor). Q3 is used to prevent inverting signal.

simulate this circuit – Schematic created using CircuitLab

With this schematic I reach 57600 baud with Arduino. Now I am looking for photodiode schematic and I hope that it can be faster.

I found out tipical application with transimpedance amplifier. Something like this:

simulate this circuit

Is this suitable for my application? What about environment light adjustment? Also, can I use this circuit with unipolar supply?

Maybe comparator will be more suitable for my application, because I need only binary signal and don't care about amplifier linearity etc, but I have no idea how to use comparator instead of op-amp in this chematics.

UPD #1:

1. I replace R1 with 100 Ohm and reach 115200 kbit/s
2. I know about IrDA, but environment light isn't a really big problem in my case. I can protect optocoupler from environment light.

It is a bit more challenging. You need to protect your channel from variations in ambient light, which can be horrendous. That's why IrDA (infrared digital communication alliance) uses modulated light and a sophisticated automatic gain control system. Current IrDA standard extends the data rate to 4 Mbps, see the article.

The IrDA standard has successfully progressed from IrDA-1.0 (115.2Kbps) to IrDA-1.1 (4Mbps) in the short two and half years. There are many components, adapters, software and mobile systems available for the IrDA-1.0 standard on the market now. The same will happen soon for IrDA-1.1 standard with the optoelectronic, analog and digital interface ASIC components already on the market.

Today at IrDA 1.4 there are "medium" IR (MIR) transeivers (1.152 mbps) TFDU5307, FIR (fast infrared 4 Mbps) transceivers like TFDU6300 which are still available.

There were plans for VFIR (16 Mpps channels), but it looks like this direction didn't get enough industrial traction. VFIR transceiver TFDU8108 is however available.

• Important to note that these modules receive the IRDA pulses, but do not encode/decode the data to uart - that took a separate chip. You could use bit padding as I describe below, and some mcu eg PIC have modulation hardware that can connect internally to the uart and make/decode IR pulses – Henry Crun Aug 16 '18 at 3:27
• @HenryCrun, sorry, it was long time ago when I was dealing with IrDA, forgot a lot of things. They are using a kind of pulse-position-modulation, see vishay.com/docs/82513/physical.pdf – Ale..chenski Aug 16 '18 at 3:35
• For application and top-stack details this note from Agilent might be useful, farnell.com/datasheets/306539.pdf – Ale..chenski Aug 16 '18 at 3:39

No not really, phototransistors are very slow, not enough gain, not ac coupled, LM358's are far too slow etc etc.

Perhaps look at IRDA modules (have photodiode and amplifiers built in) and chips.

IRDA uses a pulse encoding scheme, not simply putting uart data into the LED.

This LT1328 data sheet gives you a good idea of how the coding works.

It also notes that you can put raw uart NRZ through, for shorter distances with poorer interference immunity.

The fundamental issue is that you need lots of edges, and when your uart is sending 00 or FF, there aren't enough. You can improve on this by not using all 8 data bits, but having one or more padding bits inside the byte to increase the number of edges.

For example you can send 4 data bits per uart byte with each being a 1/0 pair So to send a 1 you use 10 and to send a 0 you use 01 Thus 1010 is expanded to uart signal 0(startbit) 10 01 10 01 1(stopbit)

If you do this the signal will go happily through AC coupled amplifiers and data slices as it has lots of edges, and equal numbers of 1s and 0s (DC balance), and you can probably use it directly from the IRDA RX into the uart, without the encoder/decoder.

You might even get something as crude as this to work over short ranges, using 74hcu04 or 74hc04.

simulate this circuit – Schematic created using CircuitLab

Comments on values of R1,R4 welcome, I haven't thought too much about it.

Note that when there is no signal expect digital noise. Also notice lots of power supply filtering - it is absolutely needed.

• @ Henry The IRDA standard requires the system to work with IR currents out of the photodiode from 100 nanoAmp to 100 microAmp.(from what I remember). – analogsystemsrf Aug 16 '18 at 5:24
• @analogsystemsrf OPs req is not actually IRDA, just the modules offer an integrated rx. "few centimeters wireless IR UART link with 250k+ baud" – Henry Crun Aug 16 '18 at 5:27