Raspberry Pi infrared remote control for a television sound bar
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
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.
References
remy_python
https://github.com/beepscore/remy_python
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.
Remy
https://github.com/beepscore/Remy
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
https://www.raspberrypiwiki.com/index.php/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
https://makezine.com/2011/08/16/enough-already-the-arduino-solution-to-overexposed-celebs/
TV-B-Gone Kit
https://www.adafruit.com/product/73