Build a Professional Raspberry Pi Universal Remote with LIRC
This guide walks you through creating a reliable, feature‑rich universal remote using a Raspberry Pi and LIRC. It’s designed for hobbyists and professionals alike, emphasizing clear instructions, proper component selection, and a clean setup process.
Step 1: Gather the Parts
- 1 x Raspberry Pi (https://www.sparkfun.com/products/11546)
- 1 x IR emitter (https://www.amazon.com/gp/product/B005BJFDL6/ref=oh…)
- 1 x Audio breakout board (https://www.sparkfun.com/products/11570)
- 1 x IR sensor (https://www.sparkfun.com/products/10266)
- 1 x 2N3906 transistor (https://www.sparkfun.com/products/522)
- 1 x female header set (https://www.sparkfun.com/products/115)
- 1 x male header set (https://www.sparkfun.com/products/116)
- 1 x perf board
Step 2: Install the Software Stack
These commands assume a fresh Raspbian image. Open a terminal and run:
sudo apt-get update sudo apt-get upgrade # LAMP stack – useful if you want a web interface sudo apt-get install apache2 php5 mysql-client mysql-server tomcat6 vsftpd # Install LIRC for infrared control sudo apt-get install lirc
Configure GPIO pins for LIRC. Edit /etc/modules and append:
lirc_dev lirc_rpi gpio_in_pin=23 gpio_out_pin=22
Then set up LIRC’s hardware configuration. Replace the entire contents of /etc/lirc/hardware.conf with:
######################################################## # /etc/lirc/hardware.conf # # Arguments for launching lircd LIRCD_ARGS="–uinput" # Disable optional services # START_LIRCMD=false # START_IREXEC=false LOAD_MODULES=true DRIVER="default" DEVICE="/dev/lirc0" MODULES="lirc_rpi" LIRCD_CONF="" LIRCMD_CONF="" ########################################################
Reboot the Pi to apply changes:
sudo reboot
Step 3: Capture Remote Commands with LIRC
Wire the IR sensor’s 3‑pin connector to GPIO 23 (as specified in the modules file). Once connected, test the sensor by running:
sudo /etc/init.d/lirc stopmode2 -d /dev/lirc0
Press buttons on your existing remote; you should see key events appear in the terminal. When ready, record the remote layout:
irrecord -d /dev/lirc0 ~/out.conf
Follow the on‑screen prompts, using the predefined key names listed by:
irrecord –list-namespace
After recording, edit the configuration file:
sudo nano out.conf
Copy the block from begin remote to end remote and paste it into /etc/lirc/lircd.conf:
sudo nano /etc/lirc/lircd.conf
Replace the NAME: entry with a descriptive name for your remote, then repeat for any additional remotes you wish to support. Save the file and reboot again to load the new configuration.
For a deeper dive into the setup and troubleshooting, consult the Raspberry Pi Universal Remote guide linked at the end of this tutorial.
Manufacturing process
- Remote Weather Monitoring with Raspberry Pi 3 and PubNub
- Converting RF to DC with a Raspberry Pi: Building and Troubleshooting an Envelope Detector
- Cycle Chaser: Transform Your Bike into a Nighttime Light Show with Raspberry Pi
- Build a Raspberry Pi‑Based Thief Detector – Step‑by‑Step Guide
- Capturing IR Remote Commands on Raspberry Pi without LIRC: A Python UART Approach
- SMS‑Controlled Smart AC Power Switch with Raspberry Pi & Hologram
- Secure Remote Access & Control for Universal Robots via IXON Cloud
- Build a Universal Android Remote with Arduino, 1Sheeld & IR Control
- IoT Integration: Remote Arduino Control via Windows 10 UWP Apps
- SomfyDuino: USB‑to‑Somfy IO Adapter for Arduino Nano