NEC-like Infrared Protocol libsigrokdecode Decoder
This is a libsigrokdecode decoder for the R05D infrared remote control protocol, commonly used in certain air conditioner and HVAC systems. The protocol is similar to the standard NEC infrared format but includes specific timing and data structure variations.
This decoder is designed to be used with PulseView, sigrok-cli, or other tools in the sigrok ecosystem for analyzing logic analyzer captures (e.g., from Saleae, Logic, or similar devices).
- ✅ Decodes R05D pulse-distance infrared protocol
- ✅ Detects leader codes, data bits, and separator pulses
- ✅ Parses and annotates:
- Bytes (in hexadecimal format, e.g.,
0xB2) - Address fields
- Command bytes (fan speed, mode, temperature)
- Temperature values (where applicable)
- Special separator and idle timeouts
- Bytes (in hexadecimal format, e.g.,
- ✅ Supports both active-low and active-high signal polarity
- ✅ Detailed debug logging (configurable)
- ✅ Tolerance-based timing matching for robust decoding
- sigrok-cli or PulseView
- A logic analyzer (e.g., Saleae, DreamSourceLab, etc.)
- Captured IR signal on a digital channel
- Clone this repository into your local sigrok decoders directory:
git clone https://github.com/your-username/ir_r05d.git- Copy the decoder to your sigrok Python decoders path:
# Typically:
cp -r ir_r05d ~/.local/share/sigrokdecode/decoders/💡 On some systems, the path may be:
/usr/share/sigrokdecode/decoders/or inside your Python site-packages.
- Restart PulseView or reload decoders in sigrok-cli.
- Load your logic capture (e.g.,
.srfile). - Select the IR channel.
- Go to Decode → Add → Find
IR R05Din the list. - Configure options:
- Polarity: Choose
active-low(default) oractive-high
- Polarity: Choose
- Apply and view annotations for:
- Bits
- Bytes (
0x..) - Address, Command, Temperature
- Warnings (e.g., idle timeout)
sigrok-cli --input-file capture.sr \
--protocol-decoder ir_r05d \
--pd-option ir_r05d:polarity=active-low \
--output-format proto| Field | Duration (ms) | Description |
|---|---|---|
| Leader Low | ~4.5 ms | Start of transmission |
| Leader High | ~4.35 ms | Follows leader low |
| Bit Low | ~0.6 ms | Common low period for data bits |
| Bit 0 High | ~0.5 ms | Short pulse = 0 |
| Bit 1 High | ~1.6 ms | Long pulse = 1 |
| Separator | ~5.11 ms high | Appears between data blocks |
| Idle Timeout | ~30 ms | End of packet detection |
Data is transmitted MSB-first, 8 bits per byte. Typical packet structure includes:
- Device address
- Command byte(s)
- Fan speed, mode, temperature
- Checksum or repeated data
To enable verbose debug output, edit the decoder source:
DEBUG_VERBOSE = True # Set to False to disable
LOG_FILE = None # Optional: '/tmp/ir_r05d.log'Debug logs will show:
- Edge detection
- State transitions
- Timing comparisons
- Parsing steps
This project is licensed under the GNU General Public License v2 or later (GPL-2.0+).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
See <http://www.gnu.org/licenses/> for full license text.
Contributions are welcome! Feel free to open issues or pull requests for:
- Timing improvements
- New command mappings
- Support for additional devices
- UI/UX enhancements in annotations

