---
title: 'IR remote control (Pi Zero + FLIRC + Node-RED)'
url: 'https://www.handtrixxx.com/en/wiki/guides/ir-remote-control'
markdown: 'https://www.handtrixxx.com/en/wiki/guides/ir-remote-control.md'
lang: en
date: '2022-12-03'
description: 'IR remote control (Pi Zero + FLIRC + Node-RED) Verified: December 2022, built and in continuous operation since; prices and shop links are as of 2022. A plain infrared remote drives a smart home: IR buttons arrive at a Raspberry Pi Zero W with a FLIRC USB receiver, are mapped to keystrokes, and a t…'
---

#  IR remote control (Pi Zero + FLIRC + Node-RED) 

*Verified: December 2022, built and in continuous operation since; prices and shop links are as of 2022.*

A plain infrared remote drives a smart home: IR buttons arrive at a Raspberry Pi Zero W with a FLIRC USB receiver, are mapped to keystrokes, and a two-node Node-RED flow forwards them in real time (websocket) to the home automation – no cloud, no subscription, any IR remote.

![The assembled setup](https://www.handtrixxx.com/user/pages/wiki/01.guides/ir-remote-control/02-ir-overvall.webp)

## Hardware

![Pi Zero W kit](https://www.handtrixxx.com/user/pages/wiki/01.guides/ir-remote-control/03-pizero-kit.webp)

| Part | Notes | Cost (2022) |
|---|---|---|
| Raspberry Pi Zero W + case | suited because load and power draw are tiny: 2.3–5.0 V × 100–140 mA ≈ 0.23–0.7 W, fine for continuous operation | from €16 |
| Old micro-USB power supply | any spare phone charger | €0 |
| micro-SD card, ≥8 GB ("XD"/"HC") | system disk | from €3 |
| USB OTG adapter (micro-B → type A) | connects the FLIRC receiver to the Zero | €1.80 |
| SD card reader | to write the OS | from €5 |
| Any IR remote | avoid one belonging to a device in active use in the same room | €0 (e-waste) |
| FLIRC USB receiver (rev 2) | IR receiver with mapping software | from €24 |

Total: €0–65 depending on what is already on the shelf.

![FLIRC receiver](https://www.handtrixxx.com/user/pages/wiki/01.guides/ir-remote-control/04-flirc.webp)

## Software setup

1. Write **Raspberry Pi OS (32-bit)** with desktop to the SD card via [Raspberry Pi Imager](https://www.raspberrypi.org/software/).
2. Before removing the card, place two files on its boot partition (watch out for hidden `.txt` extensions on Windows):

    - an empty file named `ssh` – enables SSH (see <https://www.shellhacks.com/raspberry-pi-enable-ssh-headless-without-monitor/>)
    - `wpa_supplicant.conf` with the WLAN credentials:

        ```bash
        country=DE
        ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
        update_config=1
        network={
         ssid=<span class="hljs-string">"NETWORKNAME"</span>
         psk=<span class="hljs-string">"NETWORKPASSWORD"</span>
         key_mgmt=WPA-PSK
        }
        ```
3. Assemble, power up, find the Pi's IP (router interface), then `ssh pi@IP` (default password `raspberry`; change with `passwd`).
4. Update and install Node-RED:

    ```bash
    sudo apt-get update && sudo apt-get upgrade
    bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
    sudo systemctl <span class="hljs-built_in">enable</span> nodered.service
    sudo reboot
    ```

    Node-RED UI afterwards: `http://PI-IP:1880`.
5. Enable VNC (headless remote FLIRC configuration; see the "Enabling VNC Server at the command line" section of the [official VNC docs](https://www.raspberrypi.org/documentation/remote-access/vnc/)), and install the FLIRC GUI:

    ```bash
    curl apt.flirc.tv/install.sh | sudo bash
    ```

## Teaching the remote

Via VNC open the desktop, start Flirc from the start menu, switch its view to **Keyboard**. More than 127 keys are mappable; avoid special keys like "Print" (numbers/letters are safe). Click a key in Flirc, point the remote at the receiver, press a button – repeat per button. FLIRC keeps its mapping across reboots and runs in the background.

## Node-RED flow

Two nodes, both from the standard palette:

1. **"rpi – keyboard" node**: listens for keyboard input at the Pi, which after FLIRC mapping are exactly the remote's buttons. An optional debug node on its output verifies each press after Deploy.
2. **`websocket out`**: forwards events in real time; the home automation side (also Node-RED in this build) has a matching `websocket in`.

Transport choice: a plain API call adds ~1 s latency per press – unusable when pressing repeatedly (volume stepping). Websockets are the real-time tunnel that removes it. MQTT, TCP, UDP, file, web-service and serial transports are equally available in the standard palette.

Integration into other systems runs through community modules, e.g. [node-red-contrib-homekit-bridged](https://flows.nodered.org/node/node-red-contrib-homekit-bridged) (HomeKit), [node-red-contrib-openhab3](https://flows.nodered.org/node/node-red-contrib-openhab3), [node-red-contrib-virtual-smart-home](https://flows.nodered.org/node/node-red-contrib-virtual-smart-home) (Alexa).

## Resource notes

Running the desktop environment (for FLIRC configuration) on the Zero W costs about 100 MB of 512 MB RAM with everything active – headless would save little and makes FLIRC configuration awkward. Power draw allows battery or power-bank operation, making the whole receiver mobile if wanted.

 guidesmart-homeraspberry-pinode-redhardware

---

## Navigation

- Parent: [Guides](https://www.handtrixxx.com/en/wiki/guides.md)
- Previous: [GitHub Pages](https://www.handtrixxx.com/en/wiki/guides/github-pages.md)
- Next: [LibreEcho: flashing a used Amazon Echo](https://www.handtrixxx.com/en/wiki/guides/libreecho.md)
