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
paulc1
 
Posts: 41
Joined: Sat Sep 24, 2011 10:30 pm

IR Decoder Tutorial Questions

Post by paulc1 »

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

.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_bill »

If you can scan the Mute code from your remote, you should be able to verify the carrier frequency it is using too.
The IR LEDs don't emit visible light. But digital cameras are sensitive to it and you can usually see it in a digital camera viewfinder.

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Thanks for quick response.

Newbee here. How do I find out what the TV remote CARRIER frequency is? (No Oscilloscope)

I was under the impression the IR detector ( 9GP1UX311QS) bypasses the carrier frequency and is able to detect only the low frequency code modulation.

I must be missing something here.

My typical readout of "Ready to Decode IR" is (In Microseconds)

off 27000 then (on,off)980,760- 1780,840- 900,840- 880,860- 880,840- 900,840 -880,840-900,840-880,1700
-880,820-1780,1700- then 880,23000 and the sequence repeats.

Looking forward to your comments

Thanks

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_bill »

I'm not familiar with the detector you are using. It is not something we sell or support. You should contact the seller for help on that.

The TVBGone design page describes how we scan codes using a plain IR sensor. However, you will need an oscilloscope.

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

My apology mistyping thethe IR sensor/ decoder. It is item (GP1UX311QS) not (9GP1UX311QS).

This item I understand is a substitute of PNA 4602 now discontinued according to your tutorial.

This item was purchased from Adafruit Industies on 9/19/2011 Invoice#104458, pursuant to your tutorial.

Therefore I assumed you support it, and expect you to, and that's why I am asking you for support.


Thank you

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_bill »

OK then. The carrier frequency should be right or the detector would not have been able to demodulate the signal. Did you check the IR led with a digital camera to verify that is was working?

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: IR Decoder Tutorial Questions

Post by Franklin97355 »

You could also replace the IR LED with a visible one to see if the code is actually being sent. The decoder seems to be working OK and your problem is in the transmission of the code to the TV.

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Thanks to Adafruit Support and Franklin97355 for your suggestions.

I did confirm the IR Led operation by viewing it flash back at my camera view finder and also following Franklin's suggestion of placing a regular Led in parallel with the IR led(with a 1k reistor). It flashed upon uploading the IR Led sketch.

Furthermore in order to confirm the carrier of the IR Led, I flashed the IRLed at the IR Detector circuit mounted on a separate breadboard, and was able to fire up the IR Detector's Led everytime I uploaded the sending sketch to the IRLed and aiming it at the IR Detector.

This confirms the IRLed's carrier works but I could'nt confirm its demodulated code without running the detector on a separate IDE board on a separate computer to run the receiving and sent codes simultaneously, which I did'nt have.

However still no luck Muting the TV.

Finally here are the codes received fron the IR detector in response to the TV Mute signal and my entered code in the transmitting sketch.:

Received OFF,ON Microsecs
OFF ON
4620,920
800,1780-
860,860-
860,880-
860,880-
840,880,
860,880-
840,860-
880,880-
1700,860-
860,1760-
1680,860-
22464,900-840,1760 and the appox same sequence continues...

The code I entered under "void SendNikonCode() {" is:
pulseIR(900);
delayMicroseconds(840);
pulseIR(880);
delayMicroseconds(840);
pulseIR(1760);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(860);
pulseIR(860);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(860);
pulseIR(860);
delayMicroseconds(880);
pulseIR(880);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(1700);
pulseIR(860);
delayMicroseconds(840);
pulseIR(1760);
delayMicroseconds(1700);

delay(65); // wait 65 milliseconds before sending it again

pulseIR(900);
delayMicroseconds(840);
pulseIR(880);
delayMicroseconds(840);
pulseIR(1760);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(860);
pulseIR(860);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(860);
pulseIR(860);
delayMicroseconds(880);
pulseIR(880);
delayMicroseconds(860);
pulseIR(880);
delayMicroseconds(1700);
pulseIR(860);
delayMicroseconds(840);
pulseIR(1760);
delayMicroseconds(1700);
}

If I may impose on somebody's indulgence, I would appreciate somebody taking a peek at my entries and telling me were I'm going wrong.

Thanks

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: IR Decoder Tutorial Questions

Post by Franklin97355 »

Although I have not used the code you are referencing, why are you not using the timings you got from the remote?

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

I did, except I understand from the tutorial, you disregard the first and last large delays.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: IR Decoder Tutorial Questions

Post by adafruit_support_bill »

I did, except I understand from the tutorial, you disregard the first and last large delays.
Even disregarding the initial delay, the numbers don't match:

,920
800,1780-
860,860-

is not

pulseIR(900);
delayMicroseconds(840);
pulseIR(880);
delayMicroseconds(840);
pulseIR(1760);
delayMicroseconds(860);
pulseIR(880);

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

Re: IR Decoder Tutorial Questions Success!!! BUT...

Post by paulc1 »

First a word of thanks to all who contributed in helping me successfully detect and transmit the IR codes of a TV.

I have straightened out the discrepancies of my previous post (neglecting the first seemingly disregardable first delay as mentioned in the tutorial) and fired up the corrected code, but alas with to avail again.

As a last resort before giving up altogether on that tutorial, I retransmitted the code including the large initial delay at the start of any sequence read, and succes happened. It worked.

So in my case the problem was disregarding the initial first long delay, and by merely retransmitting the read code verbatum as read from the IR Detector i.e without any doctoring was all it took.

Did the doctored code as mentioned in the Tutorial for the Nikon work? I suggest at least a qualifier be mentioned in the tutorial to that effect as to the significance of the first long delay fired.

Also a couple other suggestions:

A troubleshooting comment regarding the testing of the IR LED vide a Camera viewfinder or parallel regular LED would be helpful. (to newbees)

As a non C-expert ,It would be helpful to have some triggering device (Software or Hardware) to fire the code once uploaded initially without having to upload the code everytime you need to fire a functin code. Uploading the code in my case takes about five seconds which feels like eternity if you need to go through that wait before your TV responds.

Cheers anf thanks again.

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: IR Decoder Tutorial Questions

Post by osbock »

[quote="Paulc1"
As a non C-expert ,It would be helpful to have some triggering device (Software or Hardware) to fire the code once uploaded initially without having to upload the code everytime you need to fire a functin code. Uploading the code in my case takes about five seconds which feels like eternity if you need to go through that wait before your TV responds.
[/quote]

There are tons of button examples out there. The debounce example is a good place to start. Then when you detect a state change, call your transmit routine.

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

I was able to grab the code for IR "volume down" code of a Sony RM-AAU020 remote using the tutorial procedure but could'nt make it work on the Receiver using the IR TX led

I "grabbed" the code for that function initially through the Serial port as described and then attempted to confirm the sequence and duration of pulses with the single trigger capability of my Rigol 1052 scope simultaneously.

I am getting the same sequence of pulses, but pulse durations differ slightly between the simultaneous Serial and Scope readings as indicated below:

For the serial on's I get

2400,1220,1220,640,640,1247,6x640,1220,1220,640,640,and then another sequence

all off's are 540 ( and all in uSec's)

and for the scope I get"

2400,1300,1300,700,700,1300,6x700,1300,1300,700,700 and no repetition

all off's are 500 (taken simultaneously)

I tried both sequences on the Sending sketch to no avail.

I also tried 2 and 4 sequences on the scope sketch- no luck either.(since the same squeeze on the remote gave only one sequence on the scope and FOUR sequences on the Serial without delays in between.)

Any thoughts and/or suggestions would be much appreciated.

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

Re: IR Decoder Tutorial Questions

Post by paulc1 »

Still wrestling with the TX part of the code since my earlier post. I was able to decode and Transmit the DN volume but just can't seem to TX the UP Volume.

I did notice some discrepancies when I grab the code from varius distances. Does that make sense?
e.g. from ~ 2ft I get:
900,900,1700,900,900,900,900,900,1700,900,900 for ON's and from 6-7 feet I get
900,1700,900,900,900,900,900,900,1700,900,900.

Transmitting either did not help

I'm able to confirm the code with the scope. When I capture the retransmitted code from arduino I see typically three 1000 usec pulses then 2-3 sec off before the actual code. Don't know where these 3 long pulses come from nor whether they are part of the problem.

The actual TX'd code is formed by a number of 35 Khrz carrier for the correct sequence of on's and off's. I was able to change the cycle period of the TX program to 9Usec on and 2 Usec off total 22 vs 26 Usec and that brought the carrier frequency up to 38 Khrz but that did'nt help.

Any thoughts and suggestions appreciated

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

Return to “Arduino”