Use a cheap IR remote as a PC remote control. An Arduino reads IR signals and forwards them over serial to a Python server, which maps them to keyboard shortcuts, commands, or app launches — with swappable profiles for different apps.
IR Remote → Arduino (IR receiver) → Serial (USB) → Python server → keyboard/commands
Profiles let you switch the remote's behaviour on the fly (e.g. generic PC controls, VS Code debugger, browser, Netflix).
- Arduino (tested with Uno/Nano)
- IR receiver module (data pin → pin 8)
- Any NEC-protocol IR remote
- Windows PC
- Python 3
- Arduino IDE
pip install -r requirements.txt- IRremote (≥ 4.x)
- Flash
src/client/client.inoto your Arduino via the Arduino IDE. - Connect the Arduino to your PC via USB.
- Update the serial port in
src/main.pyif needed (default:COM3):arduino = serial.Serial(port='COM3', baudrate=9600, timeout=.1)
- Run the server from the project root:
python src/main.py
Point the remote at the IR receiver and press buttons — the mapped actions will fire on your PC.
Edit config/profiles.yaml to customise button mappings. Each profile has a name, description, and a map of IR codes to actions.
| Type | Description | value |
|---|---|---|
key |
Press a key or shortcut | list of key names |
cmd |
Run a shell command or open a file/app | string |
profile |
Switch to the next profile | (no value needed) |
Key names follow the pynput keyboard reference. Single characters (letters, digits, symbols) can be used directly.
profiles:
- name: pc
description: Generic PC controls
map:
ED12FF00:
type: key
value: [media_volume_up]
description: Vol+
FF00FF00:
type: cmd
value: "shutdown -s"
description: Power
FD02FF00:
type: profile
description: Switch profileRun the server and press buttons on your remote — unmapped codes are printed to the console, so you can copy them into your config.
Note: The
cmdtype runs shell commands directly. Only use config files you trust.
MIT