Smart Homer Web-enabled TV remote using Arduino

Smart Homer Web enabled TV remote

Smart Homer, a Web-enabled TV remote puppet

Smart Homer is a Web-enabled puppet that turns on your TV when Simpsons is on. As Homer is too lazy to browse the Web himself, a script in the cloud checks the online TV program for him. If Simpsons is on, the script triggers the Arduino Web service in Homer’s belly to activate his infrared eyes. No brain involved.

This project by @tamberg was built at the 24-hour SRG Hackdays with the kind help of Gianni and @urbmc. Homer even got a trophy, just by switching on a TV!


Here’s a short video (electronics not yet embedded, eyes triggered with Curl).



  • Scissors

(A second Arduino Uno, USB cable and breadboard comes in handy for testing. The Ethernet cable should be long enough to reach the sofa in front of your TV.)

Smart Homer Web enabled TV remote

Step 1: Recording your TV remote’s IR signal

From the detailed Adafruit tutorial we learn that TV remotes use vendor specific IR signal encodings. There is a library at covering some vendors. But you still need to know what to send. Lacking this information in our case, we resorted to recording the IR signal with Adafruit’s handy example which you can download at…

Set up the Arduino, breadboard, IR sensor, 1k Ohm resistor and a (non-IR) LED as shown. Upload the rawirdecodestruct.ino example to the Arduino and open the serial console. Point the TV remote to the IR sensor, shortly press a channel key and watch the console. After a few seconds, a large output appears. Copy the part that looks like code to the clipboard (or a text file) for the next step.

Step 2: Testing the IR LED with your TV

Once you copied the output of the IR receiver sketch, download and open this Adafruit Arduino sketch:…

Build the circuit as shown in the Fritzing diagram, using the IR LED, a 220 Ohm resistor and a button. If you’ve got a second Arduino and breadboard you can leave the previous IR receiver setup untouched and use it to test this IR sender.

Replace the implementation of sendCanonCode by pasting the code you got from the receiver. You might also have to adapt the delayMicroseconds in the pulseIR function. We replaced 10 by 9 in both places, but left everything else. In the main loop, we replaced delay(3 * 1000) by delay(100).

The timing is quite critical. Play around with the sender by pointing the IR LED towards your TV’s IR receiver and pressing the button. If it works, the channel for the key you previously recorded should switch on. Many TVs have a timeout where they change the channel from e.g. 2 to 22. Try to find a safe timespan that switches the TV on, but does not go too far. A human does this intuitively when the desired result appears on the TV, but Homer is not that smart. We used a for loop to repeat the signal for the desired timespan.

(This step is easy, but it took a lot of attempts to get the timing right. We even plotted times in Excel to find out why the IR signal did not work. Another huge impact is the resistor. We accidentally used 1k Ohm instead of 220 Ohm which made the LED very weak.)

Step 3: Augmenting Homer’s eyes with IR LEDs

Pierce the infrared LED’s legs through Homer’s eyes. Take care not to break the legs. The puppet used here had a thick skin behind the eyes. Cut open Homer’s back and use your finger to “plug” a F-M jumper cable onto the LEDs legs. It is hard to remember which leg is GND, but you can test this easily by swapping the cables on the breadboard. Repeat the test from the last step to make sure your wiring works. We hooked up just one of the LEDs and kept the other as a backup.

Step 4: Testing remote access to the Arduino

The Arduino in Homer’s belly acts as a Web server. This allows us to send push notifications (or rather: trigger a Webhook) with a simple HTTP PUT request. To enable remote access without the hassle of port forwarding, we use, a relay service (disclosure: I’m a founder).

Follow the steps in to install the YalerEthernetServer library and get a free account. To see if Yaler works in your network, open File > Examples > YalerEthernetServer > YalerWebService in your Arduino IDE.

Add the Ethernet shield to your Arduino (remove the breadboard for a second), replace RELAY_DOMAIN with your relay domain and access the Arduino at You should see Hello in your browser.

(Note that this works from the public Web, not just in your local network. This is necessary for the cloud script to trigger your Arduino. If you still prefer using port forwarding, and know how to set up your router, just uncomment the respective lines in the code.)

Step 5: Testing Homer’s REST API with Curl

Once access to Homer’s belly works with the Yaler example, try the final code, available at… (Don’t forget to port over your TV-specific IR command and set your RELAY_DOMAIN.)

Connect the jumper wires of the IR sender breadboard circuit to the Ethernet shield, as before. Place Homer in front of your TV, at a distance and orientation that works for the IR signal. Make sure he’s connected to your LAN with the Ethernet cable.

On your computer, open a terminal and run Curl ( with this command: $ curl -vX PUT (Make sure to use your Arduino’s relay domain.)

If Homer’s response is 200, the TV should eventually switch on, just as if you pressed the button. If you get a 504, Homer might be busy. Wait, and try again.

Smart Homer Web enabled TV remote

Step 6: Embedding the Arduino into Homer’s belly

Now it’s time to integrate the electronics into Homer’s belly. Remove some of the stuffing material and insert the Arduino, Ethernet shield and breadboard. Don’t forget to connect Homer’s eyes to the breadboard and make sure they work as expected. Cut a hole into Homer’s butt for the USB and Ethernet cable. Then cover the back with some stuffing and sew Homer’s back together with a few stitches. Take care not to break the IR LEDs when dressing him up again.

Step 7: Setting up a TV program search RSS feed

SRF provides a online TV program (in German) with a neat search feature. Visit and enter Simpsons into the Suche nach text field. Click the button labelled Suchabo bestellen to “order” a search.

On the second page, select per RSS-Feed and click the Abonnieren button. This immediately provides you with an RSS feed. E.g. for all upcoming episodes of the Simpsons, the link is

The RSS feed contains starting times and channel info. Unfortunately, there’s no public feed (or other notification mechanism) to get a trigger when the emission really starts. That means we’ll have to do some time keeping by hand.

Step 8: Setting Up a Cloud Script

Now, we need a script that polls and triggers to send an IR signal to the TV, as shown in the sequence diagram.

During the SRF Hackday Gianni and @urbmc wrote such a script in PHP. They followed the getting started guide to create a Heroku app. The code is available at The script currently runs once only, but it should be easy to set up a Heroku scheduler to run it e.g. every 5 minutes.

Note that you can use any other programming language you want to create and run such a script. RSS is quite simple to parse with an RSS or XML library. And any Web client library can send the required GET and PUT HTTP requests. The glue code can run from your desktop or in a cloud service like Heroku or


Read more: Smart Homer Web-enabled TV remote using Arduino

Leave a Comment

Your email address will not be published. Required fields are marked *