Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Decoding TV Remote Control "Language"

Status
Not open for further replies.

Menticol

Active Member
Hello guys

I'm trying to decode the different patterns of a standard TV remote control on my computer. I know that these USB remote control gadgets are already sold on the market, I'm working on this project just for the sake of knowledge.

Given that I have zero experience with micro controllers I worked with what I had in hand. I scrapped an IR receiver module from a stereo, connected it to a 2N3906 transistor and then to a Optocoupler. The optocoupler then bypasses one of the switches on a USB joystick, and the computer reads the input every time the remote control is pressed.

IMG_2042.JPG IMG_2134.JPG IMG_2135.JPG

The circuit somehow works, as reported by the software included with windows.
IMG_2126.JPG

Now I'm in the quest of decoding different remote control buttons, and for that I'm making a small Visual basic 6 application. But I'm stuck in this point!

At first I had the impression that Visual Basic could not understand events happening faster than 1 millisecons. But the existence of this parallel port "oscilloscope" program proves that is not a limitation. (Off topic: I tested that very same oscilloscope trying to understand the IR signal but it didn't worked)

IMG_2186.JPG

My question is, can the joystick button interface provide the required response speed? Do you know about a piece of code that can understand these pulse sequences?

If it can't, it's possible to use some kind of buffer to slow down the signal and make it more intelligible to my software?

Or is better to throw away the idea and start from scratch?

Thank you

PS: The reason because I've used an optocoupler was because I couldn't figure out the joystick circuitry's logic. There are 8 buttons in total, and each button have two leads: lead "A" (apparently) carries +5 and the lead "B" goes to the microcontroller. Oh, simple! shorting lead B to +Vcc would simulate that the button was pressed. But I got nothing, each button would only work exclusively with its corespondent lead.
 
Assuming you're planning using a microcontroller?, then buy a PicKit2 programmer - cheap and it includes a logic analyser which is ideal for decoding IR signals.

Here's an example.
FastForward.png
 
Hello Nigel

Yes indeed, I'm planning to learn how to work with PICs. Unfortunately I don't have the money (yet) to import the programmer from Microchip. Locally you can get cheap PICKit 2 clones but I don't trust them, their construction looks flimsy.

Do you think that the joystick interface has potential?

PS: If otherwise I'm thinking about burying the joystick idea and just connect the IR receiver and the transistor to the computer Microphone jack. It's a mediocre approach but it's more adjusted to my coding abilities.
 
Do you think that the joystick interface has potential?

Anything under Windows has problems with real time, and particularly USB which is only polled and has a lot of overhead.

Mind you it must be an antique is it still has a joystick port :D

I used a parallel port for a similar scheme a LONG, LONG time ago, running DOS on a 386 Laptop and a program I wrote using Turbo Pascal (which I used to reverse engineer a Sharp TV remote).
 
Oh sorry, by joystick I meant USB joystick, not the ancient game devices that used the soundcard's game port :facepalm: Memories from my childhood!

Thank you by your tip Nigel, I'll try your parallel port approach, and if it fails the microphone option. However the later is not as easier as I thought!
 
Another idea. Get an inexpensive USB data aquisition dongle or USB Oscilloscope. They are capable of recording and displaying the IR data stream.
 
I successfully used Nigel's Infrared Board tutorial and a Rigol DS1052E oscilloscope to decode the remote control protocol of an Olevia LT19W 19" TV a few years ago. It all started when I lost the remote control for that TV and bought a universal remote controller, in the hope that it would work out of the box. However, despite trying all available codes, the TV only seemed to erratically recognize only a few keys from the universal remote.

I used a TFMS 5400 to receive the transmitted signal from the universal remote, analyzed it on the oscilloscope to find the pattern and modified Nigel's code to send similar pattern and got the TV to recognize other keys. In the end I bought a learning remote controller to copy these transmitted signals and assign them to the correct buttons. It works until today!

I documented the details here: **broken link removed**
 
Anything that is watching a mechanical switch will need to have some sort of debounce function to prevent a single switch event from looking like multiple events. Since some switches can bounce for several milliseconds, the debounce time could be tens, or even hundreds of milliseconds. So expecting a joystick controller to see signals that could be down in the sub millisecond range isn't likely to work.

A true hardware parallel port, a logic analyzer, or something else that can capture sub millisecond pulses will be needed.

As for a knock-off pickit2, I wouldn't worry. Microchip freely publishes the schematics and hex files for them, so they are easy to clone accurately. It is to Microchips advantage to make their parts easy to use. Letting people clone their development tools just increases the demand for their uControllers. And that's where they make their real money.
 
Thank you by your answer Chris! The debounce explanation makes sense. I was suspecting about the USB incapabilities since Nigel mentioned the real time problem on Windows.

Now that you mention it, a couple of days ago I couldn't resist temptation and bought one of these Pickit 2 imitations among with a PIC16F628A to start with.

I got John Lovin's IC Microcontroller Project Book as it centres around PIC16F84. Unfortunately it's a bit outdated and doesn't talk about using the new features available on the 16F628A. Please, If you know about better PIC literature for beginners I would really appreciate it.

Dec 02 edit: Just saw Nigel's signature! :banghead:
 

Attachments

  • 1465271_1483485718544269_389269291_n.jpg
    1465271_1483485718544269_389269291_n.jpg
    11.5 KB · Views: 225
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top