Go Down

Topic: IR Remote control of Air Conditioner - Can't get it to work  (Read 11118 times) previous topic - next topic

UHF

Thanks for all this. I had the same problem with a Samsung AC, using IRLIB gave the SANYO FFFFFFFF codes as above. Using IRremote gave two separate sets of codes. Both cases were too short - around 116 ints.
I used the Analysir Arduino code in post #9 and got a longer 349 int code. This works successfully. I removed the minus signs and used the code in IRsendRawDemo example with the IRremote library at 38kHz. Make sure your IR LED is bright enough.

iamdhongki

Hi i started working with arduino about 3 days ago. I am using TSOP4838 ir receiver to get codes from DAIKIN AC remote control. Unfortunately, the receiver gets different codes from same button. Has anyone here already tried working on this AC Remote Control? I also tried the library in a SHARP TV remote control but still receiving different codes.

zoomx


castaway111

im so happy that you Byork help me with post  #9 that i have to say THANK YOU :)

Mahmoud_Bakry

Thanks Byork & J_d i trying Byork code and its working after more than month from searching and that is my results
1- with ir sensor vs1838b you mast tern off all light and working with dark to get right single
2- try send in range about 2 meter every try   ... that is  my problem now. code is right and working perfectly in this rang but out this not working .

=======
any one can help me my single is weak working in rang 2 meter how i can improve it to work form 4 meter

i sorry my English so bad
thanks

Lucifer22334


JD, sure here's what I did. Both receiving and sending are tested on Uno and Nano.

For receiving the signal, I am using the TSOP4838, connected to pin 2 according to the sketch. After pressing the button on your AC  remote, you may need to wait up to 5 seconds for the code to appear in serial monitor. The sketch I used was:

Code: [Select]

#define LEDPIN 13
//you may increase this value on Arduinos with greater than 2k SRAM
#define maxLen 800

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(115200); //change BAUD rate as required
  attachInterrupt(0, 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(0);//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(0, 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

}


My AC IR code received was this:

Code: [Select]
Raw: (439) 3552, -1664, 508, -364, 508, -1232, 504, -364, 508, -360, 508, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -1236, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -1232, 508, -1232, 480, -1256, 484, -392, 480, -388, 480, -1256, 484, -388, 480, -388, 480, -392, 504, -364, 480, -388, 508, -360, 508, -364, 480, -388, 504, -364, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -368, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 508, -360, 508, -364, 504, -364, 504, -364, 508, -364, 504, -368, 476, -392, 476, -392, 480, -1256, 484, -1256, 508, -364, 504, -364, 504, -364, 508, -360, 508, -364, 504, -10884, 3528, -1688, 504, -368, 504, -1232, 484, -384, 484, -388, 484, -384, 484, -384, 484, -384, 484, -392, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -1228, 508, -364, 504, -364, 508, -364, 504, -364, 504, -368, 504, -364, 504, -364, 504, -1232, 508, -1232, 508, -1232, 504, -364, 508, -364, 504, -1232, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -1236, 504, -1232, 480, -1260, 484, -384, 484, -384, 484, -384, 484, -388, 484, -384, 508, -368, 476, -1256, 508, -1228, 512, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -1236, 504, -1232, 504, -364, 508, -364, 504, -364, 504, -1236, 504, -1232, 480, -388, 480, -392, 484, -384, 480, -388, 484, -388, 484, -384, 484, -384, 484, -392, 480, -388, 480, -388, 480, -388, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -1232, 504, -1236, 504, -1232, 504, -364, 508, -364, 504, -364, 480, -388, 480, -392, 476, -392, 480, -392, 480, -388, 480, -392, 480, -1252, 512, -1232, 504, -1232, 508, -364, 504, -364, 504, -364, 504, -368, 504, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -368, 472, -396, 476, -392, 476, -392, 476, -396, 476, -1256, 484, -392, 476, -392, 480, -388, 480, -388, 508, -364, 504, -364, 504, -1236, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 504, -364, 508, -364, 504, -364, 504, -364, 508, -364, 504, -368, 500, -368, 500, -368, 476, -396, 476, -392, 476, -392, 476, -1260, 484, -1252, 484, -1260, 480, -388, 504, -364, 508, -364, 504, -1232, 508

You then need to remove all the negative signs using a text editor. After which I used and inserted my IR code into this sketch. The IR emitter LED is connected to pin 3 as according to the sketch:

Code: [Select]
/*
 * IRremote: IRsendRawDemo - demonstrates sending IR codes with sendRaw
 * An IR LED must be connected to Arduino PWM pin 3.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 *
 * IRsendRawDemo - added by AnalysIR (via www.AnalysIR.com), 24 August 2015
 */


#include <IRremote.h>

IRsend irsend;

void setup()
{

}

void loop() {
  int khz = 38; // 38kHz carrier frequency for the NEC protocol
  unsigned int irSignal[] = {3552, 1664, 508, 364, 508, 1232, 504, 364, 508, 360, 508, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 1236, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 1232, 508, 1232, 480, 1256, 484, 392, 480, 388, 480, 1256, 484, 388, 480, 388, 480, 392, 504, 364, 480, 388, 508, 360, 508, 364, 480, 388, 504, 364, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 368, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 508, 360, 508, 364, 504, 364, 504, 364, 508, 364, 504, 368, 476, 392, 476, 392, 480, 1256, 484, 1256, 508, 364, 504, 364, 504, 364, 508, 360, 508, 364, 504, 10884, 3528, 1688, 504, 368, 504, 1232, 484, 384, 484, 388, 484, 384, 484, 384, 484, 384, 484, 392, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 1228, 508, 364, 504, 364, 508, 364, 504, 364, 504, 368, 504, 364, 504, 364, 504, 1232, 508, 1232, 508, 1232, 504, 364, 508, 364, 504, 1232, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 1236, 504, 1232, 480, 1260, 484, 384, 484, 384, 484, 384, 484, 388, 484, 384, 508, 368, 476, 1256, 508, 1228, 512, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 1236, 504, 1232, 504, 364, 508, 364, 504, 364, 504, 1236, 504, 1232, 480, 388, 480, 392, 484, 384, 480, 388, 484, 388, 484, 384, 484, 384, 484, 392, 480, 388, 480, 388, 480, 388, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 1232, 504, 1236, 504, 1232, 504, 364, 508, 364, 504, 364, 480, 388, 480, 392, 476, 392, 480, 392, 480, 388, 480, 392, 480, 1252, 512, 1232, 504, 1232, 508, 364, 504, 364, 504, 364, 504, 368, 504, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 368, 472, 396, 476, 392, 476, 392, 476, 396, 476, 1256, 484, 392, 476, 392, 480, 388, 480, 388, 508, 364, 504, 364, 504, 1236, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 504, 364, 508, 364, 504, 364, 504, 364, 508, 364, 504, 368, 500, 368, 500, 368, 476, 396, 476, 392, 476, 392, 476, 1260, 484, 1252, 484, 1260, 480, 388, 504, 364, 508, 364, 504, 1232, 508};
  
  irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); //Note the approach used to automatically calculate the size of the array.

  delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.
}



I am having the same Problem and tried above code also and method but then also it's not working I am getting 439 and 238 long codes. Please Help.

Go Up