How to Decode an Infrared Remote
Brainlink contains an infrared signal receiver that, paired with computer software, allows you to quickly capture, analyze, and store the signals from an IR remote control. It can take as little as 5-10 minutes to decode an IR remote. This tutorial will cover the process for doing so; to read more about the theory behind IR signals, check out our IR Primer.
1. Avoiding IR Noise
IR signal receivers are sensitive to all sorts of noise - fluorescent lights, computer monitors, and direct sunlight can all cause inaccurately captured signals. For this reason, we suggest that you move to a dark cave while capturing IR signals with Brainlink. Or just cover the Brainlink with a box, cut a hole in the box, and put the IR remote's transmitter through the box when capturing a signal.
2. Device Files
Device files encode the signals from a device's IR remote in a format that Brainlink can use to replicate those signals. They are used by Brainlink's Java library. The purpose of all IR capture is to store the captured signal data in a device file.
Device files come in two flavors, encoded and raw. Encoded device files contain all of the data necessary to initialize Brainlink's IR transmitter in the same format as the device's IR remote. Signals are then stored in data format - representing the signal data as bytes. Raw device files contain no initialization data; instead, they contain signals in time format. Each bit is stored in terms of the actual time that bit causes the signal to go high and low. This means that each bit of information needs to be stored as 4 bytes. Therefore, raw signals are 32 times as data intensive. In both cases the data from a device file needs to be transmitted to Brainlink over the bluetooth link, so raw signals take 32 times as long to transmit. For this reason, we suggest you attempt to create encoded device files first.
3. The Signal Analyzer: Creating an Encoded Device File Quickly
To quickly analyze signals and store them to an encoded format device file, we suggest using the Signal Analyzer utility. This utility has a fairly high success rate at automatically analyzing infrared remotes. If the analyzer fails on the first try, try a few more times with a few different buttons on the remote, ensure you have removed possible causes of noise, and if it still fails, sigh and be glad that we have provided several backup solutions.
4. Plan B: Analyze it Yourself
The signal analyzer displays all of the data to allow you to analyze the signal yourself (you may want to check "Display Signal Times"). This requires a good understanding of the theory behind IR signals, as well as a slightly masochistic personality. You can create an encoded device file using the File Writer utility.
5. Plan C: Create a Raw Device File Instead.
If the signal analyzer doesn't seem to work and your eyes bleed staring at the data the analyzer spits out, you can create a file that simply stores the timing data of the captured signal instead. Just use the Raw Signal Capturer to capture IR signals and store them to a file.
6. Plan D: Store a Signal to EEPROM
You can store up to five signals in a Brainlink's EEPROM using the Brainlink Command Panel. The advantage of doing so is that you don't have to analyze the signals, but you also can avoid the time necessary to transmit the signal over bluetooth. The disadvantage (besides the obvious memory limit) is that the stored signals are not stored in as portable a format - you can't transmit your Brainlink instantly to your friend 3000 miles away. Also note that the API method calls to trigger transmission of these signals are different from the typically used "transmitIRSignal" call.