I made a Raspberry Pi infrared remote control for a television sound bar. Programmatic control offers many exciting possibilities! The user could:

  • add a python Flask service to make the remote available over local wifi network.
  • write an iOS remote control app with buttons that send requests to the Raspberry Pi remote control service.
  • program the system to automatically decrease the sound whenever it exceeds a threshold.
  • program the system to automatically decrease or mute the sound whenever a commercial is detected e.g.

    • analyzing closed captioning text for a word on a list (e.g. “Lexus”, “Tylenol”)
    • at regularly scheduled commercial times (e.g. 19:02, 19:30)

Raspberry Pi IR remote shield

Pi IR remote shield
Raspberry Pi with infrared remote control board

LIRC Linux Infrared Remote Control

“LIRC is a package that allows you to decode and send infra-red signals of many (but not all) commonly used remote controls.”

Calling LIRC irsend

def transmit_command_ir(command):
    instruct infrared transmitter to transmit command
    :parameter command: an IrCommand

    ir_command_string = ir_command(command)

    # Don't allow user to run arbitrary string input, that is a security risk.
    # If LIRC irsend isn't installed, throws error:
    # FileNotFoundError: [Errno 2] No such file or directory: 'irsend': 'irsend'
    # subprocess.run requires Python >= 3.5, so don't use it yet.
    subprocess.call([IRSEND, SEND_ONCE, IR_REMOTE, ir_command_string])

During initial development I used iPhone front facing camera to check the transmit command blinked the infrared LED. The rear facing camera filters infrared, but the front-facing selfie camera doesn’t.

IR LED blink
Checking transmit command blinks the infrared remote control LED



Make a Raspberry Pi infrared remote control. The device can programmatically control television sound bar audio volume. The Raspberry Pi uses LIRC (Linux Infrared Remote Control) to send commands to an attached infrared transmitter.

The Python app has two parts:

  • Functions to send commands to the infrared transmitter, which then transmits the commands to the television sound bar
  • A Flask web service to accept television command requests (e.g. volume decrease, volume increase).

The README includes links to similar remote control projects, infrared remote control hardware.


Remote control television by sending commands from iOS device to a server.

LIRC Linux Infrared Remote Control


Infrared remote control hardware

Raspberry Pi IR Control Expansion Board


Icstation 38KHz IR Infrared Remote Control Transceiver Shield for Raspberry Pi 2 3 Module B B+


Inspirational projects

Enough Already by Matt Richardson


TV-B-Gone Kit