I had previously completed an IR-related project involving an antique protocol used with HP calculator printers informally called 'Red Eye'. In that, I (optionally) supported using a transceiver module intended for IrDA to detect RedEye (which is decidedly not IrDA) as a convenience, but it made me think about IrDA proper.
IrDA is an old wireless technology predating things like WiFi and Bluetooth (parts of it were absorbed into Bluetooth). It has been mostly deprecated but still has a niche following in some places where RF is not feasible, and also for some reason gas meters and scuba equipment.
A challenge for these niche markets is the lack of once ubiquitous adapters. Used ones can be found on auction sites, though you might have trouble finding drivers for them on modern OS's. And as a rare-ish product, they can also be expensive.
The most basic form of IrDA is 'serial infrared' or 'SIR'. It's scarcely more that connecting an LED/photodetector pair to a UART. The material differences being that the light is not 'on' the full bit period, but 3/16 of a bit period, and that '0' is indicated by light, and also due to crosstalk between receive and transmit, the scheme is half-duplex.
SIR is the bottom edge of an IrDA protocol 'stack', at the physical layer, abstracting most of the details of the hardware from the protocol. As such, once you've gotten this physical layer implemented, then it is possible to strap on existing protocol implementations on top of it, since they're just software. E.g., in Linux, you can use 'irattach' to strap the irda protocols onto a SIR device presented as a tty serial port. 'irattach /dev/ttyS1 -s'
You can bit-bang IrDA, but many microcontrollers' UART facility include an 'IrDA mode', which realizes the 3/16 bit time 'blipping' of an LED for transmit, and the reverse on receive, and usually also inhibits the receiver when transmitting. Beyond the initialization, you then just use the UART as usual.
For transmit, you scarcely need more than an IR LED and a resistor (maybe also a transistor if you don't have the current capability). The receive side is more complicated and needs amplification and some filtering will help. As such, it's much easier to use a 'transceiver module' that integrates all the above into a single package that you can directly connect to your microcontroller. These aren't especially cheap now, probably due to the reduced economies-of-scale, but they're had for about USD $5 in unit quantities. (You can also often find new-old-stock ('NOS') on surplus for half the cost.)
In this project, I use an inexpensive dev board for an STM32F103 processor affectionately called a 'BluePill', which can be had for about USD $3. It connects more-or-less directly to an IrDA module (also needed are a series-dropping resistor and two capacitors for bypass). So you get a USB SIR adapter for about USB $10 and time and effort of construction.
Note that being SIR, this is limited to 115,200 bps. This is sufficient for many applications, but will be slow for things like exchanging photos. There are things like MIR, FIR, and VFIR, etc., with higher bit rates, but these are not supported directly on the BluePill (or the transceiver modules) so I do not explore them.
I don't bother implementing the rest of the IrDA stack in this project -- that will be the subject of a separate activity.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.