Uncategorized

Raspberry Pi as a Television Remote: Part 1

This is the first of several posts about how I put together a system to control my television from my phone. Much credit goes to Alex Bain and his Open Source Universal Remote project. I’ve made some material changes, hence this blog post, but much of the ‘try something’ -> ‘bang head against wall’ -> ‘repeat’ was done by him.

As a result, in this series, I will be focusing on the things that are different between our approaches, and highlight places where beginners might have trouble. I’ve also built a pair of apps, one for iOS and one for Android, that will communicate with the remote once everything is set up. For all you mobile devs out there, there will be some interesting things in those posts as well, for instance, implementing a RecyclerView in Android, and my review of Swift thus far in iOS. But enough meta explanations.

Part 1: Hardware

The first thing to do is to get the electronics set up. Regular TV remotes work by using an infrared LED to beam signals to the television. We’ll be using the same technology to control your TV with a Raspberry Pi. The high level process for what we’re doing in this part is:

1. Put together one circuit to record your remote’s signals

2. Put together another circuit to play those signals back

Turns out, we can put both circuits in the same place: a Raspberry Pi proto board. The proto board connects to the pins on top of a Raspberry Pi, and allows you to connect them to other electronic components. If you don’t know how to solder, here’s a good guide. For my soldering needs, I personally use a Weller WLC 100 soldering iron.

In order to put the proto board together, check out this guide.

Next, you’ll want to get all your parts together. There’s nice list on Alex Bain’s site, which I’ve reproduced here:

Now for the fun part: putting the circuit together. You can see at the top of this post an image of a built out version of the RPi remote. For those of you who may not know circuit conventions very well, the red wires are the ‘power’ lines, while the black wires are for ground. White wires are connected to the ports the Raspberry Pi uses to receive signals from the infrared (IR) receiver and play them back with the two IR LEDs.

While my circuit is equivalent to Alex Bain’s, the exact position of the components on the proto board is different. This is primarily to cut down on the amount of soldering I had to do. See the images below.

Another place beginners might get confused is which LED wire to connect where. One wire is longer than the other (it’s called the Anode), while the other is shorter (called the Cathode). The Anode (long lead), in this circuit, should be connected directly to power (if it’s the first LED in series), or to the Cathode (short lead) of the other LED (if it’s the second LED in series).

Here are a bunch of photos of how I set up the circuit on the proto board. I’ve tried to take many photos from multiple angles and orientations, so you can tell what goes where. As you can see, I’m a novice solderer, and please excuse the dust that has accumulated on the proto board 🙂

IMG_20150712_180927 IMG_20150712_180944 IMG_20150712_181015 IMG_20150712_180831 IMG_20150712_180821 IMG_20150712_180907 IMG_20150712_180856

1 thought on “Raspberry Pi as a Television Remote: Part 1”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s