Page 1 of 2

send IR signal to AC

Posted: Sun Aug 18, 2019 11:14 pm
by rania-elqadi
hello everyone , i'm trying to control my AC split unit using arduino and IR LED (using windows 10)
first i used the sketch to get the IR codes for ON and OFF button at 25 degree cold mode :
ON button : Decoded NEC: 9E90040A (32 bits)
Raw (74): 8900 ,4400 750 ,1500 650 ,550 650 ,550 650 ,1600 700 ,1550 700 ,1600 650 ,1600 700 ,500 700 ,1550 650 ,550 650 ,500 650 ,1650 650 ,500 700 ,500 700 ,500 650 ,550 700 ,450 700 ,500 700 ,500 650 ,500 700 ,500 650 ,1600 700 ,500 650 ,550 700 ,500 650 ,500 700 ,500 700 ,500 650 ,1600 650 ,550 650 ,1600 700 ,500 650 ,550 650 ,1600 650 ,550 650

the OFF button : Decoded NEC: 8E90040A (32 bits)
Raw (74): 8900 ,4400 800 ,1450 700 ,500 700 ,500 650 ,550 650 ,1600 700 ,1550 650 ,1650 650 ,500 700 ,1600 700 ,450 700 ,500 700 ,1550 650 ,550 650 ,550 650 ,500 700 ,500 700 ,500 700 ,500 650 ,500 700 ,500 700 ,500 650 ,1600 650 ,550 650 ,550 650 ,500 700 ,500 700 ,500 650 ,500 700 ,1600 700 ,450 700 ,1600 650 ,550 650 ,500 700 ,1600 700 ,450 700

then i tried to send those codes using irsend but there is no response from the AC and i make it sure that the IR LED is working( using my cell phone camera )
(NOTE: the remote is YB1F2 type )
please help my
thanks in advance.

Re: send IR signal to AC

Posted: Mon Aug 19, 2019 11:06 am
by AnalysIR
Your first signal decodes as a GREE 32 bit AC signal on our AnalysIR application.

I have cleaned up the timings as below, using the 'clean' feature of AnalysIR.

Code: Select all

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: info@analysir.com
Session History
Type : Key : Value : Bits : Carrier Frequency (kHz)
0 : GREE32_64AC :  : 9E90040A : 32 : 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 info@analysir.com, 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


unsigned int Signal_0_0[] = {9000,4500,600,1690,600,600,600,600,600,1690,600,1690,600,1690,600,1690,600,600,600,1690,600,600,600,600,600,1690,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1690,600,600,600,600,600,600,600,600,600,600,600,600,600,1690,600,600,600,1690,600,600,600,600,600,1690,600,600,600}; //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: GREE32_64AC, Key:  
For the second signal & others you can simply adjust the timings as above, for better performance. (It probably needs to be cleaned up)
PS: It is just a coincidence (or false positive) that IRremote decoded to the correct HEX values. It is not an NEC signal.

Re: send IR signal to AC

Posted: Mon Aug 19, 2019 11:37 pm
by rania-elqadi
thanks for your quick reply , i tried the modified signal that you has sent it to me but it doesn't work . after while , i used the arduino sketch mentioned in the below link to get my raw signal
https://www.analysir.com/blog/2014/03/1 ... s-arduino/
it gives me the signals as :
ON signal : Raw: (139) 8972, -4444, 664, -1624, 664, -532, 692, -508, 664, -1624, 688, -1600, 692, -1596, 668, -1624, 716, -480, 692, -1596, 664, -536, 688, -508, 692, -1596, 716, -480, 692, -508, 692, -504, 692, -508, 692, -504, 692, -508, 688, -508, 692, -504, 692, -508, 688, -1600, 688, -512, 688, -508, 688, -508, 692, -504, 692, -508, 692, -504, 692, -1596, 664, -536, 664, -1624, 664, -532, 692, -508, 692, -1596, 688, -508, 692, -19828, 692, -1620, 668, -532, 688, -508, 692, -508, 688, -1600, 716, -480, 692, -508, 688, -508, 692, -504, 692, -508, 688, -508, 692, -508, 688, -508, 692, -1596, 692, -508, 688, -508, 692, -504, 692, -508, 692, -504, 692, -508, 688, -508, 688, -508, 692, -508, 688, -508, 692, -508, 688, -508, 692, -504, 692, -508, 692, -1596, 688, -1600, 664, -1624, 664, -1624, 668,

OFF signal : Raw: (139) 9016, -4420, 668, -1620, 668, -532, 692, -504, 692, -508, 692, -1596, 664, -1624, 664, -1624, 664, -536, 688, -1600, 664, -532, 692, -508, 688, -1600, 688, -508, 692, -508, 692, -504, 692, -504, 692, -508, 688, -508, 692, -504, 692, -508, 692, -504, 692, -1600, 688, -508, 688, -508, 692, -508, 688, -508, 692, -508, 688, -508, 688, -1600, 664, -532, 692, -1600, 664, -532, 688, -508, 692, -1600, 688, -508, 688, -19856, 664, -1624, 664, -536, 688, -508, 692, -504, 692, -1596, 668, -532, 688, -508, 692, -508, 688, -508, 692, -504, 692, -508, 688, -508, 692, -508, 688, -1600, 716, -480, 692, -508, 688, -508, 688, -508, 692, -508, 688, -508, 692, -508, 688, -508, 692, -504, 692, -508, 688, -508, 692, -508, 688, -508, 692, -504, 692, -1600, 664, -1624, 716, -1572, 664, -532, 692,
and i'm tried to send those signal to my AC but still no action occur , what should i do ?

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 11:24 am
by AnalysIR
OK, that shows more info.

This time it is detected an ELECTROLUX67_134AC....now that the second part of the signal was captured.

yours is a 67 bit signal

try your first signal as below....

Code: Select all

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: info@analysir.com
Session History
Type : Key : Value : Bits : Carrier Frequency (kHz)
0 : ELECTROLUX67_134AC :  : 4F48020528804000F : 67 : 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 info@analysir.com, visit https://www.AnalysIR.com/ or email info@....... for further details
int khz=38; //NB Change this default value as necessary to the correct carrier frequency


unsigned int Signal_0_0[] = {9000,4500,600,1700,600,600,600,600,600,1700,600,1700,600,1700,600,1700,600,600,600,1700,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,1700,600,600,600,600,600,1700,600,600,600,19828,600,1700,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,1700,600,1700,600,1700,600}; //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: ELECTROLUX67_134AC, Key:  


Re: send IR signal to AC

Posted: Tue Aug 20, 2019 1:04 pm
by rania-elqadi
it's still doesn't work :( :( :( :( :(

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 1:29 pm
by AnalysIR
- Post the code you used, with the last sketch.
- Post the model # of your IR Receiver (or link)
- Post the circuit diagram of your IR emitter (and/or a photo)
- Post the platform you are using....eg Arduino UNO?

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 2:39 pm
by rania-elqadi
- sketch to decode the signals :
CODE:

Code: Select all

/*
Author: AnalysIR
Revision: 1.0 - Initial release
Revision: 1.1 - update generic digitalPinToInterrupt to support most arduino platform

This code is provided to overcome an issue with Arduino IR libraries
It allows you to capture raw timings for signals longer than 255 marks & spaces.
Typical use case is for long Air conditioner signals.

You can use the output to plug back into IRremote, to resend the signal.

This Software was written by AnalysIR.

Usage: Free to use, subject to conditions posted on blog below.
Please credit AnalysIR and provide a link to our website/blog, where possible.

Copyright AnalysIR 2014-2019

Please refer to the blog posting for conditions associated with use.
http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/

Connections:
IR Receiver      Arduino
V+          ->  +5v
GND          ->  GND
Signal Out   ->  Digital Pin 2
(If using a 3V3 Arduino, you should connect V+ to +3V3)

Tested on UNO only
*/

#define LEDPIN 13
//you may increase this value on Arduinos with greater than 2k SRAM
#define maxLen 800
#define rxPinIR 2 //pin D2 or D3 on standard arduinos. (other pins may be available on More mordern modules like MEga2560, DUE, ESP8266, ESP32)

#define RAWBUF 1000
volatile  unsigned int irBuffer[maxLen]; //stores timings - volatile because changed by ISR
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR

void setup() {
  Serial.begin(9600); //change BAUD rate as required
  attachInterrupt(digitalPinToInterrupt(rxPinIR), rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}

void loop() {
  // put your main code here, to run repeatedly:

  Serial.println(F("Press the button on the remote now - once only"));
  delay(5000); // pause 5 secs
  if (x) { //if a signal is captured
    digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
    Serial.println();
    Serial.print(F("Raw: (")); //dump raw header format - for library
    Serial.print((x - 1));
    Serial.print(F(") "));
    detachInterrupt(digitalPinToInterrupt(rxPinIR));//stop interrupts & capture until finshed here
    for (int i = 1; i < x; i++) { //now dump the times
      if (!(i & 0x1)) Serial.print(F("-"));
      Serial.print(irBuffer[i] - irBuffer[i - 1]);
      Serial.print(F(", "));
    }
    x = 0;
    Serial.println();
    Serial.println();
    digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time
    attachInterrupt(digitalPinToInterrupt(rxPinIR), rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal
  }

}

void rxIR_Interrupt_Handler() {
  if (x > maxLen) return; //ignore if irBuffer is already full
  irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions

}
-IR Reciver : Model KSM803 Link: https://ram-e-shop.com/product/ir-rx-3pin-tv/
- circuit of IR emitter:
Image
Image
Finally : i iuse arduino UNO

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 3:07 pm
by AnalysIR
OK thanks.

I meant to ask for the sending sketch (sorry), please post this.

Based on what you posted, the most likely thing is the IR emitter circuit.
Driving the IR emitter directly from an Arduino GPIO pin will work, but the range will be quite short.
You should be able to safely drop the resistor to 68R...but never leave out the resistor. (There is a post on our blog about this)

Suggestions:

- bring the IR LED close to the AC unit's receiver & point the top of the LED directly at the AC receiver.
- Consider using a transistor to drive the IR LED which will work much better (example on our blog or via web search).
Alternatively check out the solutions/modules in our online shop.

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 3:28 pm
by rania-elqadi
- the sending code


Code: Select all

#include <IRremote.h>

IRsend irsend;

void setup()
{
Serial.begin(9600);
}

void loop() {


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


unsigned int Signal_0_0[] = {9000,4500,600,1700,600,600,600,600,600,1700,600,1700,600,1700,600,1700,600,600,600,1700,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,1700,600,600,600,600,600,1700,600,600,600,19828,600,1700,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,1700,600,1700,600,1700,600,1700,600}; //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: ELECTROLUX67_134AC, Key:  
}
- i tried to bring the IR LED close to the AC unit's receiver but it doesn't work .

Re: send IR signal to AC

Posted: Tue Aug 20, 2019 3:39 pm
by AnalysIR
OK just add a delay(10000); at the end of the loop.

Otherwise you are continually sending the same signal which will be rejected as noise by the IR receiver & AC unit.

Also, if you are sending ON...make sure the AC is actually OFF, as nothing will happen is it is already ON