Send infrared raw signal to air conditioning using Arduino

I am working on my final year project and I’ve got a problem to which I cannot find an answer. I tried decoding the infrared signals for my air conditioning. I have decoded both raw and hex, both using Arduino and Raspberry PI (LIRC), but my air conditioning does not turn on when I send the signals. AC Brand is Acson. What I am doing I think it’s correct because my TV turns on and off when I send the decoded signals. I also tried sending the raw codes at different frequencies (36 kHz, 38, 40, 433…). None of them seems to be working. Please help me…

These are the raw codes for the turn on/off button (they are changing every time):

  1. Unknown encoding: 4F15BD0C (32 bits) Raw (132): 8932 4550 -2550 300 -450 300 -1000 300 -1000 300 -450 300 -1000 250 -500 300 -450 300 -450 300 -400 300 -500 250 -500 300 -950 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -1000 300 -950 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -400 300 -500 300 -450 300 -450 300 -400 300 -450 300 -500 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -950 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 250 -450 300 -1000 300 -1000 300 -450 350

  2. Unknown encoding: 4F15BD0C (32 bits) Raw (132): -21344 4550 -2600 300 -450 300 -1000 300 -950 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -400 300 -500 250 -500 300 -950 300 -1000 300 -450 300 -450 300 -1000 300 -1000 250 -500 300 -450 300 -450 250 -450 300 -1000 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -950 300 -500 300 -450 300 -450 250 -450 300 -450 300 -500 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -1000 300 -1000 300 -450 350

  3. Unknown encoding: 4F15BD0C (32 bits) Raw (132): -3150 4550 -2600 300 -450 300 -1000 300 -1000 250 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -400 300 -500 300 -450 300 -950 300 -1000 300 -450 300 -450 300 -1000 300 -1000 250 -500 300 -450 300 -450 300 -400 300 -1000 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -950 300 -500 300 -450 300 -450 300 -400 300 -450 300 -500 250 -450 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -400 300 -1000 300 -500 250 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -1000 300 -1000 300 -450 350

This is the code I used for the decoding part:

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;

//#define RAWBUF 255

void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
}

// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
//  decode_results *results = (decode_results *)v
void dump(decode_results *results) {
 int count = results->rawlen;
 if (results->decode_type == UNKNOWN) {
   Serial.print("Unknown encoding: ");
 }
 else if (results->decode_type == NEC) {
   Serial.print("Decoded NEC: ");
 }
 else if (results->decode_type == SONY) {
   Serial.print("Decoded SONY: ");
 }
 else if (results->decode_type == RC5) {
   Serial.print("Decoded RC5: ");
 }
 else if (results->decode_type == RC6) {
   Serial.print("Decoded RC6: ");
 }
 else if (results->decode_type == PANASONIC) {  
   Serial.print("Decoded PANASONIC - Address: ");
   Serial.print(" Value: ");
 }
 else if (results->decode_type == JVC) {
    Serial.print("Decoded JVC: ");
 }
 Serial.print(results->value, HEX);
 Serial.print(" (");
 Serial.print(results->bits, DEC);
 Serial.println(" bits)");
 Serial.print("Raw (");
 Serial.print(count, DEC);
 Serial.print("): ");

 for (int i = 0; i < count; i++) {
   if ((i % 2) == 1) {
     Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
   }
   else {
     Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
   }
   Serial.print(" ");
 }
 Serial.println("");
}


void loop() {
 if (irrecv.decode(&results)) {
   Serial.println(results.value, HEX);
   dump(&results);
   irrecv.resume(); // Receive the next value
 }
}

And this one is for sending raw signals to AC:

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

void loop() {

  for (int i = 0; i < 1000; i++)
  {
       // send variable sonyPower in length 31 at 40 Khz
       irsend.sendRaw(turnOff,131,433);

       delay(3000);
  }
}

How in the world are we suppose to know?
You need to go talk to Acson.

No experience there, but I read that AC codes are longer than normal.

//#define RAWBUF 255

Did you comment that out?

Read this.

Leo..

Most probably this is an encoding with a REPEAT code, that is sent instead of dupes of the original code. See the repeating pattern at the end of each dump. Did you use the latest version of the IRremote library?