Controlling your TV with a computer via IR
Tue, Nov 22 2011 02:35 PM
| Permalink
As part of a project to setup a digital sign for my department on the cheap I purchased a LG TV and a Lenovo Atom powered computer. The TV was supposed to have a on/off scheduler that would allow us to automatically turn off the TV at the end of the day and turn it back on in the morning before our offices opened. It didn't work. It would turn off on schedule then in the morning it would turn on for a few minutes then turn off because it did not get any remote interactions. It was useless.
So I had to find a solution that would allow us to turn on and off the TV on our schedule and be fairly inexpensive. My solution was to use a USB IR dongle and some basic software that came with it to send a power button command recorded from the TV's remote.
The Hardware:
Iguanaworks USB IR Transceiver with 1 LED + 1 Plug
Smarthome Wired IR Emitter
The Software:
Windows 7 Home
IguanaIR software
First thing I had to do was install the IguanaIR software and then plug in the usb transceiver. Then to get it to work because the software uses a daemon, I had to reboot Windows with the transceiver plugged in.
To test everything was working I would run this command from the command prompt:
It should print out the hardware version.After getting the software installed and working I next had to figure out how to get the power button IR code for my remote in a format that the igclient software uses.
I would be able to record the input to a text file and see the pulses and spaces. This worked but the file was not in the format that I needed, but close. I removed the extra characters and spaces and got it into the correct format, but it did not work. I finally figured out that the IR remote was using pulse width modulation at 38k frequency and the messages needed a header and a tail wrapping the command. I found the LG remote codes in HEX at the LIRC software page.
Using a HEX to binary converter I was able to get the binary sequence for the command for the power button. I also could get the header info. The HEX code for the entire command was 20df10ef. This converted to 00100000110111110001000011101111. So I just needed to find the value in pulse/space format for 1s and 0s. Looking at what I recorded using the actual remote and igclient software I saw that the zero was pulse 556 and space 512, and the one was pulse 556 and space 1612. So I just created a new file with the binary sequence encoded with pulses and spaces, then added a header and tail pulse and space that I figured out from the recording again. Here is the final file.
To send this to the Tv, I mounted the SmartHome wired IR Emitter to the Tv over its receiver. It is hard to find under the plastic but using a flashlight and paper to cover it up and test with the remote worked best to isolate the exact location. Plugged in the emitter to the USB transceiver and ran the following command:
So I had to find a solution that would allow us to turn on and off the TV on our schedule and be fairly inexpensive. My solution was to use a USB IR dongle and some basic software that came with it to send a power button command recorded from the TV's remote.
The Hardware:
Iguanaworks USB IR Transceiver with 1 LED + 1 Plug
Smarthome Wired IR Emitter
The Software:
Windows 7 Home
IguanaIR software
First thing I had to do was install the IguanaIR software and then plug in the usb transceiver. Then to get it to work because the software uses a daemon, I had to reboot Windows with the transceiver plugged in.
To test everything was working I would run this command from the command prompt:
c:\Program Files (x86)\iguanaIR\igclient --get-version
It should print out the hardware version.After getting the software installed and working I next had to figure out how to get the power button IR code for my remote in a format that the igclient software uses.
pulse 556I finally figured out that if I used the command:
space 1621
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
c:\Program Files (x86)\iguanaIR\igclient --receiver-on --sleep=10 > remote.txt
I would be able to record the input to a text file and see the pulses and spaces. This worked but the file was not in the format that I needed, but close. I removed the extra characters and spaces and got it into the correct format, but it did not work. I finally figured out that the IR remote was using pulse width modulation at 38k frequency and the messages needed a header and a tail wrapping the command. I found the LG remote codes in HEX at the LIRC software page.
Using a HEX to binary converter I was able to get the binary sequence for the command for the power button. I also could get the header info. The HEX code for the entire command was 20df10ef. This converted to 00100000110111110001000011101111. So I just needed to find the value in pulse/space format for 1s and 0s. Looking at what I recorded using the actual remote and igclient software I saw that the zero was pulse 556 and space 512, and the one was pulse 556 and space 1612. So I just created a new file with the binary sequence encoded with pulses and spaces, then added a header and tail pulse and space that I figured out from the recording again. Here is the final file.
pulse 8960
space 4394
pulse 556
space 512
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 512
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 1621
pulse 556
space 21845
To send this to the Tv, I mounted the SmartHome wired IR Emitter to the Tv over its receiver. It is hard to find under the plastic but using a flashlight and paper to cover it up and test with the remote worked best to isolate the exact location. Plugged in the emitter to the USB transceiver and ran the following command:
c:\Program Files (x86)\iguanaIR\igclient --send=lgpoweron.txtTv went off and running it again turned it back on. I created a batch file with this command in it that I can schedule to run when ever I want and job done.
Comments
2011 Wright State University President's Award for Excellence
New site design
After updating to Rapidweaver 5, I decided to update the design of my site. Something a little different. I also had to update the Dundjinni page with PNG files that could be downloaded and used directly in Dundjinni.
Also, if you need a good Dice application for your Mac check out my Dice App on the Mac App Store.
Also, if you need a good Dice application for your Mac check out my Dice App on the Mac App Store.
Dice App now available
Sat, Jan 8 2011 05:59 PM
| Permalink
My dice rolling Mac applications is now available via the Mac App Store. If you need to roll virtual dice on your Mac, this is the app for you. Please check it out.




