WinLIRC iconWinLIRCWinLIRC icon

Audio Reciever

The details for this type of reciever can be found on the LIRC homepage. The idea is, the reciever plugs into the microphone in, or line in on the sound card. The circuit itself is very simple.

My homebrew reciever looked like this.

The circuit needs a 5 volt line and a GND line. Conviently USB has those 2 voltages, so I butchered an old USB cable and soldered them to my reciever. If you want to do the same, all you need to know is, the red cable on USB is 5 volts, and the black is ground. The data cables are other colours.

After soldering my reciever I hooked it up to my sound card and tested it with some remotes. The output, when recorded looked something like this.

Originally I ported the audio asla code from the LIRC project, but I wasn't getting good results with it. It was merging inputs somehow and not giving me any reliable results. The code seems overly complicated and made worse by the fact all floating point code is done with integer maths, bit shifting etc, which makes the code barely readable. I suppose that's for processors that lack floating point units (ARM ?). Anyway, I deleted all the code and started entirely from scratch. Examinging the data in an audio editor revealed some interesting things. Firstly the resting (no signal) point was at 128. The audio is sampled at 8bits so 128 is the midpoint. The signal on point (when my volume is set to the max) reaches a consistent 255. Interestingly when the signal goes from on ON position to the OFF position it falls below the 128 point every time, by quite a way. I am not sure the reason for this as my electronics knowledge is somewhat thin, but it is important to note. I also noted that the value doesn't just fall below the line, it also rises above it sometimes before stabilising at 128 again.

With this knowledge I came up with a very simple and seemingly reliable way of decoding the signals. The midpoint plus a noise stabilisation value of say 12, anything above this would indicate an ON signal, and anything below this value would indicate an OFF signal. This algorithm might prove too simple for some more advanced versions of this circuit, but for now it's fine. Perhaps a configurable zero point might address these issues in the future.

Copyright (C) 2010 Ian Curtis