My first exposure to LIRC, and PC based IR control in general, goes back quite a few years to a time when I was using an infrared receiver connected via serial to control my MythTV installation.
While serial infrared transmitters are no doubt still being used, availability of serial ports has generally always been limited to one socket on a PC with optional expansion with additional PCI cards – the limit on this is determined by the availability of PCI slots on the motherboard and serial expansion generally isn’t an option with a standard laptop without using up the PCMCIA slot if the laptop has one. However as technology has progressed and the size of connections reduced, serial is probably now considered quite uncommon on a PC, instead favourable connections such as USB which are smaller, faster and allow for multiple devices on with just one port have become mainstream.
There is a maximum of 127 USB devices that can be attached to any one USB host controller, so the potential for expansion is there to cover the controlling of a considerable number of devices with USB IR transmitters. The following diagram illustrates how the controlling of three devices could be achieved in my theoretical model of equipment installation with an additional receiver for learning new codes.
USB is hot pluggable meaning devices can be inserted and removed without any disastrous side effects so any USB infrared device can be removed and allocated to another controlling machine at any time. It would, for example, be sensible / more cost effective to have one receiver module as a shared resource that is physically swapped between a number of machines to learn new IR codes from which the created drivers could be pushed to the controllers where needed.
With this in mind, the obvious place to start was to look for IR transmitter (and ideally receiver) hardware that was USB based. Having scoured the internet for quite some time for information on this, I have put together the following price comparison table of USB related IR products.
Price comparison of USB IR products (all pricing is listed in manufacturer’s native currency)
Although not really suitable for the project (due to cost and veering away from control via PC), other manufacturers with products worth a mention are:
All of whom produce a variety of infrared related control products, including IR distibution units, IR over IP and a variety of wired emitters with attention to detail and excellent build quality. I’ve had experience with Keene electronics IRUW emitters and Xantech’s designer emitters (the blinking ones are quite handy to save getting a camera out to confirm transmission of the signal) and haven’t had any issues with these in the past.
USB IR product suitability
Iguanaworks product provides 2 x 2.5mm jack sockets to attach wired emitters to so this would be an option to consider. Iguanaworks online support appears to be very good with detailed instructions on configuration of their devices and troubleshooting. With Iguanaworks selling individual and dual wired emitters, it would in theory be possible to control up to 4 devices (2 channels, two emitters per channel) from one transceiver for $60 (though could be cheaper if you make your own wired emitters). This is assuming the signals being sent to one channel (two emitters) were unique enough so as not to trigger actions on both devices when only one is intended to be controlled – explanation to follow in my next post.
Unfortunately however Iguanaworks product is prohibitively expensive, adding multiple infrared transmitters would see a significant increase in cost and when factoring in the wired emitters and international shipping costs and tax, this adds up to quite an expensive control system just for infrared control.
The USB-UIRT components are housed within an enclosed casing which didn’t meet the requirements of a low spill and physically small emitter head.
USB-IR-Boy’s option is cheap, doesn’t include a transmitter and isn’t quite what I was looking for in terms of size – without some additional design work.
The IR Blaster products interested me as the style of the transmitter is exactly what I had been looking for. The description of the device stated that the design was based on a project started by Albert Huitsing which was documented in one of Albert’s blog posts. Having got my hands on a transmitter, and working through Albert’s blog I was able to successfully configure LIRC to send IR commands and control a TV on my desk at work.
Experimenting with FTDI
Although it is closest in terms of meeting the requirements, the IR Blaster products still seemed a bit too expensive at $24 (£15.48) for a transmitter and $20 (£12.85) for a receiver, plus shipping and tax. I decided to go back to Albert Huitsing’s designs, from which the IR Blaster is made, and found that the hardware uses merely a FTDI cable, an IR LED (and optional IR receiver). So how much would it cost to put one of these together myself?
Albert’s design uses a pre-made FTDI cable with an IR LED and receiver attached to the connector block. It looked a bit untidy but I’d seen that IR Blaster had used a PCB version of the same FTDI product and attached a wired LED to the end which is cheaper than using the pre-made FTDI cable.
I’d acquired a TTL-232R-5V-PCB and had a spare wired emitter from Keene electronics lying around. I removed the 3.5mm jack from the emitter and soldered the emitter to the PCB as per Albert’s design and have been using this for a good few weeks during testing without any issues at all. All devices I’ve wanted to control have worked and using xmode2 with a receiver to compare the signals I’m sending via my transmitter with LIRC compared with those from the original remote, the results have been very close and certainly accurate enough.
I was intrigued to see how cheaply I could replicate this, as the Keene emitters (while very neat and well made) cost around £5.99 + delivery. I’ve started looking at alternative emitters and have opted for something similar in specification to some IR receivers that I have used in the past (Vishay TSOP38238) and found that the Vishay TSUS4300 seemed to be a pretty close match. Initial tests with this are also looking positive, I’m able to control the same devices as with the emitter from Keene electronics and although it doesn’t have the emitter lens cover it still looks reasonable and is smaller in size.
I have an account with Farnell (onecall) and although I already these parts I priced them up to see how much it would cost to replicate:
Manufacturer |
Product |
Quantity |
Price (inc VAT) |
FTDI |
TTL-232R-PCB |
1 |
£11.76 |
Vishay |
TSUS4300 |
1 |
£0.11 |
Total |
£11.87 |
For £11.87 ($18.40 / €14.00) – add the additional cost of some two conductor multiple strand cable (maplin electronics do some striped miniature speaker wire at 49p per metre which will do) and a very small amount of solder, which I had lying around, I would be able to build myself a relatively cheap infrared transmitter.
That’s only $5.60 cheaper than buying one from IR Blaster?
I’d saved on international shipping and tax as well, but the big win is that I could, in theory add an IR receiver (Vishay TSOP38238) at a cost of £0.44 which would turn the device into a USB IR transceiver for a total of £12.31 ($19.14) – plus standard delivery – a pretty good result looking back to the requirements I had started out with.
So how can LIRC be used to drive multiple USB transmitters?
Part of the LIRC documentation covers the use of multiple, different devices and guides the user through this. However it didn’t seem obvious, and perhaps isn’t possible, to configure multiple devices from one lircd instance so the next logical step was to run multiple instances of lircd, each one targeting a specific FTDI device. This approach would actually work to my advantage and provide greater flexibility in that I could have multiple instances of lircd for different tasks, some for learning and some for transmitting via devices that are all connected to one PC.
Quick update – It appears that running multiple instances of lircd is exactly how debconf on Ubuntu (currently using 12.10) works when selecting different transmitters and receivers, highlighted in the following image: