An IR receiver, 68 milliseconds, and about 40 lines of code
How to read codes from (many) IR remote controls with as little code as possible
Annoyed that Apple dropped IR remote support from the MacBook, a developer built a minimal decoder for NEC-protocol remote codes using a cheap Vishay demodulator and a Seeed Xiao nRF52840 board. The firmware times the marks and spaces of each 32-bit code, divides by 512 instead of 562.5 microseconds to keep the math simple, and maps seven learned buttons to USB HID keypresses for volume, mute, play/pause, and captions.
I need to re-invent every wheel.
- MatthiasWandel
I actually did this too, with a lot of different remotes, in micropython on a plain pi pico -- quite fast enough.
Different remotes use different formats, a lot of them repeat the actual data twice.
Most interesting were the remotes for our minisplits, which tranmit the whole state for the minisplit, followed by a second message indicating half degrees -- presumably, older minisplits could only do whole degrees so they added a second message.
Transmitting the words is more challenging, the IR LED needs to be pulsed (modulated) around around 38 khz, and there are potentially different wavelengths. So far have not been able to get our mini splits to accept a code I send to them, I suspect my LED wavelength is wrong.
- cf100clunk
I was a happy user of Harmony IR all-in-one remotes for many years, but alas some time after the takeover by Logitech they gave warning that they would end their IR remote control product line. Open source projects like Concordance and Congruity that had popped up soon died off.
https://members.harmonyremote.com/EasyZapper/
I implored Harmony/Logitech many times over to open source their vast database of IR codes, or at least make it available. Now it seems to have been squandered, meaning that a project like this OP one has to use a learning-mode per device and cannot select from almost every known consumer electronic IR code that Harmony enjoyed. Does such a publicly available database exist? Many cheap all-in-one IR remote controls came with printed tables of numeric codes, but those were not the actual IR codes themselves and were not universally applied across brands.
Nowadays a Sofa Baton (IR & Bluetooth) remote does the job.
- Onavo
Here's a challenge for the author: QAM256 and error correction. You can easily reinvent LiFi at home.