Need Help with Infrared Decoding

This is the JP1 beginners forum. There's no such thing as a stupid question in here, so post away, but this forum is just for JP1 users and people considering JP1, non-JP1 users please use the appropriate forum above!

Moderator: Moderators

Post Reply
zo0o0om
Posts: 1
Joined: Sun Jul 25, 2010 10:18 pm

Need Help with Infrared Decoding

Post by zo0o0om »

Hey I am trying to make a TV remote from scratch, So far I have managed to build a receiver using a solar panel hooked up to my computer microphone jack, and audacity to record the infrared light that it emits.

Image

That is the result from when I press the POWER button on the remote. What I am trying to do is figure out what code that would convert into if I wanted to use JP1 to emit the same frequency.

Any help is appreciated,
Thank you!
johnsfine
Site Admin
Posts: 4766
Joined: Sun Aug 10, 2003 5:00 pm
Location: Bedford, MA
Contact:

Re: Need Help with Infrared Decoding

Post by johnsfine »

zo0o0om wrote:Hey I am trying to make a TV remote from scratch, So far I have managed to build a receiver using a solar panel hooked up to my computer microphone jack, and audacity to record the infrared light that it emits.
Which it do you mean? Some first version of the remote you're trying to build? Or the original TV remote you're trying to copy? Or what?
That is the result from when I press the POWER button on the remote. What I am trying to do is figure out what code that would convert into if I wanted to use JP1 to emit the same frequency.
There are easier ways to find out what IR signals your original remote transmits. But I still can give you advice on how to figure it out this way.

You are looking at too slow a time scale to see the IR protocol and way too slow a scale to see the modulation frequency. Hopefully we can infer the modulation frequency once we know the protocol.

I don't know whether you have the audio sampling fast enough (and you're just displaying it at the wrong time scale) or whether you need to sample faster.

You highlighted a 23.447mS "frame" of the IR signal. You need to magnify the time scale so you can see details inside that frame.

From the zoomed out view you posted, it looks like RC5 protocol. If the IR receiver and the audio port were capable of instantaneous samples, you would need to be sampling at over 72Khz to see RC5 reliably. But more likely some part of the analog IR receive path has enough capacitance to smooth things out a little and you could see RC5 correctly at a much lower sample rate. Perfectly smoothed (exactly enough and not too much) you could see RC5 at 1Khz samples. But that's even more unlikely. So sampling closer to the 72Khz end of that range is safer.
cauer29
Posts: 236
Joined: Wed Feb 03, 2010 9:15 am

Re: Need Help with Infrared Decoding

Post by cauer29 »

johnsfine wrote:
zo0o0om wrote:Hey I am trying to make a TV remote from scratch, So far I have managed to build a receiver using a solar panel hooked up to my computer microphone jack, and audacity to record the infrared light that it emits.
Which it do you mean? Some first version of the remote you're trying to build? Or the original TV remote you're trying to copy? Or what?
That is the result from when I press the POWER button on the remote. What I am trying to do is figure out what code that would convert into if I wanted to use JP1 to emit the same frequency.
There are easier ways to find out what IR signals your original remote transmits. But I still can give you advice on how to figure it out this way.

You are looking at too slow a time scale to see the IR protocol and way too slow a scale to see the modulation frequency. Hopefully we can infer the modulation frequency once we know the protocol.

I don't know whether you have the audio sampling fast enough (and you're just displaying it at the wrong time scale) or whether you need to sample faster.

You highlighted a 23.447mS "frame" of the IR signal. You need to magnify the time scale so you can see details inside that frame.

From the zoomed out view you posted, it looks like RC5 protocol. If the IR receiver and the audio port were capable of instantaneous samples, you would need to be sampling at over 72Khz to see RC5 reliably. But more likely some part of the analog IR receive path has enough capacitance to smooth things out a little and you could see RC5 correctly at a much lower sample rate. Perfectly smoothed (exactly enough and not too much) you could see RC5 at 1Khz samples. But that's even more unlikely. So sampling closer to the 72Khz end of that range is safer.
It's not likely that even in the rare instance that you have a sound card input that can sample at 96 KHz, that the analog bandwidth of the port extends far enough to make that work usefully. Sampling at 96 KHz which is the next higher commonly used sample rate available, in no way implies a bandwidth to half that.

If you want to do this on the cheap, you can get a demodulating IR receiver IC from Radio Shack for a couple dollars. Power that from a USB port and pipe the output into your soundcard input. Your soundcard will have plenty of time resolution for this method. You won't get to see the actual frequency of IR pulses, but generally that can be deduced from the protocol, though there are some notable exceptions.

Backing up for a second here though, perhaps instead of trying to rediscover gravity, you could simply use the JP1 lookup to see which protocol is used by your TV?

A.A.
Post Reply