I have multiple IR devices controlled by my Raspberry Pi:

  1. LED strip
  2. HDMI input switcher

I used irrecord/mode2 to build a config file and both devices respond properly to the raw codes I found. However, the LED strip also responds to the codes related to the HDMI switcher. Like, the strip will turn off if I send the code corresponding to the "1" button for the HDMI switch, it will turn red for the "2" button and blue for "3". It even responds to the original switcher's remote control, so I don't think there's a problem with the codes I'm sending from the Pi. I also tried messing with the sending frequency for the switch on the Pi by changing it to 36, 38, 40 and 42 KHz. In all cases both the LED strip and HDMI switch will respond. Use anything outside that range and the switch won't respond anymore.

The other way around (using the LED remote on the HDMI switcher) doesn't trigger anything though.

My questions:

  1. I always thought IR codes were unique to a particular (type of) receiver, so how come the strip responds to codes it shouldn't really respond to? There doesn't seem to be an overlap in the IR codes either. I'll add an example at the end but I'm not sure if that's actually within the scope of this subsite.
  2. Shouldn't every device be sort of "locked" to a certain frequency too? I can understand if something responds to signals sent at 35.9 KHz while it's using 36 KHz itself due to tolerance, but 36k vs 42k seems like a pretty big jump.
  3. Is there any way to make the LED receiver ignore things meant for the HDMI switcher?

If it matters in any way: the IR LED I'm using to send signals from the Pi is a 5mm Vishay TSAL7400 940nm, combined with a transistor.

Raw codes:

HDMI button 1

9339     4509      631      547      633      548
 632      544      649      537      633      542
 632      548      633      548      632     1634
 637     1638      634     1652      628     1638
 625     1633      636     1637      640     1647
 619     1638      632      549      633      548
 635     1635      631      548      633      549
 641      536      636      544      637      545
 639      540      636     1635      636      545
 636     1633      649     1628      636     1639
 627     1633      638     1636      635     1650

LED strip poweroff button

9032    4435     617     511     613     515
 612     515     613     519     609     511
 614     514     613     515     615     513
 614    1616     614    1622     603    1613
 618    1608     618     510     617    1614
 617    1609     617    1615     618     504
 619    1611     618     511     616     507
 618     510     620     522     603     511
 618     510     630    1596     617     511
 617    1609     620    1611     617    1609
 616    1614     617    1609     618    1608
  • 1
    \$\begingroup\$ IR codes are not unique between devices, and neither is frequencies. If that were the case, there would have to be some controlling agency that issued frequencies (that they would soon run out of). It's possible you found a device that simply has/responds to IR signals that are "fuzzy". \$\endgroup\$
    – Ron Beyer
    Oct 30, 2019 at 19:16
  • \$\begingroup\$ IR Codes are in some way unique to a device however it will use a protocol to send/receive these codes. Most simple and frequently used is the NEC protocol. When checking first the received portocol and than the value, it is possible to filter errors. \$\endgroup\$
    – Codebeat
    Oct 30, 2019 at 19:46
  • \$\begingroup\$ It would make universal remotes very difficult. \$\endgroup\$ Oct 30, 2019 at 23:08
  • \$\begingroup\$ @GeorgeWhite that's sort of what I meant with "unique per type of receiver". I thought that e.g. TVs have some codes that are the same across brands/models, such as volume up/down. Also, don't universal remotes have multiple sets of codes baked in so it may support a wider range of devices? Which is also why sometimes such a remote may not work at all. \$\endgroup\$
    – Sahbi
    Nov 1, 2019 at 19:15
  • \$\begingroup\$ @RonBeyer With "locked to a frequency" I didn't quite mean to imply there's a governing agency. I meant it only responds to codes sent using a particular frequency, such as 36 KHz. \$\endgroup\$
    – Sahbi
    Nov 1, 2019 at 19:16

2 Answers 2


IR is an analog encoded signal with an ancient protocol. It's designed with large tolerances due to interference, varying distance and battery power and reflections etc. The receivers strip anything it thinks is the modulating signal and passes along the data signal. If it was very tight it would result in poor reception and frustrated end users complaining to manufacturers.

Your average led controller is cheaply produced so will have sloppy coding. This may be a feature not a bug as again they want the most end user friendly product. The HDMI switcher is probably a better product hence its tighter response.

The NEC standard defines the protocol not the implementation. The specific codes are up to the manufacturers to implement and for the major producers are on a gentleman's agreement to avoid overlap. But there are limits due to bit length and number of products. It's not like usb where VIDs are supposed to be centrally managed by the USB IF.

You are also using a educated guesstimate of the IR codes used instead of actual programmed ones. Checksums could be ignored etc etc.

The only way to get the LED controller to ignore the hdmi codes is to isolate it. Either physically or logically. If you can't physically isolate it and use two IR blasters, and you can't reprogram it, then you can use a man in the middle approach. A microcontroller with both IR receiver and transmitter, programmed to receive a different code and translate it to your intended code, close enough to the led controller so the hdmi switcher can't see it. Or have it on the network like an esp8266, with the RPi controlling it via the network.

  • \$\begingroup\$ The MITM approach sounds interesting and I do have a bunch of different ESP boards, I'll have to mess around with that. =] I may not even need transistors for the IR LEDs if I can put them close enough to the receivers. \$\endgroup\$
    – Sahbi
    May 15, 2022 at 18:54

Shouldn't every device be sort of "locked" to a certain frequency too?

No, tolerances on carrier frequencies (in the receiver) are actually quite loose. Many devices use a simple 3-terminal integrated IR receiver1 that outputs a logic level signal that just indicates whether "carrier" is present or not. The only selectivity is provided by a bandpass filter inside the integrated receiver that typically has a bandwidth of several kHz.

1 Vishay is one popular vendor of such modules.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.