A
Universal Infrared Remote Control By - lawrence mazza ________________________________________________________________________________________________________ |
||
|
he other day, I was working on a project of some sort, and Donita came running in. "The remote quit working!" she said. The look on her face was sheer panic. You see, when it comes to the TV, my wife and I have somewhat of a role reversal. She watches it more than me, so consequently, she usually handles the remote control. And you know how these remotes go. After a year or two, the buttons get dirty, or lose their conductivity. So I opened the unit, cleaned the buttons, and put it back together. When I gave it back to her, she rewarded me with that sweet little smile that's reserved just for me. |
This TV is about two years old, and lately, I've had to clean the buttons just about once a month. I figured that it's time to get a new one, and rather than replace it with an OEM unit, I thought it would be a good idea to purchase a "Universal Remote Control" so that I could operate all the video devices with one controller. So I went to the local Electronic Appliance place and picked up one of their so called Universal Remotes. I brought it home, and tried to program it. It worked on the VCR OK, but I couldn't get it to control the TV. Even though Toshiba was on the list of TVs that would work with this device, I couldn't get it to do more than the basic Power, Channel and Volume commands. None of the codes would allow the more specialized functions, like Menu, Mute and Video Source to operate. Furthermore, I have an unusual cable box that I purchased from a third party. That brand isn't even listed in the programming codes. I tried several of the other more common brands of cable boxes hoping that they might be similar, but I had no luck at all with it. So I returned the unit, went to another store and purchased a different 'Universal' remote. No luck with this one either. I had done some research on IR remotes and found that they aren't all that complicated. I won't go into the details about how they work (you can do that research yourself -- here is a nice explanation), but basically, an IR LED is modulated on and off, and the spacing between modulations determines whether the remote is transmitting a "1" or a "0" (see the waveform below). The TV or other receiver of the IR stream looks at the sequence of 1's and 0's and decides what to do. With only three video "boxes", I decided that it would be fairly easy for me to build a programmable universal remote that would shoot out the correct commands for each of them. |
|
||||
For this
project, I certainly didn't want to build a keyboard or a case to put it
in. I wanted to find a remote with the correct number of keys that I
could gut, keeping the keys, the case, and if I'm lucky, the IR LED(s)
and driver. And since it seems that all devices with these rubberized
buttons eventually die, I needed to find a unit that was inexpensive and
readily available. I found a unit at Electronic Goldmine that looked
like it would work. The XRC-110 Universal Remote Control had all the
buttons I needed and was being offered at the unbelievable price of two
for $9. I bought six of them.
Next, I needed a programmable controller that would take a key press, convert it into the proper IR code stream and modulate the LED. I'd done a lot of work with the 8051 microcontroller in the past, so this was my first choice for the project. Since the remote control is small, there is little room for much hardware, so I knew that I'd have to use the EPROM version of the 8051, the 8751. However, while researching this chip, I came across the Atmel 89C2051. Not only is this chip small, it uses the 8051 control language and operates down to 2.7 volts. Since the XRC-110 remote was designed to operate with two AA batteries, the 89C2051 seemed like a good choice. The XRC-110 is a nice little unit. It has more buttons than I need, so I thought I was home free, but the 89C2051 only has 15 I/O pins. Since I needed 2 pins for control, that left 13 pins to read a 6X7 matrix, or 42 keys. Again, that's enough to do the job, but when I traced the keyboard circuit, I found that the keys I really needed were spread across the full 6X8 matrix that came with the remote. So, I had to re-map some of the keys -- not that difficult to do, plus, it beats having to re-label things. On the top of the unit are four mode keys marked AUX, VCR, CABLE and TV. I'm not sure what I'll do with the AUX function, but my daughter did get a Furby for Christmas... Detecting a Key At that point the processor looks for which row is low. It then forces that row low, sets the columns high, and looks for which column is still low. This works because at 12 MHz, my finger is still holding the button down. In this way, I can determine which button has been pressed. From there, the controller uses a lookup table to determine which code to send out. Click here to see the processor code that does this. Subroutine get_key determines which button was pressed. Making
it Fit I used magnet wire (the green wires on the right of the new board) to connect the column and row inputs to the new circuit board. I simply soldered them from the board to the pad where the old processor used to be. In the '2051 code, you'll see references to ROW9 through ROW15. The numbers 9 through 15 represent the pad number from the XRC-110 and correspond to rows 1-7 respectively. I did this so that I'd remember where the row connections were to be made. I was able to use the IR LEDs and driver circuit from the XRC-110, however, I jumpered the current limiting resistors in order to improve the range. Once again, I used magnet wire to make the connection from the '2051 circuit board to the remote circuit board. Doing
is Learning -L |