Sending IR code to air conditioner (clone IR remote)

Hello everyone,

I'm currently working on a project where I have to control two air conditioner units from different vendors via IR. I have the original remotes and I'm trying to "clone" them to send the same codes/signals to control the AC. I was able to read these codes with an IR receiver so far (at least I guess so, I got consistent data so I'm assuming it's correct), but I'm having troubles to send it using an IR emitter module.

I've tried different libraries, tried to use their examples and I also tried some solutions from many posts from the forum and other pages, but I haven't got any luck making this work.

The library I'm currently using is IRremote v4.4.1 included in the Arduino IDE (GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols). I've followed the instructions and was able to read the signal sent from the original remote. But I can't make it work when sending it back to the unit.

I'm trying to read data from two different remotes when pressing the POWER ON button using the following code based on the library's examples:


#define RAW_BUFFER_LENGTH 750

#include <Arduino.h>
#include <IRremote.hpp>

#define IR_RECEIVE_PIN 2

void setup() {
  Serial.begin(9600);
  Serial.println("Starting");
  IrReceiver.begin(IR_RECEIVE_PIN, false);
}

void loop() {
  if(IrReceiver.decode()){
    Serial.println("received ir");
    Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
    IrReceiver.printIRResultShort(&Serial);
    IrReceiver.printIRSendUsage(&Serial);
    Serial.println();
    IrReceiver.resume();  
  }
}

Remote "A" sends a single code (36897D58) with an UNKNOWN protocol. I've checked with different buttons and the received codes seem to be consistent.

received ir
36897D58
Protocol=UNKNOWN Hash=0x36897D58 100 bits (incl. gap and start) received

Remote "B" sends two codes (6500 and 4900) with PulseDistance protocol.
I've also checked with different buttons, and with this remote it seems to send two codes in a row: first the same 6500 no matter which button I press, then the second other code according to the button/function - in this case 4900=power on. (I needed to comment out the printIRSendUsage line for the second code to be read, otherwise it only read the first same 6500 for every button I pressed).

WIth printIRSendUsage:

received ir
6500
Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x226CB23, 0x4000, 0x0, 0x6500};
    IrSender.sendPulseDistanceWidthFromArray(38, 3050, 1550, 550, 1050, 550, 250, &tRawData[0], 112, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

WIthout printIRSendUsage:

6500
Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first

received ir
4900
Protocol=PulseDistance Repeat gap=71000us Raw-Data=0x4900 112 bits LSB first

For the second remote I tried to used the command it gave on the output, and I also tried with raw data for the two remotes. In both cases the signal is sent by the IR LED (I don't know whether it's sent correctly or not), but it doesn't do anything with the AC devices.

I've also tried many other approaches, none of them successful, including:

Data read from the original remotes using the ReceiveDump example from the library:

Remote A: (in this case it only reads the first code/part of the code - 0x6500 for any button, the 0x4900 part is not read)

Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first

Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x226CB23, 0x4000, 0x0, 0x6500};
    IrSender.sendPulseDistanceWidthFromArray(38, 3050, 1550, 550, 1050, 550, 250, &tRawData[0], 112, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[228]: 
 -65535
 +61,-31
 +11,-21 +10,-21 +10,- 6 +10,- 6
 +11,- 5 +11,-21 +10,- 6 +10,- 6
 +10,-22 +10,-21 +10,- 6 +10,-21
 +11,- 5 +11,- 6 +10,-21 +10,-21
 +11,- 5 +11,-21 +10,-21 +10,- 5
 +11,- 6 +11,-21 +10,- 6 +10,- 5
 +11,- 5 +12,-21 +10,- 5 +11,- 6
 +10,- 6 +10,- 5 +12,- 4 +12,- 5
 +11,- 5 +11,- 5 +11,- 5 +11,- 6
 +11,- 5 +11,- 5 +11,- 5 +11,- 5
 +11,- 5 +12,- 4 +12,- 6 +10,- 5
 +11,- 5 +11,- 6 +10,-22 +10,- 5
 +11,- 5 +11,- 5 +11,- 5 +11,- 5
 +12,- 4 +12,- 5 +11,- 5 +11,- 5
 +11,- 5 +12,- 4 +12,- 5 +11,- 5
 +11,- 5 +11,- 5 +11,- 5 +12,- 4
 +12,- 5 +11,- 5 +11,- 5 +11,- 5
 +12,- 4 +12,- 4 +12,- 5 +11,- 5
 +11,- 5 +11,- 5 +12,- 4 +12,- 5
 +11,- 5 +11,- 5 +11,- 5 +11,- 5
 +12,- 4 +12,- 5 +11,- 5 +11,- 5
 +11,- 5 +12,- 4 +12,- 5 +11,- 5
 +11,- 5 +11,- 6 +10,- 5 +12,- 4
 +12,- 5 +11,- 5 +11,- 5 +11,- 5
 +11,- 5 +12,- 4 +12,- 5 +11,- 5
 +11,- 5 +11,- 6 +11,- 4 +12,- 5
 +11,-21 +10,- 5 +11,-22 +10,- 5
 +11,- 5 +11,-21 +10,-22 +10,- 5
 +11
Sum: 2172
Raw result in microseconds - with leading gap
rawData[228]: 
 -3276750
 +3050,-1550
 + 550,-1050 + 500,-1050 + 500,- 300 + 500,- 300
 + 550,- 250 + 550,-1050 + 500,- 300 + 500,- 300
 + 500,-1100 + 500,-1050 + 500,- 300 + 500,-1050
 + 550,- 250 + 550,- 300 + 500,-1050 + 500,-1050
 + 550,- 250 + 550,-1050 + 500,-1050 + 500,- 250
 + 550,- 300 + 550,-1050 + 500,- 300 + 500,- 250
 + 550,- 250 + 600,-1050 + 500,- 250 + 550,- 300
 + 500,- 300 + 500,- 250 + 600,- 200 + 600,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 300
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 200 + 600,- 300 + 500,- 250
 + 550,- 250 + 550,- 300 + 500,-1100 + 500,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 600,- 200 + 600,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 200 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 600,- 200
 + 600,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 600,- 200 + 600,- 200 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 600,- 200 + 600,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 600,- 200 + 600,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 200 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 300 + 500,- 250 + 600,- 200
 + 600,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 200 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 300 + 550,- 200 + 600,- 250
 + 550,-1050 + 500,- 250 + 550,-1100 + 500,- 250
 + 550,- 250 + 550,-1050 + 500,-1100 + 500,- 250
 + 550
Sum: 108600

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[227] = {61,31, 11,21, 10,21, 10,6, 10,6, 11,5, 11,21, 10,6, 10,6, 10,22, 10,21, 10,6, 10,21, 11,5, 11,6, 10,21, 10,21, 11,5, 11,21, 10,21, 10,5, 11,6, 11,21, 10,6, 10,5, 11,5, 12,21, 10,5, 11,6, 10,6, 10,5, 12,4, 12,5, 11,5, 11,5, 11,5, 11,6, 11,5, 11,5, 11,5, 11,5, 11,5, 12,4, 12,6, 10,5, 11,5, 11,6, 10,22, 10,5, 11,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,5, 12,4, 12,4, 12,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,6, 10,5, 12,4, 12,5, 11,5, 11,5, 11,5, 11,5, 12,4, 12,5, 11,5, 11,5, 11,6, 11,4, 12,5, 11,21, 10,5, 11,22, 10,5, 11,5, 11,21, 10,22, 10,5, 11};  // Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[227] = {3030,1570, 530,1070, 480,1070, 480,320, 480,320, 530,270, 530,1070, 480,320, 480,320, 480,1120, 480,1070, 480,320, 480,1070, 530,270, 530,320, 480,1070, 480,1070, 530,270, 530,1070, 480,1070, 480,270, 530,320, 530,1070, 480,320, 480,270, 530,270, 580,1070, 480,270, 530,320, 480,320, 480,270, 580,220, 580,270, 530,270, 530,270, 530,270, 530,320, 530,270, 530,270, 530,270, 530,270, 530,270, 580,220, 580,320, 480,270, 530,270, 530,320, 480,1120, 480,270, 530,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,270, 580,220, 580,220, 580,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,320, 480,270, 580,220, 580,270, 530,270, 530,270, 530,270, 530,270, 580,220, 580,270, 530,270, 530,270, 530,320, 530,220, 580,270, 530,1070, 480,270, 530,1120, 480,270, 530,270, 530,1070, 480,1120, 480,270, 530};  // Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first

uint16_t address = 0x0;
uint16_t command = 0x0;
uint32_t rawData = 0x6500;


Pronto Hex as string
char prontoData[] = "0000 006D 0072 0000 0076 003B 0016 0028 0014 0028 0014 000B 0014 000B 0016 0009 0016 0028 0014 000B 0014 000B 0014 002A 0014 0028 0014 000B 0014 0028 0016 0009 0016 000B 0014 0028 0014 0028 0016 0009 0016 0028 0014 0028 0014 0009 0016 000B 0016 0028 0014 000B 0014 0009 0016 0009 0018 0028 0014 0009 0016 000B 0014 000B 0014 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0016 000B 0016 0009 0016 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 000B 0014 0009 0016 0009 0016 000B 0014 002A 0014 0009 0016 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 000B 0014 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 0009 0016 0009 0018 0007 0018 0009 0016 0009 0016 0009 0016 000B 0016 0007 0018 0009 0016 0028 0014 0009 0016 002A 0014 0009 0016 0009 0016 0028 0014 002A 0014 0009 0016 06C3 ";

Remote B:

Protocol=UNKNOWN Hash=0x36897D58 100 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol


Raw result in internal ticks (50 us) - with leading gap
rawData[200]: 
 -65535
 +87,-85
 +11,-32 +11,-11 +10,-32 +11,-31
 +11,-11 +11,-10 +11,-31 +11,-12
 +10,-12 + 9,-32 +11,-10 +11,-11
 +11,-31 +11,-32 +11,-10 +11,-32
 +11,-10 +11,-11 +10,-12 +10,-31
 +11,-32 +11,-32 +10,-32 +11,-32
 +11,-31 +11,-32 +11,-31 +11,-11
 +11,-11 +10,-11 +10,-11 +11,-11
 +10,-11 +11,-31 +11,-11 +11,-31
 +11,-32 +11,-11 +10,-12 + 9,-11
 +11,-32 +10,-11 +11,-32 +10,-11
 +11,-10 +11,-32 +11,-31 +11,-32
 +10,-103 +86,-85 +11,-32 +11,-11
 +10,-32 +11,-32 +10,-11 +11,-10
 +11,-32 +11,-10 +11,-11 +11,-31
 +11,-11 +11,-11 +10,-32 +10,-32
 +11,-11 +10,-32 +11,-11 +10,-12
 +10,-10 +11,-32 +11,-31 +11,-32
 +11,-32 +10,-32 +11,-32 +11,-31
 +11,-32 +11,-10 +11,-11 +11,-10
 +11,-10 +11,-11 +11,-10 +11,-32
 +11,-10 +11,-32 +11,-31 +11,-12
 +10,-11 +10,-11 +10,-32 +11,-11
 +10,-32 +11,-11 +10,-12 +10,-31
 +11,-32 +11,-32 + 9
Sum: 3536
Raw result in microseconds - with leading gap
rawData[200]: 
 -3276750
 +4350,-4250
 + 550,-1600 + 550,- 550 + 500,-1600 + 550,-1550
 + 550,- 550 + 550,- 500 + 550,-1550 + 550,- 600
 + 500,- 600 + 450,-1600 + 550,- 500 + 550,- 550
 + 550,-1550 + 550,-1600 + 550,- 500 + 550,-1600
 + 550,- 500 + 550,- 550 + 500,- 600 + 500,-1550
 + 550,-1600 + 550,-1600 + 500,-1600 + 550,-1600
 + 550,-1550 + 550,-1600 + 550,-1550 + 550,- 550
 + 550,- 550 + 500,- 550 + 500,- 550 + 550,- 550
 + 500,- 550 + 550,-1550 + 550,- 550 + 550,-1550
 + 550,-1600 + 550,- 550 + 500,- 600 + 450,- 550
 + 550,-1600 + 500,- 550 + 550,-1600 + 500,- 550
 + 550,- 500 + 550,-1600 + 550,-1550 + 550,-1600
 + 500,-5150 +4300,-4250 + 550,-1600 + 550,- 550
 + 500,-1600 + 550,-1600 + 500,- 550 + 550,- 500
 + 550,-1600 + 550,- 500 + 550,- 550 + 550,-1550
 + 550,- 550 + 550,- 550 + 500,-1600 + 500,-1600
 + 550,- 550 + 500,-1600 + 550,- 550 + 500,- 600
 + 500,- 500 + 550,-1600 + 550,-1550 + 550,-1600
 + 550,-1600 + 500,-1600 + 550,-1600 + 550,-1550
 + 550,-1600 + 550,- 500 + 550,- 550 + 550,- 500
 + 550,- 500 + 550,- 550 + 550,- 500 + 550,-1600
 + 550,- 500 + 550,-1600 + 550,-1550 + 550,- 600
 + 500,- 550 + 500,- 550 + 500,-1600 + 550,- 550
 + 500,-1600 + 550,- 550 + 500,- 600 + 500,-1550
 + 550,-1600 + 550,-1600 + 450
Sum: 176800

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[199] = {87,85, 11,32, 11,11, 10,32, 11,31, 11,11, 11,10, 11,31, 11,12, 10,12, 9,32, 11,10, 11,11, 11,31, 11,32, 11,10, 11,32, 11,10, 11,11, 10,12, 10,31, 11,32, 11,32, 10,32, 11,32, 11,31, 11,32, 11,31, 11,11, 11,11, 10,11, 10,11, 11,11, 10,11, 11,31, 11,11, 11,31, 11,32, 11,11, 10,12, 9,11, 11,32, 10,11, 11,32, 10,11, 11,10, 11,32, 11,31, 11,32, 10,103, 86,85, 11,32, 11,11, 10,32, 11,32, 10,11, 11,10, 11,32, 11,10, 11,11, 11,31, 11,11, 11,11, 10,32, 10,32, 11,11, 10,32, 11,11, 10,12, 10,10, 11,32, 11,31, 11,32, 11,32, 10,32, 11,32, 11,31, 11,32, 11,10, 11,11, 11,10, 11,10, 11,11, 11,10, 11,32, 11,10, 11,32, 11,31, 11,12, 10,11, 10,11, 10,32, 11,11, 10,32, 11,11, 10,12, 10,31, 11,32, 11,32, 9};  // Protocol=UNKNOWN Hash=0x36897D58 100 bits (incl. gap and start) received

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[199] = {4330,4270, 530,1620, 530,570, 480,1620, 530,1570, 530,570, 530,520, 530,1570, 530,620, 480,620, 430,1620, 530,520, 530,570, 530,1570, 530,1620, 530,520, 530,1620, 530,520, 530,570, 480,620, 480,1570, 530,1620, 530,1620, 480,1620, 530,1620, 530,1570, 530,1620, 530,1570, 530,570, 530,570, 480,570, 480,570, 530,570, 480,570, 530,1570, 530,570, 530,1570, 530,1620, 530,570, 480,620, 430,570, 530,1620, 480,570, 530,1620, 480,570, 530,520, 530,1620, 530,1570, 530,1620, 480,5170, 4280,4270, 530,1620, 530,570, 480,1620, 530,1620, 480,570, 530,520, 530,1620, 530,520, 530,570, 530,1570, 530,570, 530,570, 480,1620, 480,1620, 530,570, 480,1620, 530,570, 480,620, 480,520, 530,1620, 530,1570, 530,1620, 530,1620, 480,1620, 530,1620, 530,1570, 530,1620, 530,520, 530,570, 530,520, 530,520, 530,570, 530,520, 530,1620, 530,520, 530,1620, 530,1570, 530,620, 480,570, 480,570, 480,1620, 530,570, 480,1620, 530,570, 480,620, 480,1570, 530,1620, 530,1620, 430};  // Protocol=UNKNOWN Hash=0x36897D58 100 bits (incl. gap and start) received


Pronto Hex as string
char prontoData[] = "0000 006D 0064 0000 00A8 00A3 0016 003D 0016 0014 0014 003D 0016 003B 0016 0014 0016 0012 0016 003B 0016 0016 0014 0016 0012 003D 0016 0012 0016 0014 0016 003B 0016 003D 0016 0012 0016 003D 0016 0012 0016 0014 0014 0016 0014 003B 0016 003D 0016 003D 0014 003D 0016 003D 0016 003B 0016 003D 0016 003B 0016 0014 0016 0014 0014 0014 0014 0014 0016 0014 0014 0014 0016 003B 0016 0014 0016 003B 0016 003D 0016 0014 0014 0016 0012 0014 0016 003D 0014 0014 0016 003D 0014 0014 0016 0012 0016 003D 0016 003B 0016 003D 0014 00C5 00A6 00A3 0016 003D 0016 0014 0014 003D 0016 003D 0014 0014 0016 0012 0016 003D 0016 0012 0016 0014 0016 003B 0016 0014 0016 0014 0014 003D 0014 003D 0016 0014 0014 003D 0016 0014 0014 0016 0014 0012 0016 003D 0016 003B 0016 003D 0016 003D 0014 003D 0016 003D 0016 003B 0016 003D 0016 0012 0016 0014 0016 0012 0016 0012 0016 0014 0016 0012 0016 003D 0016 0012 0016 003D 0016 003B 0016 0016 0014 0014 0014 0014 0014 003D 0016 0014 0014 003D 0016 0014 0014 0016 0014 003B 0016 003D 0016 003D 0012 06C3 ";

Some points to consider:

  • The hardware is working fine. I tested this same setup with the IRremote library controlling a Sony TV using the native Sony protocol from the library, reading with the same ReceiveDemo example and sending in my code with IrSender.sendSony(0x1, 0x12, 3, 12); (volume up) and it worked.
  • I can confirme it is possible to "clone" the remotes I'm trying to and actually make them work because I have a proprietary universal remote device that does that (and it doesn't care about any protocol, encoding or whatever, it just asks to press the button on the remote and clones it, and it works with both the remotes I'm trying to clone with Arduino).

So I seem to be able to read the data from the original remotes but can't make it work when sending. I don't know if the problem is actually when sending it, or if I'm reading it wrong. I read several topics here and in other forums where people seemed to have a similar problem and some of them got it working, but they didn't say exactly how, or their solution didn't work for me.

Has anyone else gotten through this who can give me some direction on what to do to get this to work? I don't know what else to try. Any help is appreciated

P.S. I'm currently testing with an Arduino Nano ATmega328P

I understand that AC units can be tricky. Could you provide more information about the AC units involved - the brand, etc. - as well as the brand and model numbers of their original remotes?

For difficult cases like this, I wrote sketches for the ATmega328P to capture and send IR codes in raw form. The sketches don't use any library.

https://github.com/gbhug5a/SimpleIRRaw

If you want to give them a try, you would run the capture sketch, then copy the output from the serial monitor and load that into the send sketch in place of the sample data there, and then see if the send sketch will operate the AC unit.

It that works, then I think we know that something isn't translating correctly in the IRRemote library, either receiving or sending, or both. If it doesn't work, then there may be some more fundamental problem involved, like they don't use 38KHz and 940nm like your receiver module does.

My transmit code isn't so long that it couldn't be incorporated into your code if that's the only way to get it to work, but I suspect there would be a way to make IRRemote work if we know that absolute raw does work.

If you decide to do that, you might post the capture results here so maybe someone will recognize the protocol.

I improved the ReceiveAndSend example: Arduino-IRremote/examples/ReceiveAndSend at master · Arduino-IRremote/Arduino-IRremote · GitHub
Give it a try and report what is not working, including the Serial output.

Sorry I didn't have time to read all the details of your post. Anyway I have reverse engineered few AC protocols and they are usually too long for normal IR libraries.
If you have Esp board on hand, go with
IRremoteESP8266, you have good changes to decode your AC with that.

If you are forced to play with Nano, try the raw receiver code from here, it's optimized for AC signals.
GitHub - ToniA/Raw-IR-decoder-for-Arduino: Take raw IR signal from a remote receiver and print out pulse lengths
Author has libraries for many ACs decoding as well, but I didn't see you mentioned your models....

Thanks for all your replies!

@ShermanP I tried your example and got this when capturing the codes:

Remote A (On button):

Adjust = 20
Waiting for IR transmission...

    On    Off     On    Off     On    Off     On    Off

  1813,   285,  1798,  4784,  1805,   284,  1801,  1493,
  1812,   284,  1813,   284,  1781,   341,  1784,   420,
  1811,   283,  1795,   502,  1806,   283,  1715,   417,
  1816,  1519,  1814,   283,  1788,  1505,  1803,   283,
  1783,   284,  1785,   327,  1797,   376,  1800,   428,
  1776,   282,  1806,   508,  1808,   282,  1768,   337,
  1750,   512,  1784,   282,  1718,  1648,  1808,   283,
  1786,   283,  1810,  1573,  1806,  1413,  1762,   282,
  1804,   308,  1784,   449,  1764,   374,  1794,  4009,
  1818,   282,  1798,  4770,  1806,   284,  1793,   907,
  1800,   771,  1790,   465,  1806,   282,  1787,   412,
  1804,   283,  1756,   464,  1773,   337,  1808,   359,
  1712,  1657,  1811,   285,  1768,  1526,  1810,   282,
  1768,   283,  1712,   589,  1772,   282,  1787,   307,
  1761,   507,  1811,   283,  1764,   373,  1814,   282,
  1796,   449,  1785,   316,  1812,  1585,  1818,   283,
  1829,   284,  1815,  1516,  1828,  1405,  1831,   283,
  1823,   282,  1784,   282,  1831,   360,  1819

Adjust = 20
Enter new Adjust value, or [Enter]

Remote B (On button):

Adjust = 20
Enter new Adjust value, or [Enter]
Adjust = 20
Waiting for IR transmission...

    On    Off     On    Off     On    Off     On    Off

  3079,  1587,   496,  1090,   491,  1093,   489,   320,
   499,   313,   504,   312,   504,  1091,   492,   315,
   503,   314,   503,  1089,   495,  1087,   494,   248,
   569,  1091,   491,   314,   503,   314,   504,  1090,
   492,  1092,   490,   313,   504,  1090,   493,  1091,
   491,   313,   504,   314,   504,  1089,   492,   313,
   505,   315,   502,   315,   503,  1090,   491,   247,
   571,   314,   505,   310,   506,   313,   505,   312,
   505,   312,   505,   313,   504,   312,   506,   313,
   504,   311,   506,   247,   570,   315,   503,   312,
   505,   313,   504,   314,   504,   312,   505,   313,
   504,   314,   503,   315,   503,   312,   504,  1090,
   493,   312,   505,   314,   504,   312,   504,   315,
   504,   311,   506,   309,   508,   315,   502,   310,
   508,   312,   505,   312,   505,   312,   505,   312,
   505,   311,   507,   310,   507,   311,   506,   310,
   507,   314,   504,   310,   507,   312,   506,   311,
   505,   314,   504,   311,   505,   315,   503,   313,
   503,   314,   505,   312,   504,   314,   504,   312,
   504,   313,   505,   314,   504,   311,   506,   312,
   505,   314,   503,   313,   504,   315,   502,   313,
   504,   313,   503,   318,   500,   317,   501,   313,
   504,   315,   503,   314,   503,   312,   505,   314,
   504,   312,   505,   313,   505,   313,   503,   314,
   505,   311,   505,   313,   504,   311,   506,   317,
   501,   313,   504,   311,   506,   314,   503,   312,
   505,   312,   506,  1089,   493,   311,   506,  1089,
   493,   312,   505,   313,   503,  1091,   492,  1089,
   494,   312,   505,  4408,  3078,  1589,   494,  1089,
   494,  1088,   494,   312,   506,   310,   506,   316,
   503,  1088,   493,   311,   506,   311,   506,  1090,
   493,  1089,   492,   312,   507,  1090,   491,   310,
   507,   314,   504,  1090,   492,  1090,   493,   311,
   507,  1089,   492,  1091,   491,   312,   505,   312,
   506,  1090,   492,   312,   506,   314,   503,  1090,
   492,   313,   504,   312,   505,   314,   504,   314,
   503,   314,   503,   312,   505,   317,   501,   314,
   503,   312,   506,   315,   503,   311,   505,   313,
   505,   312,   505,   313,   503,   254,   562,   318,
   501,   315,   503,  1090,   492,   312,   505,   314,
   504,  1090,   491,   315,   503,   313,   504,   314,
   503,   313,   505,   314,   502,  1091,   491,   315,
   503,   314,   503,   317,   501,   314,   503,   314,
   504,   312,   505,   313,   504,  1090,   491,   316,
   502,   313,   504,   251,   566,   315,   503,   313,
   504,   314,   504,   311,   505,   316,   501,   315,
   502,   315,   503,   316,   501,   316,   501,   316,
   502,   313,   505,   313,   504,   315,   502,   315,
   502,   314,   503,   314,   503,   316,   501,   316,
   502,   313,   504,   315,   502,   313,   505,   314,
   502,   315,   501,   319,   500,   256,   560,   318,
   500,   315,   503,   314,   504,   313,   503,   251,
   566,   315,   503,   315,   502,   312,   506,   314,
   502,   316,   501,   315,   503,   315,   502,   314,
   504,   314,   504,   313,   504,   311,   506,  1091,
   491,   245,   571,   317,   501,  1091,   491,   317,
   501,   313,   504,  1090,   490,   318,   501

Adjust = 20
Enter new Adjust value, or [Enter]

I copied these values into the IRSendRaw Key[] array. None of them worked. The IR LED emits something but nothing happens to the AC device.

Also, weird thing is that on IRCaptureRaw I tried to change recvPin to 2, where I had the IR emitter connected, but it didn't capture anything. Only when I switched the LED to pin 8 and kept the default recvPin=8 it showed the data above.

About the units specs, I've already searched with the data got but didn't find anything.

One unit (device A) is a Carrier Springer Hi-Wall Inverter XPower Split model 42LVCA012515LC, remote model R14A/CE (Amazon.com: ECONTROLLY Remote control fits for CARRIER R14A R14A/CE R14/CE Universal AC Air Conditioner : Home & Kitchen).

The other (device B) seems to be a very specific model I couldn't even find much on the internet, it's a Hi-Wall Split, brand: Agratto, model: ONE ACS 18FR4, and the remote doesn't have any specification.

@ArminJo Thanks! I think we're finally started to figure this out!

It now worked for remote A (the Carrier one - 36897D58) after some iterations (I guess the code needs to be repeated a few times for the device to recognize it).

I got this output:

Received unknown code and store 199 timing entries as raw 
rawData[200]: 
 -3276750
 +4250,-4300
 + 550,-1600 + 550,- 500 + 550,-1600 + 550,-1600
 + 500,- 550 + 550,- 500 + 550,-1600 + 550,- 550
 + 500,- 600 + 450,-1600 + 550,- 600 + 500,- 500
 + 500,-1650 + 500,-1600 + 550,- 550 + 500,-1600
 + 550,- 550 + 500,- 600 + 500,- 550 + 500,-1600
 + 550,-1600 + 500,-1600 + 550,-1600 + 550,-1550
 + 550,-1600 + 550,-1600 + 500,-1600 + 550,- 550
 + 500,- 600 + 500,- 550 + 500,- 550 + 500,- 600
 + 500,- 550 + 500,-1600 + 550,- 550 + 500,-1600
 + 550,-1600 + 500,- 550 + 500,- 600 + 500,- 600
 + 500,-1550 + 550,- 550 + 500,-1600 + 550,- 550
 + 500,- 550 + 550,-1600 + 550,-1550 + 550,-1600
 + 500,-5150 +4250,-4350 + 500,-1600 + 550,- 500
 + 550,-1600 + 550,-1600 + 500,- 550 + 500,- 600
 + 500,-1600 + 550,- 500 + 550,- 600 + 500,-1550
 + 550,- 550 + 500,- 600 + 500,-1600 + 550,-1550
 + 550,- 550 + 500,-1600 + 550,- 550 + 500,- 550
 + 500,- 650 + 450,-1600 + 550,-1600 + 500,-1600
 + 550,-1600 + 550,-1550 + 550,-1600 + 550,-1600
 + 500,-1600 + 550,- 550 + 500,- 550 + 550,- 500
 + 550,- 550 + 550,- 550 + 500,- 550 + 500,-1600
 + 550,- 550 + 500,-1600 + 550,-1600 + 550,- 500
 + 500,- 600 + 500,- 550 + 550,-1600 + 500,- 550
 + 550,-1600 + 500,- 550 + 550,- 500 + 550,-1600
 + 550,-1600 + 500,-1600 + 500
Sum: 176850
Stop receiving
Button pressed, now sending raw 199 marks or spaces
Button pressed, now sending repeat raw 199 marks or spaces
Button pressed, now sending repeat raw 199 marks or spaces
Button pressed, now sending repeat raw 199 marks or spaces
Button pressed, now sending repeat raw 199 marks or spaces
Button pressed, now sending repeat raw 199 marks or spaces
...

and it turned the AC on! Now i just have to put this data into code to send it.

But for remote B (the one sending 0x6500 then 0x4900), it didn't do anything to the device. It receives the data and sends it but nothing happens on the AC. I got this:

Using library version 4.4.1
Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, at pin 2
Ready to send IR signal (with repeats) at pin 3 as long as button at pin 5 is pressed.
Received unknown code and store 227 timing entries as raw 
rawData[228]: 
 -3276750
 +3100,-1550
 + 500,-1050 + 500,-1100 + 500,- 300 + 500,- 300
 + 500,- 300 + 500,-1100 + 500,- 300 + 500,- 300
 + 500,-1050 + 500,-1100 + 500,- 300 + 500,-1050
 + 500,- 300 + 500,- 300 + 500,-1100 + 500,-1050
 + 500,- 250 + 550,-1100 + 500,-1050 + 500,- 250
 + 550,- 300 + 500,-1100 + 500,- 250 + 550,- 250
 + 550,- 250 + 550,-1050 + 550,- 250 + 550,- 300
 + 500,- 250 + 550,- 300 + 500,- 300 + 500,- 350
 + 500,- 250 + 550,- 250 + 550,- 250 + 550,- 300
 + 500,- 250 + 600,- 250 + 550,- 300 + 500,- 300
 + 500,- 250 + 550,- 250 + 600,- 200 + 600,- 250
 + 550,- 250 + 550,- 250 + 550,-1100 + 500,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 600,- 200 + 600,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 600,- 150
 + 650,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 600,- 250 + 550,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 350
 + 500,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 300 + 500,- 300 + 500,- 300
 + 500,- 250 + 550,- 250 + 600,- 200 + 600,- 250
 + 550,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 600,- 250 + 550,- 250 + 550,- 250 + 550,- 250
 + 550,- 250 + 600,- 250 + 550,- 250 + 550,- 250
 + 550,-1050 + 500,- 250 + 600,-1050 + 500,- 300
 + 500,- 300 + 500,-1100 + 500,-1050 + 500,- 300
 + 500
Sum: 108650

I tried to increase RAW_BUFFER_LENGTH to 750 (the example says "For air condition remotes it requires 750. Default is 200.") but it stopped working. At 730 the received data get random strings, and 750 the board leds keep blinking and stops respondin.

It's also giving this warning when I compile the sketch:

Sketch uses 10514 bytes (34%) of program storage space. Maximum is 30720 bytes.
Global variables use 2023 bytes (98%) of dynamic memory, leaving 25 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

Maybe something related to the memory?

Thanks @kmin, I took a look into the IRremoteESP8266 library but it doesn't suit me because I plan on using Nano for this project, and unfortunately I don't have any other boards to test at this time.

I tried this raw receiver but I only got random data, even when there is no IR transmission, like this:


################# Start

Number of symbols: 1025
Symbols:
Hh1Hh010HhHh01Hh10Hh1Hh0Hh1HhHh0Hh10Hh0Hh1HhHh1HhHh10Hh0Hh1Hh01Hh0Hh1Hh1Hh0Hh1Hh0Hh1Hh0Hh1Hh1HhHh1HhHhHh01Hh1Hh1Hh1HhHh0Hh0Hh1HhHh1Hh10Hh1Hh1HhHh01Hh1Hh01HhHh1Hh1Hh1Hh1Hh0Hh0Hh10Hh1Hh1Hh1Hh01Hh0HhHh01HhHh01HhHh10Hh01HhHh1Hh0Hh0HhHh0Hh1Hh10Hh1Hh10Hh1Hh1Hh1Hh10Hh1Hh1Hh1HhHh1Hh01Hh1HhHhHh1Hh1Hh10HhHh1HhHh0Hh01Hh10Hh1Hh0Hh1Hh01Hh0Hh0Hh1Hh1Hh1HhHh0Hh10Hh10HhHh0Hh10Hh1Hh10Hh1Hh01Hh0Hh1Hh1Hh00HhHh1HhHh1Hh001HhHh1Hh10HhHhHh01Hh0HhHh01Hh1Hh010Hh01Hh1HhHh1Hh01HhHh0Hh01HhHh0HhHh01Hh01Hh010Hh1Hh1Hh10Hh0Hh0HhHh0Hh1Hh10Hh1Hh01HhHh1Hh010Hh01Hh01Hh1Hh0Hh01Hh1Hh10Hh1Hh1Hh0Hh1Hh0Hh1Hh10HhHh0Hh1Hh10HhHh0Hh01Hh1Hh1HhHh1Hh0Hh1Hh1Hh1Hh010Hh0Hh1Hh1Hh1Hh01Hh01Hh001Hh010Hh01Hh0Hh0Hh0Hh1HhHhHh1HhHh0Hh1Hh0HhHh0HhHh0Hh01Hh1Hh0HhHh01HhHh0010HhHh1Hh1Hh10Hh1Hh1Hh1Hh1Hh1Hh0Hh1Hh10Hh1Hh1Hh1Hh1Hh1HhHh1Hh0Hh0Hh1Hh01Hh0Hh0Hh1HhHh01Hh1HhHh1Hh01Hh0HhHh0Hh01Hh1Hh1Hh0HhHh1Hh00Hh1Hh0Hh1Hh1HhHhHhHhHh10HhHh1Hh1Hh01Hh1Hh0HhHh1HhHh0Hh1Hh0HhHh1Hh1HhHh1Hh01HhHh01Hh1Hh1Hh0Hh001HhHh1HhHh0Hh10HhHhHh01Hh0HhHh1HhHh010Hh1Hh1Hh01Hh001Hh1Hh01Hh0Hh0Hh1Hh1Hh1Hh1Hh4⸮⸮
Bytes:
00:  100:  01000:  0100:  1000:  100:  000:  100:  000:  1000:  000:  100:  100:  1000:  000:  100:  0100:  000:  100:  100:  000:  100:  000:  100:  000:  100:  100:  100:  0100:  100:  100:  100:  000:  000:  100:  100:  1000:  100:  100:  0100:  100:  0100:  100:  100:  100:  100:  000:  000:  1000:  100:  100:  100:  0100:  000:  0100:  0100:  1000:  0100:  100:  000:  000:  000:  100:  1000:  100:  1000:  100:  100:  100:  1000:  100:  100:  100:  100:  0100:  100:  100:  100:  1000:  100:  000:  0100:  1000:  100:  000:  100:  0100:  000:  000:  100:  100:  100:  000:  1000:  1000:  000:  1000:  100:  1000:  100:  0100:  000:  100:  100:  0000:  100:  100:  00100:  100:  1000:  0100:  000:  0100:  100:  01000:  0100:  100:  100:  0100:  000:  0100:  000:  0100:  0100:  01000:  100:  100:  1000:  000:  000:  000:  100:  1000:  100:  0100:  100:  01000:  0100:  0100:  100:  000:  0100:  100:  1000:  100:  100:  000:  100:  000:  100:  1000:  000:  100:  1000:  000:  0100:  100:  100:  100:  000:  100:  100:  100:  01000:  000:  100:  100:  100:  0100:  0100:  00100:  01000:  0100:  000:  000:  000:  100:  100:  000:  100:  000:  000:  000:  0100:  100:  000:  0100:  0010|00:  100:  100:  1000:  100:  100:  100:  100:  100:  000:  100:  1000:  100:  100:  100:  100:  100:  100:  000:  000:  100:  0100:  000:  000:  100:  0100:  100:  100:  0100:  000:  000:  0100:  100:  100:  000:  100:  0000:  100:  000:  100:  100:  1000:  100:  100:  0100:  100:  000:  100:  000:  100:  000:  100:  100:  100:  0100:  0100:  100:  100:  000:  00100:  100:  000:  1000:  0100:  000:  100:  01000:  100:  100:  0100:  00100:  100:  0100:  000:  000:  100:  100:  100:  1
Timings (in us): 
PAUSE SPACE:  0
HEADER MARK:  8994
HEADER SPACE: 0
BIT MARK:     4
ZERO SPACE:   44
ONE SPACE:    7362
Decoding known protocols...
Unknown protocol
Bytecount: 0
################# End 

It also seems to depend on well-defined vendors/protocols to decode the signals, which I think will not work for me because I guess these remotes I got don't follow any of those standards.

Update: I managed to get an Arduino Mega board to test and increased the buffer size to 750 on @ArminJo 's solution, but the result was the same. Works for remote A but not for B.

Yes, it's coded to use D8, and that can't be changed.

Could you describe your IR receiver module? Does its output idle high, and go low when carrier is detected, or is it the opposite? And how about your transmitter? Do you bring the GPIO pin high to turn on the IR LED?

Well, the two Remote A outputs are completely different. Different lengths, with mine being shorter. And mine is missing the long mark and space at the beginning. I'll have to look at the @ArminJo code and see if I can figure out why.

But the Remote B results are similar. Mine is twice as long, with what looks like a repeat after 4408 in the middle. The repeat is missing in the @ArminJo output.

It's strange that the two Remote A captures are so different, but the two Remote B captures look the same.

The receiver is just a simple IR receiver diode - VS1838. I found this datasheet on the internet: https://eeshop.unl.edu/pdf/VS1838-Infrared-Receiver-datasheet.pdf

There is a waveform on this datasheet, I don't know if this answer your questions.

The transmitter is just a IR LED, connected to pin 3.

Well, my send sketch has to have the LED output on D10. Did you do it that way?

Yes, but it makes excellent job for non decoded raw signals.
You have hardware problem if you don't get consistent results.

Yes, sorry, I switched to 10 when running your sketch. Forgot to mention that.
Anyway (also @kmin) if it works for one of the remotes wouldn't it mean the hardware is okay?

Well I'll test my code again to make sure it works correctly. But if it does, then I don't know why it wouldn't work for you. The Remote A capture you posted for my sketch was clearly not a complete capture, but it looks like the Remote B capture was, so it should have worked. with my send sketch.

Probably, but there's a chance the other one uses a different IR wavelength, or has a carrier that's something other than 38KHz. Also, are you really just connecting the IR LED from the IO port to ground, with no resistor or transistor? I don't know how well that works.

And the remote A, the one we think is incomplete, is the one that's working! Remote B, which is much longer, doesn't.

Is there a way I can check this? Assuming the proprietary universal device I mentioned works for both ACs, doesn't it mean they work with the same IR wavelength?

No, sorry, when I said it's "just an IR LED" what I meant was an IR LED with all the necessary components, it's all built-in ina a PCB (Transmitter Module). The receiver is the one literally just directly connect to the board. I'll attach some pictures of the components.

Receiver (connected directly to digital input / 5V / GND):

Transmitter (module connected to GND / VCC / digital output):

Maybe you check the original repeat timing and numbers with ReceiveDemo example.

The ReceiveDemo output with the original remote gives me this:

Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x226CB23, 0x4000, 0x0, 0x6500};
    IrSender.sendPulseDistanceWidthFromArray(38, 3050, 1550, 500, 1050, 500, 300, &tRawData[0], 112, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

Protocol=PulseDistance Repeat gap=68850us Raw-Data=0x4900 112 bits LSB first

This gap=68550us would be the repeat timing? And what about the numbers you said?

I also tested with the universal remote, which also works with the AC, but receives only one code (0x6500, which is same same for any button I press, so it's definitely not just this):

Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x226CB23, 0x4000, 0x0, 0x6500};
    IrSender.sendPulseDistanceWidthFromArray(38, 3100, 1550, 550, 1050, 550, 300, &tRawData[0], 112, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);

No, that was Arminjo's Remote A, not mine. You said mine didn't work, and it is clearly incomplete, and bears no resemblance to his.

Actually, if they both work with the universal learning remote, then they almost certainly have the same physical parameters, or at least pretty close. So I don't know why Remote B doesn't work.

Do you get the same capture sequence from the universal remote as you do from Remote B? Edit: Oh, sorry, you said you did try that. If you get the same code for any key you press, then you must be missing a second sequence. The device is the same for any key, but there must be another sequence for the specific key.

I did one more test: I got another Arduino board and running the ReceiveDemo example to read the data sent from the first Arduino.

For remote B (not working) I just got a bunch of "random" data.
This is the remote B IR data transmitted by Arduino (on loop) using @ArminJo 's modified ReceiveAndSend example, read by ReceiveDemo:

Received noise or an unknown (or not yet enabled) protocol
rawData[74]: 
 -52950
 +3000,-1600
 + 450,-1150 + 450,-1150 +1200,- 300 + 550,- 350
 + 400,-1200 + 350,- 450 + 450,- 200 + 600,-1150
 + 400,-1150 + 450,- 250 + 550,-1100 +2050,-1250
 + 350,-1200 + 400,- 300 + 650,-1100 + 350,-1100
 +1250,- 350 + 550,-1150 + 300,-1200 +1250,-1150
 +5300,- 300 +7050,- 200 +3950,-1200 +6100,- 400
 + 200,- 450 +8550,- 200 +2300,- 250 + 550,- 350
 +5050,- 600 +1600,- 200 +7200,-1100 + 350,- 200
 + 800,-1000 +2150,-1100 + 450,-1150 +1200
Sum: 96350

Received noise or an unknown (or not yet enabled) protocol
rawData[70]: 
 -52850
 +3000,-1550
 + 450,-1150 + 500,-1150 +2050,- 200 + 450,-1350
 + 350,- 350 + 350,- 450 + 500,-1100 + 450,-1050
 + 400,- 500 + 450,-1050 + 500,- 350 + 450,- 450
 + 200,-1300 + 450,-1150 +1300,-1050 + 450,-1150
 + 600,- 250 + 150,- 700 + 350,-1150 + 400,- 350
 + 700,-1000 + 400,-1200 +1150,- 200 +2550,-1100
 +7700,- 200 +5500,- 200 + 650,- 250 +4650,- 250
 +7350,- 950 +6300,-1250 +1300,-1050 +2150,-1200
 + 250,-1150 +1350
Sum: 83600

Received noise or an unknown (or not yet enabled) protocol
rawData[88]: 
 -52750
 +3000,-1600
 + 450,-1150 + 450,-1100 + 400,- 200 +2300,-1100
 + 450,- 400 + 350,- 400 + 450,-1200 + 350,-1250
 + 350,- 400 + 450,-1100 + 450,-1250 + 300,-1200
 + 400,-1150 + 500,- 150 + 750,-1100 + 350,-1100
 + 450,- 200 + 600,-2200 + 150,- 550 + 250,-1250
 + 450,-1200 + 400,- 150 +3800,-2050 +5350,- 200
 +4800,-1050 +1500,- 350 + 450,- 450 + 350,- 650
 +1850,- 250 +3800,- 350 +1250,- 350 +2150,-1450
 +2600,- 500 + 250,- 500 +6350,-1000 +3550,- 650
 + 250,- 350 +2950,-1150 +1200,-1200 + 350,- 400
 +1300,-1200 + 150,-1300 +1300
Sum: 96400

Received noise or an unknown (or not yet enabled) protocol
rawData[86]: 
 -52850
 +2950,-1600
 + 500,-1150 + 400,-1100 + 450,- 200 + 650,- 200
 + 650,- 300 + 550,-1000 + 500,- 450 + 200,- 500
 + 500,-1100 + 400,-1150 + 400,- 500 + 350,-1150
 + 400,- 400 + 400,- 400 + 400,-1200 + 450,-1200
 + 350,- 300 + 550,-1200 + 350,-1250 + 250,- 350
 + 450,- 200 + 750,-1050 + 450,- 300 + 450,- 450
 + 400,- 200 + 600,-1200 +4500,- 200 + 600,- 350
 +8500,- 450 +2100,-1100 + 650,- 450 + 450,-1750
 + 400,- 400 +9550,- 200 + 400,- 350 +1800,- 200
 + 600,- 200 +3900,-1200 +1200,-1250 +2000,-1100
 + 350,-1300 +1200
Sum: 83550

Received noise or an unknown (or not yet enabled) protocol
rawData[88]: 
 -52850
 +2950,-1600
 + 500,-1150 + 400,-1200 +1150,- 400 +1300,-1100
 + 450,- 300 + 450,- 300 + 550,-1200 + 300,-1150
 +1350,-1050 + 450,- 500 + 250,- 450 + 450,-1150
 + 300,-1250 + 450,- 300 + 550,-1050 + 500,-1150
 + 250,- 400 + 500,- 500 + 400,-1200 + 350,- 300
 + 500,- 350 + 450,- 300 + 550,-1100 +4500,- 250
 + 550,-1400 + 200,- 250 +9650,-1050 + 450,- 300
 + 750,- 150 +9650,-1100 +10050,- 350 +12100,-1050
 +4400,- 300 +1600,-1000 + 400,- 350 + 450,- 200
 +1450,- 350 + 450,-1200 +1250,-1150 +2100,-1150
 + 200,-1250 + 400,- 450 + 450
Sum: 109150

Received noise or an unknown (or not yet enabled) protocol
rawData[90]: 
 -52900
 +2950,-1650
 + 400,-1250 + 350,-1200 + 150,-1300 + 550,- 250
 + 550,-1100 + 450,- 400 + 300,- 450 + 500,-1300
 + 250,-1100 + 450,- 200 + 650,-1200 + 250,- 500
 + 400,- 500 + 200,-1350 + 150,-1350 + 350,-2000
 + 450,-1150 + 250,- 500 +1250,-1150 + 500,-1100
 + 450,-2000 +4500,- 450 + 200,- 550 + 350,- 250
 +2150,- 500 + 400,- 600 + 150,- 550 +6050,-2850
 +1650,- 750 +1500,- 350 +5850,- 200 +3900,- 200
 + 850,- 350 + 150,- 350 +9500,- 200 +3050,- 400
 +3650,-1250 +9600,- 950 + 450,-1150 +1250,-1200
 + 300,- 450 + 400,-1950 + 500,-1300 + 150
Sum: 108150

Received noise or an unknown (or not yet enabled) protocol
rawData[36]: 
 -52900
 +2950,-3350
 + 100,-1300 +1200,-1400 + 200,-1400 + 250,-4500
 + 200,- 600 + 200,-1400 + 150,-4450 + 350,- 700
 + 200,-1300 + 250,-2850 + 300,-5300 + 200,-4700
 + 350,- 400 + 300,- 450 + 300,- 250 + 450,- 450
 + 550
Sum: 43300

Received noise or an unknown (or not yet enabled) protocol
rawData[4]: 
 -118750
 + 800,- 750
 + 450
Sum: 2000

Protocol=RC5 Address=0x0 Command=0x40 Repeat gap=32850us

Received noise or an unknown (or not yet enabled) protocol
rawData[56]: 
 -17800
 + 350,- 250
 +1400,-1300 + 250,- 400 +2050,-1400 +3500,- 400
 + 450,- 500 +1950,- 350 + 450,- 350 +1550,-1000
 +3600,- 250 +1400,- 350 + 450,- 450 +1900,-1600
 +2600,- 150 +3000,- 650 + 250,- 200 +1350,- 350
 + 600,- 250 + 550,- 500 + 250,-1200 +5600,-1900
 + 200,- 350 + 550,-1300 + 200,- 600 + 150,- 250
 + 700,-1250 + 200,-1250 +1300
Sum: 55600

Received noise or an unknown (or not yet enabled) protocol
rawData[106]: 
 -52850
 +2850,-3350
 + 250,-2200 +1850,-1250 + 200,-1450 + 250,-1250
 + 350,-1150 + 450,- 500 + 450,-1200 + 200,- 250
 + 600,-2050 + 250,-2050 + 450,-1250 + 250,-2100
 + 300,- 650 + 250,-1250 + 200,- 500 + 200,- 650
 + 350,- 200 + 600,-2600 + 850,-3550 + 250,- 400
 +2850,-1200 +1700,-2350 + 100,- 750 +1150,-3650
 +5050,- 800 +2000,- 450 + 250,-1450 +1850,- 500
 +1200,- 250 +1550,-1100 +1100,- 500 + 250,- 550
 +1150,- 400 +3700,- 500 + 300,- 300 + 150,-1550
 + 400,- 650 + 100,- 250 +1800,-1100 + 150,- 450
 +3700,- 350 + 450,-2100 +1150,- 400 + 400,- 350
 + 450,- 450 + 300,- 400 + 250,- 850 + 250,- 350
 + 450,-1350 +1100,-2850 + 250,-2900 +1100
Sum: 109000

Received noise or an unknown (or not yet enabled) protocol
rawData[44]: 
 -53000
 +2800,-3400
 + 200,-1950 + 350,-3850 + 250,- 450 + 400,-3600
 + 300,-1350 + 250,-1300 + 350,-2800 + 250,- 550
 + 450,-1150 + 350,-2900 + 300,-1350 + 100,-1500
 + 150,-5350 + 300,-3650 + 450,-3750 + 300,-6300
 +2650,- 150 +1350,- 500 + 300,- 600 +1150,-2050
 +1200
Sum: 62700

Received noise or an unknown (or not yet enabled) protocol
rawData[2]: 
 -10450
 + 150
Sum: 150

Received noise or an unknown (or not yet enabled) protocol
rawData[40]: 
 -93300
 +2800,- 250
 + 550,- 250 +7000,- 300 + 550,- 450 + 400,- 700
 +1800,-1350 + 150,- 250 +3000,- 400 + 400,-2950
 + 400,- 550 + 250,-1200 +1250,-2000 + 450,-1500
 +1000,-1250 + 250,- 400 + 500,-3600 + 250,-1650
 +1700,-3050 + 650,- 250 + 850
Sum: 46550

Received noise or an unknown (or not yet enabled) protocol
rawData[86]: 
 -79100
 +2750,-1650
 + 450,-1250 + 350,-1100 + 350,- 350 + 500,- 250
 + 600,- 550 + 100,-1300 + 450,-1250 + 400,-1250
 + 250,-1200 +1200,-1150 +1250,- 400 + 400,-1300
 + 250,-1150 + 450,- 400 + 500,-1050 + 500,-1300
 +1050,- 200 + 650,-1100 + 450,- 250 + 500,- 450
 + 400,- 350 + 500,-1100 + 400,- 350 +3700,- 500
 +3600,- 350 +7800,-1150 +4450,- 200 +5750,- 200
 +9350,- 250 +6550,- 200 +4450,- 300 +8900,- 150
 + 400,- 350 + 700,-1950 + 500,- 350 + 200,- 600
 + 250,- 300 + 550,-1200 +1200,-1100 +2100,-1150
 + 450,-1100 +1300
Sum: 109000

Received noise or an unknown (or not yet enabled) protocol
rawData[120]: 
 -52800
 +3000,-1550
 + 450,-1200 + 350,-1150 +1250,- 200 + 650,- 500
 + 300,-1100 + 450,- 350 + 500,- 350 + 450,-1300
 + 250,-1100 +1300,-1250 + 250,-1300 + 400,-1150
 + 450,-1100 + 450,- 450 + 450,-1050 + 400,-1100
 + 450,- 200 + 650,- 300 + 550,-1100 + 400,- 350
 + 400,-2850 +3850,- 200 + 400,- 600 + 200,-1500
 + 150,- 200 +2250,- 200 + 600,- 500 +1950,- 400
 + 400,- 400 + 450,- 400 +2100,-1100 + 400,- 200
 +1650,- 150 + 400,- 450 +1250,- 450 +2000,- 350
 +4500,- 200 +2250,- 350 + 700,- 850 +3100,-1250
 +  50,-  50 +  50,- 100 + 450,- 300 +  50,- 100
 + 400,- 150 + 350,- 300 +  50,- 250 + 400,- 100
 + 500,- 400 + 550,- 150 + 250,- 250 + 750,- 350
 + 450,- 250 + 550,- 450 +3850,- 150 +1550,- 900
 + 550,-1000 +1050,- 100 + 900
Sum: 91250
...
...
...

For the original remote B (single press), the output is simply:

Protocol=PulseDistance Raw-Data=0x6500 112 bits LSB first
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x226CB23, 0x4000, 0x0, 0x6500};
    IrSender.sendPulseDistanceWidthFromArray(38, 3050, 1600, 550, 1050, 550, 300, &tRawData[0], 112, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMi                                                                                                                                    ;

Protocol=PulseDistance Repeat gap=69000us Raw-Data=0x4900 112 bits LSB first

For remote A, the one that works, it gives a consistent output, very similar to the original remote:

Code A sent by Arduino (on loop):

Received noise or an unknown (or not yet enabled) protocol
rawData[198]: 
 -52800
 +4200,-4300
 + 450,-1700 + 550,- 650 + 250,-1700 + 550,-1600
 + 450,- 650 + 500,- 650 + 300,-1750 + 350,- 800
 + 350,- 800 + 200,-1750 + 500,- 600 + 400,- 650
 + 400,-1650 + 550,-1600 + 500,- 700 + 350,-1650
 + 450,- 850 + 250,- 700 + 450,- 500 + 550,-1600
 + 450,-1650 + 450,-1650 + 550,-1600 + 550,-1550
 + 450,-1700 + 500,-1650 + 500,-1550 + 550,- 650
 + 450,- 500 + 550,- 600 + 450,- 700 + 300,- 750
 + 400,- 800 + 150,-1750 + 500,- 800 + 150,-1750
 + 550,-1550 + 500,- 650 + 450,- 750 + 200,- 800
 + 200,-1800 + 550,- 700 + 150,-1800 + 500,- 700
 + 400,-2700 + 500,-1550 + 550,-1600 + 450,-5150
 +4250,-4300 + 500,-1600 + 550,- 650 + 300,-1700
 + 550,-1550 + 450,- 700 + 450,- 550 + 450,-1700
 + 500,- 800 + 200,- 800 + 350,-1550 + 500,- 750
 + 350,- 700 + 400,-1600 + 550,-1600 + 500,- 550
 + 450,-1700 + 550,- 700 + 150,- 750 + 400,- 750
 + 300,-1750 + 450,-1600 + 550,-1600 + 450,-1700
 + 550,-1600 + 500,-1600 + 450,-1650 + 550,-1550
 + 500,- 600 + 550,- 650 + 400,- 650 + 300,- 700
 + 350,- 800 + 350,- 800 + 250,-1700 + 450,- 650
 + 450,-1650 + 450,-1650 + 500,- 700 + 350,- 750
 + 350,- 600 + 400,-1700 + 500,- 750 + 150,-1800
 + 500,- 750 + 150,- 750 + 500,-1650 + 500,-1550
 + 500,-1650 + 500
Sum: 176450

Received noise or an unknown (or not yet enabled) protocol
rawData[194]: 
 -52800
 +4150,-4350
 + 450,-1650 + 550,- 750 + 150,-1750 + 550,-1600
 + 550,- 750 + 150,- 650 + 400,-1700 + 500,- 750
 + 350,- 900 + 100,-1750 + 500,- 700 + 150,- 900
 + 350,-1600 + 500,-1650 + 500,- 550 + 500,-1650
 + 450,- 650 + 450,- 650 + 500,- 700 + 250,-1700
 + 450,-1600 + 500,-1650 + 550,-1600 + 550,-1550
 + 450,-1700 + 500,-1600 + 550,-1550 + 550,- 700
 + 300,- 600 + 500,- 600 + 500,- 750 + 300,- 750
 + 200,- 800 + 450,-1600 + 500,- 700 + 300,-1700
 + 500,-1600 + 500,- 650 + 450,- 750 + 250,- 750
 + 150,-1850 + 500,- 700 + 250,-1750 + 500,- 650
 + 400,- 750 + 350,-1600 + 500,-1600 + 450,-1700
 + 400,-5200 +4250,-4250 + 500,-1650 + 500,- 650
 + 350,-1650 + 500,-1600 + 550,- 550 + 450,- 700
 + 350,-1700 + 500,-1700 + 450,-1700 + 400,- 700
 + 350,- 700 + 300,-1750 + 500,-1600 + 550,- 800
 + 150,-1700 + 450,- 700 + 400,- 700 + 450,-2650
 + 550,-1550 + 450,-1700 + 500,-1600 + 550,-1550
 + 500,-1650 + 500,-1650 + 500,-1550 + 550,- 700
 + 400,- 650 + 350,-1800 + 300,- 750 + 350,- 800
 + 150,-1800 + 500,- 600 + 450,-1650 + 500,-1600
 + 500,- 700 + 400,- 550 + 500,- 850 + 150,-1700
 + 500,- 750 + 200,-1750 + 450,- 700 + 450,- 650
 + 400,-1650 + 400,-1650 + 550,-1600 + 450
Sum: 176350

Received noise or an unknown (or not yet enabled) protocol
rawData[188]: 
 -52800
 +4150,-4350
 + 550,-1600 + 500,- 750 + 250,-1700 + 500,-1600
 + 550,- 750 + 250,- 850 + 100,-1750 + 550,- 600
 + 350,- 850 + 200,-1750 + 500,- 700 + 350,- 600
 + 450,-1700 + 450,-1650 + 500,- 650 + 400,-1600
 + 550,- 600 + 300,- 750 + 450,-2700 + 550,-1550
 + 450,-1700 + 500,-1600 + 550,-1550 + 500,-1650
 + 500,-1650 + 500,-1550 + 550,- 600 + 500,-1700
 + 350,- 700 + 400,- 650 + 450,- 600 + 450,-1650
 + 500,- 600 + 450,-1750 + 350,-1650 + 500,- 600
 + 450,- 750 + 350,- 700 + 200,-1800 + 500,- 750
 + 250,-1700 + 500,- 700 + 400,- 600 + 400,-1700
 + 500,-1600 + 500,-1600 + 450,-5150 +4300,-4200
 + 500,-1650 + 550,- 600 + 350,-1700 + 500,-1600
 + 450,- 700 + 450,- 850 + 100,-1750 + 450,- 650
 + 400,- 900 + 150,-1650 + 500,- 750 + 200,- 850
 + 350,-1650 + 550,-1600 + 500,- 700 + 350,-1650
 + 450,- 650 + 450,- 700 + 300,- 700 + 450,-1650
 + 500,-1550 + 550,-1700 + 350,-1700 + 500,-1600
 + 450,-1650 + 500,-1650 + 500,-1600 + 450,- 650
 + 500,-1700 + 200,- 850 + 450,- 600 + 400,- 750
 + 300,-1900 + 350,- 650 + 400,-1650 + 450,-1650
 + 450,-1950 + 150,- 800 + 300,-1700 + 400,- 850
 + 200,-2000 + 150,- 800 + 400,- 550 + 450,-1800
 + 200
Sum: 172050
...

Original remote A (single press):

Received noise or an unknown (or not yet enabled) protocol
rawData[200]: 
 -3276750
 +4250,-4350
 + 550,-1550 + 550,- 550 + 500,-1600 + 550,-1600
 + 550,- 500 + 550,- 550 + 500,-1600 + 550,- 550
 + 500,- 600 + 500,-1600 + 500,- 550 + 550,- 500
 + 550,-1600 + 550,-1550 + 550,- 550 + 550,-1550
 + 550,- 550 + 550,- 500 + 550,- 550 + 550,-1550
 + 550,-1600 + 550,-1550 + 550,-1600 + 550,-1550
 + 550,-1600 + 550,-1600 + 550,-1550 + 550,- 550
 + 550,- 500 + 550,- 500 + 550,- 550 + 550,- 500
 + 550,- 550 + 500,-1600 + 550,- 600 + 450,-1600
 + 550,-1600 + 550,- 500 + 550,- 550 + 500,- 550
 + 550,-1550 + 550,- 550 + 550,-1600 + 500,- 550
 + 550,- 500 + 550,-1600 + 550,-1550 + 550,-1600
 + 500,-5150 +4300,-4300 + 500,-1600 + 550,- 550
 + 500,-1600 + 550,-1600 + 550,- 500 + 550,- 600
 + 450,-1600 + 550,- 500 + 550,- 550 + 550,-1550
 + 550,- 550 + 550,- 500 + 550,-1600 + 550,-1550
 + 550,- 550 + 550,-1550 + 550,- 550 + 550,- 500
 + 550,- 550 + 500,-1600 + 550,-1600 + 550,-1550
 + 550,-1600 + 550,-1550 + 550,-1600 + 550,-1600
 + 550,-1550 + 550,- 550 + 550,- 500 + 550,- 550
 + 500,- 550 + 550,- 500 + 550,- 550 + 500,-1600
 + 550,- 550 + 500,-1600 + 550,-1600 + 550,- 500
 + 550,- 550 + 500,- 550 + 550,-1600 + 500,- 550
 + 550,-1600 + 500,- 550 + 550,- 500 + 550,-1600
 + 550,-1550 + 550,-1600 + 500
Sum: 176850