IR Codes Doesn't Control AC

An area for more general discussion by the user community for topics not covered elsewhere
Lucifer22334
Posts: 10
Joined: Mon May 20, 2019 10:36 am

IR Codes Doesn't Control AC

Post by Lucifer22334 »

Hi all,

I am using IRLib2 Library to control TV and AC. My TV is working great after recording raw codes from it's remote and sending it. But my AC is not working for the same. I have a Panasonic AC and tried recording its codes it gave me this:

Code: Select all

#define RAW_DATA_LEN 100
uint16_t rawData[RAW_DATA_LEN]={
	3474, 1870, 298, 646, 298, 1418, 298, 646, 
	294, 646, 322, 598, 318, 646, 298, 638, 
	322, 622, 354, 566, 350, 586, 350, 586, 
	350, 582, 350, 586, 350, 1386, 326, 586, 
	322, 614, 350, 586, 322, 642, 354, 566, 
	350, 586, 350, 586, 350, 1366, 346, 1366, 
	346, 1390, 298, 638, 298, 618, 350, 1366, 
	346, 590, 346, 586, 350, 586, 350, 586, 
	346, 590, 346, 586, 350, 586, 350, 590, 
	346, 590, 318, 642, 386, 554, 322, 582, 
	386, 578, 318, 594, 350, 582, 350, 590, 
	346, 586, 350, 586, 350, 610, 322, 614, 
	294, 622, 350, 1000};
I used this code to send the above raw code but didn't get any response.

I studied that AC IR codes are long codes or say Long signals I used another decoding from AnalysIR. And got codes with hyphens. I wasn't able to find how can I send these codes so moved back to my original one.

I have tried code solution of this but didn't work: https://forum.arduino.cc/index.php?topic=418106.new#new

Got this raw code :

Code: Select all

3396, 1740, 436, 476, 408, 1300, 404,  480, 408, 476, 408,  476, 408,  476, 408,  476, 408,  480, 408,  476, 408, 476, 408,  476, 408,  480, 404, 480, 408, 1272, 432,  476, 408,  476, 412,  476, 408,  476, 408,  476, 408,  476, 408,  476, 412,  1268, 436,  1300, 408, 1296, 408,  476, 408,  480, 408,  1296, 408,  476, 408, 480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  480, 404, 480, 404,  480, 408,  476, 408,  476, 408,  480, 404,  476, 412,  476, 408,  476, 408,  476, 408,  476, 408,  480, 408, 476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  1272, 432,  1276, 432,  480, 404,  476, 408,  480, 408,  476, 408,  476, 408,  9896, 3396,  1740, 432,  480, 404,  1276, 432,  476, 408,  480, 408,  476, 408,  476, 408,  476, 408,  476, 408,  476, 408,  480, 408,  476, 408,  476, 408,  476, 408,  1300, 408,  476, 408,  476, 408,  476, 408,  476, 408,  480, 408,  476, 408,  476, 408,  1272, 436,  1272, 432,  1272, 436,  476, 408,  476, 408,  1272, 436,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 412,  472, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  1272, 432,  480, 408,  1272, 432,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  476, 408,  480, 404,  1276, 432,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  1272, 432,  1272, 436,  1272, 432,  1276, 432,  1272, 432,  480, 408,  1272, 432,  480, 404,  1492, 216,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  476, 412,  476, 408,  476, 408,  476, 408,  476, 408,  476, 412,  476, 408,  476, 408,  476, 408,  480, 404,  1296, 412,  1272, 432,  1296, 412,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  476, 408,  480, 408,  1268, 436,  1272, 436,  1268, 436,  476, 408,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  476, 408,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  1272, 436,  476, 408,  476, 408,  1272, 436,  476, 408,  476, 408,  476, 408,  1272, 436,  476, 408,  476, 408,  476, 408,  476, 412,  476, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  480, 404,  480, 408,  476, 408,  476, 408,  476, 408,  1296, 412,  476, 408,  1272, 432,  1272, 436,  1272, 436,  1268, 436
Tried sending through analysir code but didn't work.
Please help me regarding this Problem.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR Codes Doesn't Control AC

Post by AnalysIR »

It looks like you ran into a sie limit ith the library, which is common for AC signals.

try this sketch from our blog: https://www.analysir.com/blog/2014/03/1 ... s-arduino/
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR Codes Doesn't Control AC

Post by AnalysIR »

OK - I loaded the second signal you posted above into AnalysIR, which didnt recognise it at first, but once I used the 'clean' feature it then deocoded OK

Here is the corrected signals:

Code: Select all

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits : Carrier Frequency (kHz)
0 : PANASONIC128_216_280AC :  : 40040720000000604004072000140401F50000700700009100002F : 216 : 0
Note: Be sure to use the correct Carrier frequency, for each individual signal, as(or if) indicated above
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit https://www.AnalysIR.com/ or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct carrier frequency


uint16_t Signal_0_0[] = {3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,9896,3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,1300,435,1300,435,435,435,1300,435,435,435,1300,216,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,1300,435,1300,435,1300,435,1300,435}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: PANASONIC128_216_280AC, Key:  
I studied that AC IR codes are long codes or say Long signals I used another decoding from AnalysIR. And got codes with hyphens. I wasn't able to find how can I send these codes so moved back to my original one.
The minus signs are used to indicate spaces (vs Marks ) of the IR signal. You can simply remove the '-'s when loading into the sendRAW function. However, make sure the first value is always a mark.
Lucifer22334
Posts: 10
Joined: Mon May 20, 2019 10:36 am

Re: IR Codes Doesn't Control AC

Post by Lucifer22334 »

AnalysIR wrote: Mon May 20, 2019 12:08 pm It looks like you ran into a sie limit ith the library, which is common for AC signals.

try this sketch from our blog: https://www.analysir.com/blog/2014/03/1 ... s-arduino/
I have tried this. At the end, it has a receiver's code I have used it to decode the Remote signals but didn't work.
Lucifer22334
Posts: 10
Joined: Mon May 20, 2019 10:36 am

Re: IR Codes Doesn't Control AC

Post by Lucifer22334 »

AnalysIR wrote: Mon May 20, 2019 12:17 pm OK - I loaded the second signal you posted above into AnalysIR, which didnt recognise it at first, but once I used the 'clean' feature it then deocoded OK

Here is the corrected signals:

Code: Select all

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits : Carrier Frequency (kHz)
0 : PANASONIC128_216_280AC :  : 40040720000000604004072000140401F50000700700009100002F : 216 : 0
Note: Be sure to use the correct Carrier frequency, for each individual signal, as(or if) indicated above
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit https://www.AnalysIR.com/ or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct carrier frequency


uint16_t Signal_0_0[] = {3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,9896,3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,1300,435,1300,435,435,435,1300,435,435,435,1300,216,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,1300,435,1300,435,1300,435,1300,435}; //AnalysIR Batch Export (IRremote) - RAW

irsend.sendRaw(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export (IRremote) - RAW
 // AnalysIR IR Protocol: PANASONIC128_216_280AC, Key:  
I studied that AC IR codes are long codes or say Long signals I used another decoding from AnalysIR. And got codes with hyphens. I wasn't able to find how can I send these codes so moved back to my original one.
The minus signs are used to indicate spaces (vs Marks ) of the IR signal. You can simply remove the '-'s when loading into the sendRAW function. However, make sure the first value is always a mark.
I copied your corrected code and tried but still doesn't work. And what did you do for cleaning it?
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR Codes Doesn't Control AC

Post by AnalysIR »

I copied your corrected code and tried but still doesn't work.
Then it may be that your IR emitter circuit is not great. Post a schematic or photo.
And what did you do for cleaning it?
Our AnalysIR application has lots of features like this & is available from our webshop along with a range of IR modules.
I have tried this. At the end, it has a receiver's code I have used it to decode the Remote signals but didn't work.
Not really sure what you mean here, but the issue may be the same as above. Maybe bring your IR emitter closer to your AC and point the top of the LED at the AC receiver.
Lucifer22334
Posts: 10
Joined: Mon May 20, 2019 10:36 am

Re: IR Codes Doesn't Control AC

Post by Lucifer22334 »

Here's the image of the IR transmitter I am using. Ok, I will try doing IR LED close to the AC receiver.

Image

I have tried taking it close to the AC receiver but it didn't work.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR Codes Doesn't Control AC

Post by AnalysIR »

Yes

that will not give you much range. It looks like the resistor is 220R. You could change that to 100R or even 68R on a 5V arduino.

Using a transistor to drive the IR LED will increase range a lot. There are several posts on our blog & google about this.
Lucifer22334
Posts: 10
Joined: Mon May 20, 2019 10:36 am

Re: IR Codes Doesn't Control AC

Post by Lucifer22334 »

AnalysIR wrote: Mon May 20, 2019 2:29 pm Yes

that will not give you much range. It looks like the resistor is 220R. You could change that to 100R or even 68R on a 5V Arduino.

Using a transistor to drive the IR LED will increase the range a lot. There are several posts on our blog & google about this.
As you said I created the same ckt on a breadboard using 100R and tried but didn't work. I have tried with other AC then Panasonic and some of them are working fine.

Is this matter happens much with Panasonic ACs? And do you provide me with different transmitting and receiving the code then of your AC blogs.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR Codes Doesn't Control AC

Post by AnalysIR »

Post the code you are using & a photo of your wiring.

Using a transistor is strongly recommended.
And do you provide me with different transmitting and receiving the code then of your AC blogs.
We sell a wide range of high quality IR software and hardware for makers/diy on our webshop, which will work fine.
Post Reply