Carl Burks is a software developer for a global financial institution. With over ten years experience in technology and software development for financial organizations and over twenty years of software experience, Carl Burks provides articles, musings and insight into technology issues, software development, and other selected topics.

Infrared remote Update


Carl Burks

Spend some time this weekend playing with my new soldering iron. I put together the IR blaster and receiver.

Here's a picture: Remote

So for the Arduino code I used the IR library:

IR Library

I played around with getting the blaster to work without success. The receiver I was able to read several remotes, but not the one for my Changhong tv. I think it might use a frequency that is out of range or perhaps blueooth even.

I hooked the board that I soldered together both the Leonardo and the pro-micro and it worked with both. I wrote a little bit of Python plumbing code to have my computer use the IR receiver:

import serial
from subprocess import Popen, PIPE

volume_up_sequence = '''key XF86AudioRaiseVolume
volume_down_sequence = '''key XF86AudioLowerVolume

terminal_sequence = '''keydown Control_L
keydown Alt_L
key t
keyup Control_L
keyup Alt_L

key_sequence = '''key %s

def keypress(sequence):
     p = Popen(['xte'], stdin=PIPE)

def quick_kp(key):
     keypress(key_sequence % (key,))

ser = serial.Serial('/dev/ttyACM0', 9600)
def volume_up():
def volume_down():
def open_terminal():

handlers = {"E0E0E01F":volume_up,
            "E0E020DF":lambda: quick_kp("1"),
            "E0E0A05F":lambda: quick_kp("2"),
            "E0E0609F":lambda: quick_kp("3"),
            "E0E010EF":lambda: quick_kp("4"),
            "E0E0906F":lambda: quick_kp("5"),
            "E0E050AF":lambda: quick_kp("6"),
            "E0E030CF":lambda: quick_kp("7"),
            "E0E0B04F":lambda: quick_kp("8"),
            "E0E0708F":lambda: quick_kp("9"),
            "E0E08877":lambda: quick_kp("0")
while True:
     key = ser.readline().split("\r\n")[0]
     if key in handlers: