This Make project visualizes an IR frame and provides detailed IR protocol information for supported protocols from data received send by an Arduino (or other MCU).
The example setup uses an Arduino UNO with IR receiver. The Arduino runs an application developed in B4R using the rIRRemote library. The rIRRemote library is based on the IRremote library with enhancements. Following protocols are supported:
UNKNOWN,PULSE_WIDTH,PULSE_DISTANCE,APPLE,DENON,JVC,LG,LG2,NEC,NECEXT,ONKYO,PANASONIC,KASEIKYO,KASEIKYO_DENON,KASEIKYO_SHARP,KASEIKYO_JVC,KASEIKYO_MITSUBISHI,RC5,RC6,RC6A,SAMSUNG,SAMSUNGLG,SAMSUNG48,SHARP,SONY,BANG_OLUFSEN,BOSEWAVE,LEGO_PF,MAGIQUEST,WHYNTER,FAST
The Arduino sends received IR data as a Json message (function DumpToSerial) over the serial line to the connected device running the B4J application: Example Protocol NEC pressing Key 9 on the Remote Control
{"protocol":"NEC","address":"0","command":"5A","repeatperiod":48925,"repeatcount":0,"repeat":0,"bits":32,"flags":0,"rawdata":2774204160,"pulses":[{"level":1,"duration":8850},{"level":0,"duration":4500},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1700},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":550},{"level":1,"duration":600},{"level":0,"duration":1650},{"level":1,"duration":550},{"level":0,"duration":600},{"level":1,"duration":550},{"level":0,"duration":1650},{"level":1,"duration":600}],"pulsecount":67,"frameduration":67900,"rawticks":[177,90,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,33,11,34,11,33,11,34,11,33,11,34,11,33,11,34,11,12,11,33,11,12,11,34,11,33,11,12,11,34,11,12,11,33,11,12,11,34,11,12,11,11,12,33,11,12,11,33,12],"rawtickcount":67,"headermark":0,"headerspace":8850,"len":68}
The application is developed with B4J as a B4XPages application with XUI Views.
- Parse received Json message containing IR protocol data.
- Clear pulse visualizer at top (green+blue bar = helpful for timing visual cues).
- Frame Sequence table with duration, level, label.
- Protocol-specific decoded fields (address, command, raw data, etc.) table.
- Protocol detection e.g., NEC.
- List of received protocol data, select-able to show the data.
- Arduino UNO
- Keyes KY-022 Infrared Receiver Module, Carrier Frequency 38KHz, Reception Distance 18m, Reception Angle +/-45°, Ambient Light Filter up to 500LUX.
- Remote Controls tested (IR Protocol): KEYES (NEC), TEDi (NECEXT), SONY (SONY), LEGO-PF (LEGO-PF, Pulse Distance), Philips (RC6), SAMSUNG (SAMSUNG).
- Arduino: B4R 10.0, additional library rIRRemote 1.00 (based on IRremote 4.4.1.
- PC: B4J 10.60 (64 bit), B4XPages, additional libraries jSerial, Json, jRandomAccessFile, ByteConverter, XUI Views, DesignerUtils.
The archive make-ir-frame-visualizer-NNN.zip contains the sub-folders source B4J & B4R and libraries B4R. From the zip archive, copy the content to a folder of choice. The additional B4R library to be copied to the B4R additional libaries folder.
- Check Unknown to show not recognized, i.e. UNKNOWN protocols.
- If after clicking once on a Remote Control no data is displayed, then try again else check Unknown and see what happens.
- Clicking too long on a Remote Control shows the pulse(s) as repeats, which have f.e. a frame with 3 pulses (tested with NEC).
- Serial line disconnect is handled by the asyncstream (library jRandomAccessFile).
- The frame sequence table field Label is not showing all info yet.
- The frame pulse durations are set by the IRremote library and adopted by the rIRRemote library.
- To learn more about IR protocols recommend to read IRremote library readme.
- Property Pulse list with chart coordinates which can be used to show pulse info when clicked on the pulse in the chart.
- Address & Command bits (protocol dependend) in the tableview Frame Sequence.
- Rework the frame patterns to properly show as label in the frame sequence table.
- Developer(s) of the IRremote library (License up to the version 2.7.0 GPLv2, from version 2.8.0 MIT).
- Anywhere Software for providing the B4X suite of development tools plus the B4X community for sharing solutions&hints.
- Anywhere Software Forum member klaus for providing the base xZigZagChart custom view.
GNU General Public License v3.0.