ANAVI Infrared pHAT

Transform your Raspberry Pi into a smart remote control.

Feb 25, 2020

Field Report: Making a "dumb" home-entertainment system smart with Anavi Infrared pHAT

by Crowd Supply

by Phil P.

I’m Anavi backer Phil P. I used an Infrared pHAT to remotely control my “non-smart” home entertainment system. I connected the pHAT to a Raspberry Pi to which I can send signals over my LAN or the Internet and control my A/V gear by emulating its remote controls.

Specifically, the setup consists of the following:

###Hardware:

###Software:

InfraredServer.js is a simple Javascript server program I wrote that accepts JSON-format commands on port 8080 of the Pi, executes the command using node.lirc, and then returns a JSON-format response containing the present state of the controlled devices (the LG TV and Sony Stereo). The program also provides a web-server for web pages that provide virtual-remote functionality for both the TV and the stereo.

Separately, an ngrok tunnel and IFTTT Apps (Google Assistant-Webhook) are used to provide voice-control access from Google Home to the server (e.g., "Hey, Google: TV on"). Irexec is used to monitor infrared commands from any physical remote in order to update the InfraredServer present state.

The challenges for this project included finding the appropriate infrared commands for the devices (e.g., the LG Technician remote codes for separate power-on and power-off), debugging the infrared timing (most remotes send infrared commands twice to ensure the TV and stereo responds), and maintaining "sync" between the server and the actual state of the devices.

The ANAVI pHAT replaced an earlier version of this device which had used discrete components and a breadboard. This greatly improved the range and reliability of the server. The Pi3B+HAT now sit unobtrusively on my media table below the TV and above the stereo. Now, when I ask Google for "Movie Mode," the TV turns on to the right HDMI input and the stereo turns on to the TV input at the same time. I’ve even scheduled the TV to turn on every lunchtime, tuned to the news.


Sign up to receive future updates for ANAVI Infrared pHAT.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects