IR Decoder Tutorial Questions

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_rick »

I don't know where your problems are coming from. Your sequences seem odd to me, however. TV remote controls are fairly standard, and so I would expect to see much longer code sequences than you have posted here.

You might want to review a couple of web pages that I found helpful when I was trying to figure out how this stuff works.

The NEC protocol seems to be the most common.
http://wiki.altium.com/display/ADOH/NEC ... n+Protocol

This page is also on NEC, but the sidebar lists some other protocols as well.
http://www.sbprojects.com/knowledge/ir/nec.php

User avatar
paulc1
 
Posts: 41
Joined: Sat Sep 24, 2011 10:30 pm

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Thanks for the reponse.

The code in my earlier post on Oct 6 is the exact codes recieved and sent pursuant to the tutorial on IR sensors on Adafruit web.

While very instructive, the NEC code derivations are not much help to me since I'm not in the process of developping code, but merely trying to implement the Adafruit tutorial. Plus they talk about a different code sequence than Adafruit's. I'll certainly look further into it.

My code capture and retansmission were corroborated by my scope, and were reconfirmed by multiple repetition. My predicament is the seemingly unpredictable outcome. How come the captured code seem to vary with distance, and why it stops working at times after it did work at others.

Is it distance related? carrier frqency accuracy? Pressure and duration of contoller presses, Brand of appliance? cable box or not?

I'll keep digging.

Thanks again

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_rick »

Hmmm … As I recall, the adafruit tutorial is based on the NEC code, but I'll check it again. In any case, the altium page is a good resource for the general theory of IR modulation.

Your code does look different from the NEC; however, the sidebar in the sbprojects page lists several other code standards. I thought you might be able to match one of those up with yours.
Paulc1 wrote:How come the captured code seem to vary with distance, and why it stops working at times after it did work at others.
Is it distance related? carrier frqency accuracy? Pressure and duration of contoller presses, Brand of appliance? cable box or not?
Distance is only a factor when the signal becomes too weak for the detector to recognize. It's an inverse-square relationship - at twice the distance, the signal is 1/4 the strength. At some distance, the signal will appear inconsistent, as the detector picks up some parts of the signal and misses others.

Battery condition factors into distance. Weaker batteries in the transmitter mean that the remote will only be detectable at shorter distances.

How hard you press the buttons is irrelevant, unless there are mechanical issues in the remote (dirt, loose connections, etc.).

Duration of button press should not be relevant, as the command signals are timed. If you hold the button longer, you will simply repeat the command more often. Most remotes send about 10 commands/second.

In the early days, some old remotes would simply send a "repeat" command instead of actually repeating the original command. The NEC pages I linked to talk about the "repeat" - it is much shorter than a command signal. However, unless you remote runs on coal, I doubt that you are seeing anything like that. The problem with that idea became quickly apparent once these things got into the field - if you miss the command, you have no idea what you're supposed to be repeating. So modern remotes don't use the "repeat" signal.

Brand is really only relevant to specific code sets and command protocols. There are some small differences between remotes in terms of carrier frequency and pulse-width timings. Generally, you'll see on the order of +/-5%, which isn't usually a problem.

User avatar
tobes49
 
Posts: 29
Joined: Wed Oct 19, 2011 10:06 am

Re: IR Decoder Tutorial Questions

Post by tobes49 »

Paulc1 wrote:My objective is to determine the "Mute" code for a AOC 22 LCD TV (L22W898) with the ultimate objective of :

1: Muting the TV upon detection of certain words in the TV's closed captioning script using the Video Experimenter Shield (a la Enough Already video) and

2: Eventually finding a way to fast forward a DVR upon detection of a commercial.

I was able to get the Mute code following the tutorial example of the Nikon remote but I am not able to mute the TV upon firing the code from Arduino.

I rechecked the wiring and can only attibute the cause to either:

1- Code incorrect- though I reconfirmed it many times

2- The main carrier signal is different than 38KHz establised by the 13 Microseconds HI/LO transmitted by the sketch

3- the 940 nm IR LED is bad .

I rechecked the code repeatedly. I had a question as to the exact beginning and end of the sequence as determined by the large initial OFF pulse as mentioned in the tutorial

Would appreciate any info regarding the main carrier frequency if different from 38KHz

As to the 940nm led. I did confirm that immediately upon uploading the code I do get a voltage spike on pin 13 suggesting the sketch is working , but the 940nm LED does not light up nor show any sign og life. Any help re- checking the LED ?
Is it supposed to light up when transmitting the 940nm signal?

Any suggestions appreciated.

Thanks

.
What Arduino board are you using?

I had major problems when I moved shield from a Uno to Leonardo. The same digital pin is used but this relates to a different pin on the chip and caused all sorts of strange readings for me.
Uno - Digital pin 2 = 2 in sketch
Leonardo - digital pin 2 = 1 in sketch

Try changing the sketch or moving the IR into digital pin 0 on Leonardo,

User avatar
paulc1
 
Posts: 41
Joined: Sat Sep 24, 2011 10:30 pm

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Thanks Tobes49. I'm using the UNO since day one with steady USB 5V. I have confirmed capturing and transmitting code with my scope. Problem is my TV does not respond to the same code I capture from the remote.

JD3
 
Posts: 101
Joined: Sat Jul 28, 2012 8:01 am

Re: IR Decoder Tutorial Questions

Post by JD3 »

Try a 40 millisecond delay and retransmit the code.

Most remote codes repeat themselves 2-3 times.

User avatar
paulc1
 
Posts: 41
Joined: Sat Sep 24, 2011 10:30 pm

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Progress Report:

Thanks Driverblock! your instructive comments led me to look into the Voltage/Distance area. Voltage was no problem since I'm running off Arduino USB power. Then looked at the voltages at the IR Detector and IR Led which so far were being taken for granted. Detector was OK but IR LED looked BANNED on the scope. Found I was using a 22k resistor vs 220 ohm.

This apparently resolved the IR transmission problems with my AOC TV up/Down volumes control of my office TV.

I'm still wrestling however, with the Sony RM-AAU020 amplifier remote volume control. Just can't get the Amp to read/accept the grabbed code of the remote.

The transmitted code, see attached Pics, starts with 3x60ms bursts followed after 550ms by the 3 code sequences I'm using vs 2 in the tutorial. The second pic shows one code sequence of the 38kc bursts durations pattern.

The initial 3x60ms bursts appear also in the successful code of the AOC sketch. Beats me though as to where they're coming from. Thought they were the problem but apparently they appear on all transmitted code from sketches.

I tried to change the 60 sec delay in the sketch as well as the delays between tranmission repetitions without success.

Any suggestions much appreciated.
Attachments
One code sequence expanded
One code sequence expanded
IMG_0376.jpg (986.75 KiB) Viewed 890 times
3 Initial  bursts preceding 3 code sequences
3 Initial bursts preceding 3 code sequences
IMG_0375.jpg (946.09 KiB) Viewed 890 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”