Build a simple IR receiver that plugs straight into the microphone input of the computer. Then, using free software, you can analyze and decode waveforms of infrared remote signals. Once decoded, these signals can be reproduced.
Instead of using an oscilloscope for signal analysis, due to the low frequency of the IR bit stream, an ordinary sound card will be used to view the signal. The signal is amplified, filtered and demodulated by the IR receiver, so only the bit stream is sent to the sound card input. This is sampled at the usual audio rate and displayed in various software tools.
The IR adapter
To build the IR adapter we'll use a common receiver module. This is preferred over an IR diode because it minimizes the number of parts needed. More than that, it demodulates the signal. The raw signal is modulated over a 38kHz carrier.How the signal appears at receiver output |
The three pins of the module are the power lines (VCC and GND) and one signal output line. The working voltage is usually 5V, but newer modules tolerate 2.5 to 5.5 V. Here is the schematic of the simplest sound card IR adapter.
Infrared receiver audio adapter |
IR audio adapter built on breadboard |
You can build this on a PCB. See this post.
View the waveform
The simplest to use is Audacity. It is a cross-platform software that can record and display the signal.Audacity displaying an IR signal waveform |
Using San Bergmans' IR Remote Control page (use the top right menu to see each protocol) I was able to tell that this is some kind of NEC protocol. And it is inverted (that's normal, the receiver module did this). Luckily, in Audacity, you can go to Effect menu and choose Invert to fix it. Now, if I analyze this it has the following meaning:
IR waveform analysis and decoding |
Some other software solutions for viewing, processing and recording the signal waveform are Soundcard Oscilloscope (Windows only), Nethome Protocol Analyzer (cross platform) and (Win)LIRC (cross platform). Note that with all these you must first choose the audio input device. Always choose the highest sample rate possible and preferably mono input. Note that some Windows versions disable audio devices when nothing is detected plugged in.
Decode the signal
Decoding the signal can be performed with Nethome Protocol Analyzer, (Win)LIRC and SlyControl RCExplorer (Windows only). I'll emphasize on using LIRC because it outputs data ready for irplus, the Android remote control app.Here is how to use LIRC (and its Windows equivalent WinLIRC).
On Linux it's easy to install LIRC. Just run sudo apt install lirc in a Terminal on Ubuntu distros. You'll be prompted to choose your hardware. I couldn't get the receiver working in Ubuntu with the ALSA audio input source so I built a serial port transceiver like this. To record the signals open a Terminal and run (the configuration file will be created in the directory you are running irrecord from):
irrecord -d /dev/lircd test.cfgOn Windows just extract the downloaded archive and start winlirc.exe. Click OK at the error message and when the Setup dialog appears choose AudioCapture.dll plugin. Configure it with the right input and the maximum sample rate. Click the Create Config button and close the CMD windows that appears. Click OK at the error message and when prompted to open the Setup dialog again select Cancel. Now go to plugins folder and open WinLIRC.ini. You should see the audio configuration in this file. If it doesn't exist try to configure WinLIRC again by launching it. Here's my audio configuration:
[AudioInputPlugin] AudioDeviceName=Line in at rear panel (Blue) (R AudioFormat=65536 LeftChannel=1 Polarity=2 NoiseValue=16Now open a command prompt in the folder where winlirc.exe and irrecord.exe are and execute the command:
irrecord -d AudioCapture.dll ../test.cfgAll OSes
Follow on-screen instructions (press Enter a few times, then press and hold remote buttons and name them). After you finish open test.cfg with a text editor and find there the decoded bytes.
Reproduce the signal
Android
IRplus by Binarymode is probably the most versatile application of this type. Besides having a large database that you can contribute to, it can import LIRC files you recorded earlier. You can also edit straight from the app every button (command, text label and color). The default configuration files used by irplus are based on XML.irplus main screen showing an example remote control |
Import LIRC file in irplus |
No comments :
Post a Comment
Please read the comments policy before publishing your comment.