IR Remote Control for Hitachi Split AC not detecting

Hello Everyone!
I have been working on this for a while now, going through various forums, threads and methods but to no avail, my ac refuses to detect the signal from my IR Transmitter. I'm providing all the details I can in hopes someone can decipher what I am missing.

Board: Arduino Uno
Voltage Supply: 5V from Arduino Uno onto a breadboard
IR Receiver [Pin 2]: KY-022 Module KY-022 Infrared Receiver Module - ArduinoModulesInfo
IR Transmitter [Pin 3]: Standard IR LED, 2N2222 Transistor, 100 ohm Resistor https://europe1.discourse-cdn.com/arduino/original/4X/1/9/4/1940fcb591fe5901aa19f3ac81ef0ceaae27294a.png
AC Model: Hitachi Split AC (RAS.B318PCAIBA) Attached a picture for reference
AC Remote: Attached a picture for reference


I was able to capture the raw signal using the Arduino-IRremote-master ReceiveAndSend example.

/*
 * ReceiveAndSend.cpp
 *
 * Record and play back last received IR signal at button press.
 * The logic is:
 * If the button is pressed, send the IR code.
 * If an IR code is received, record it.
 * If the protocol is unknown or not enabled, store it as raw data for later sending.
 *
 * An example for simultaneous receiving and sending is in the UnitTest example.
 *
 * An IR detector/demodulator must be connected to the input IR_RECEIVE_PIN.
 *
 * A button must be connected between the input SEND_BUTTON_PIN and ground.
 * A visible LED can be connected to STATUS_PIN to provide status.
 *
 * See also https://dronebotworkshop.com/ir-remotes/#ReceiveAndSend_Code
 *
 * Initially coded 2009 Ken Shirriff http://www.righto.com
 *
 *  This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
 *
 ************************************************************************************
 * MIT License
 *
 * Copyright (c) 2009-2025 Ken Shirriff, Armin Joachimsmeyer
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is furnished
 * to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 ************************************************************************************
 */
#include <Arduino.h>

#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.

/*
 * Specify which protocol(s) should be used for decoding.
 * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
 * This must be done before the #include <IRremote.hpp>
 */
//#define DECODE_DENON        // Includes Sharp
//#define DECODE_JVC
//#define DECODE_KASEIKYO
//#define DECODE_PANASONIC    // alias for DECODE_KASEIKYO
//#define DECODE_LG
//#define DECODE_NEC          // Includes Apple and Onkyo
//#define DECODE_SAMSUNG
//#define DECODE_SONY
//#define DECODE_RC5
//#define DECODE_RC6

//#define DECODE_BOSEWAVE
//#define DECODE_LEGO_PF
//#define DECODE_MAGIQUEST
//#define DECODE_WHYNTER
//#define DECODE_FAST
//

#if !defined(RAW_BUFFER_LENGTH)
// For air condition remotes it may require up to 750. Default is 200.
#  if !((defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF))
#define RAW_BUFFER_LENGTH  700 // we require 2 buffer of this size for this example
#  endif
#endif

//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
//#define NO_LED_FEEDBACK_CODE      // saves 92 bytes program memory
//#define RECORD_GAP_MICROS 12000   // Default is 8000. Activate it for some LG air conditioner protocols
//#define SEND_PWM_BY_TIMER         // Disable carrier PWM generation in software and use (restricted) hardware PWM.
//#define USE_NO_SEND_PWM           // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition

// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
// 20 is taken as default if not otherwise specified / defined.
//#define MARK_EXCESS_MICROS    40    // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.

//#define DEBUG // Activate this for lots of lovely debug output from the decoders.

#include <IRremote.hpp>

int SEND_BUTTON_PIN = APPLICATION_PIN;

int DELAY_BETWEEN_REPEAT = 50;

// Storage for the recorded code
struct storedIRDataStruct {
    IRData receivedIRData;
    // extensions for sendRaw
    uint8_t rawCode[RAW_BUFFER_LENGTH]; // The durations if raw
    uint8_t rawCodeLength; // The length of the code
} sStoredIRData;

bool sSendButtonWasActive;

void storeCode();
void sendCode(storedIRDataStruct *aIRDataToSend);

void setup() {
    pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);

    Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
    || defined(SERIALUSB_PID)  || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
    delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif
    // Just to know which program is running on my Arduino
    Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));

    // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
    IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
    Serial.print(F("Ready to receive IR signals of protocols: "));
    printActiveIRProtocols(&Serial);
    Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));

    IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
    Serial.print(F("Ready to send IR signal (with repeats) at pin " STR(IR_SEND_PIN) " as long as button at pin "));
    Serial.print(SEND_BUTTON_PIN);
    Serial.println(F(" is pressed."));
}

void loop() {

    // If button pressed, send the code.
    bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == LOW); // Button pin is active LOW

    /*
     * Check for current button state
     */
    if (tSendButtonIsActive) {
        if (!sSendButtonWasActive) {
            Serial.println(F("Stop receiving"));
            IrReceiver.stop();
        }
        /*
         * Button pressed -> send stored data
         */
        Serial.print(F("Button pressed, now sending "));
        if (sSendButtonWasActive == tSendButtonIsActive) {
            Serial.print(F("repeat "));
            sStoredIRData.receivedIRData.flags = IRDATA_FLAGS_IS_REPEAT;
        } else {
            sStoredIRData.receivedIRData.flags = IRDATA_FLAGS_EMPTY;
        }
        Serial.flush(); // To avoid disturbing the software PWM generation by serial output interrupts
        sendCode(&sStoredIRData);
        delay(DELAY_BETWEEN_REPEAT); // Wait a bit between retransmissions

    } else if (sSendButtonWasActive) {
        /*
         * Button is just released -> activate receiving
         */
        // Restart receiver
        Serial.println(F("Button released -> start receiving"));
        IrReceiver.start();
        delay(100); // Button debouncing

    } else if (IrReceiver.decode()) {
        /*
         * Button is not pressed and data available -> store received data and resume
         */
        storeCode();
        IrReceiver.resume(); // resume receiver
    }

    sSendButtonWasActive = tSendButtonIsActive;
}

// Stores the code for later playback in sStoredIRData
// Most of this code is just logging
void storeCode() {
    if (IrReceiver.decodedIRData.rawDataPtr->rawlen < 4) {
        Serial.print(F("Ignore data with rawlen="));
        Serial.println(IrReceiver.decodedIRData.rawDataPtr->rawlen);
        return;
    }
    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
        Serial.println(F("Ignore repeat"));
        return;
    }
    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_AUTO_REPEAT) {
        Serial.println(F("Ignore autorepeat"));
        return;
    }
    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_PARITY_FAILED) {
        Serial.println(F("Ignore parity error"));
        return;
    }
    if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
        Serial.println(F("Overflow occurred, raw data did not fit into " STR(RAW_BUFFER_LENGTH) " byte raw buffer"));
        return;
    }
    /*
     * Copy decoded data
     */
    sStoredIRData.receivedIRData = IrReceiver.decodedIRData;

    auto tProtocol = sStoredIRData.receivedIRData.protocol;
    if (tProtocol == UNKNOWN || tProtocol == PULSE_WIDTH || tProtocol == PULSE_DISTANCE) {
        // TODO: support PULSE_WIDTH and PULSE_DISTANCE with IrSender.write
        sStoredIRData.rawCodeLength = IrReceiver.decodedIRData.rawDataPtr->rawlen - 1;
        /*
         * Store the current raw data in a dedicated array for later usage
         */
        IrReceiver.compensateAndStoreIRResultInArray(sStoredIRData.rawCode);
        /*
         * Print info
         */
        Serial.print(F("Received unknown code and store "));
        Serial.print(IrReceiver.decodedIRData.rawDataPtr->rawlen - 1);
        Serial.println(F(" timing entries as raw in buffer of size " STR(RAW_BUFFER_LENGTH)));
        IrReceiver.printIRResultRawFormatted(&Serial, true); // Output the results in RAW format

    } else {
        IrReceiver.printIRResultShort(&Serial);
        IrReceiver.printIRSendUsage(&Serial);
        sStoredIRData.receivedIRData.flags = 0; // clear flags -esp. repeat- for later sending
        Serial.println();
    }
}

void sendCode(storedIRDataStruct *aIRDataToSend) {
    auto tProtocol = aIRDataToSend->receivedIRData.protocol;
    if (tProtocol == UNKNOWN || tProtocol == PULSE_WIDTH || tProtocol == PULSE_DISTANCE /* i.e. raw */) {
        // Assume 38 KHz
        IrSender.sendRaw(aIRDataToSend->rawCode, aIRDataToSend->rawCodeLength, 38);

        Serial.print(F("raw "));
        Serial.print(aIRDataToSend->rawCodeLength);
        Serial.println(F(" marks or spaces"));
    } else {
        /*
         * Use the write function, which does the switch for different protocols
         */
        IrSender.write(&aIRDataToSend->receivedIRData);
        printIRResultShort(&Serial, &aIRDataToSend->receivedIRData);
    }
}

This is the output I get.

OFF
Received unknown code and store 451 timing entries as raw in buffer of size 700
rawData[452]: 
 -49350
 +3350,-1700
 + 400,-1250 + 400,- 450 + 400,- 450 + 400,- 400
 + 400,- 450 + 400,- 450 + 350,- 450 + 400,- 450
 + 400,- 450 + 400,- 450 + 400,- 400 + 400,- 450
 + 400,-1300 + 400,- 400 + 400,- 450 + 400,- 450
 + 400,- 450 + 400,- 400 + 400,- 450 + 400,- 450
 + 350,-1300 + 400,-1300 + 350,- 450 + 450,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,- 450 + 350,-1300 + 400,- 450
 + 400,-1250 + 400,-1300 + 400,-1250 + 400,-1300
 + 400,-1250 + 400,-1300 + 400,- 400 + 400,-1300
 + 400,-1250 + 400,- 450 + 400,- 450 + 400,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 450,- 400
 + 450,- 400 + 400,-1250 + 450,-1250 + 400,-1250
 + 450,-1250 + 400,-1250 + 400,-1300 + 400,-1250
 + 400,-1300 + 400,- 400 + 450,- 400 + 400,- 450
 + 400,-1250 + 400,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,-1300 + 350,- 450 + 450,- 400
 + 400,-1300 + 400,- 400 + 400,- 450 + 400,- 450
 + 400,-1250 + 400,-1300 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 400,- 450
 + 400,- 450 + 350,- 500 + 400,-1250 + 400,- 450
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,- 450
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,-1250
 + 400,-1300 + 400,-1300 + 400,- 400 + 400,- 450
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,- 450
 + 400,- 400 + 400,- 450 + 400,- 450 + 400,- 450
 + 400,-1250 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,-1250 + 450,-1250 + 400,- 450
 + 400,- 400 + 400,- 450 + 400,- 450 + 400,- 450
 + 400,- 400 + 400,-1300 + 400,-1250 + 400,- 450
 + 400,- 450 + 400,- 400 + 450,- 450 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 450 + 400,- 450
 + 400,- 450 + 400,- 400 + 400,- 450 + 400,- 450
 + 400,- 400 + 450,- 450 + 350,- 450 + 400,- 450
 + 400,- 450 + 350,- 500 + 350,- 450 + 400,- 450
 + 400,- 450 + 350,- 500 + 350,- 450 + 400,- 450
 + 400,- 450 + 350,- 450 + 400,- 450 + 400,- 450
 + 400,- 450 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,-1300 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,-1300
 + 350,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,-1300
 + 350,-1300 + 400,-1300 + 350,-1300 + 400,- 450
 + 400,- 450 + 350,- 500 + 350,- 450 + 400,- 450
 + 400
Duration=227150us

ON
Ignore data with rawlen=2
Received unknown code and store 451 timing entries as raw in buffer of size 700
rawData[452]: 
 -49400
 +3300,-1700
 + 400,-1300 + 400,- 400 + 400,- 450 + 400,- 450
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,- 450
 + 350,- 450 + 450,- 400 + 400,- 450 + 400,- 450
 + 400,-1250 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,-1300 + 400,-1250 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 400,- 400
 + 400,- 450 + 400,- 450 + 400,-1250 + 450,- 400
 + 400,-1300 + 400,-1250 + 400,-1250 + 400,-1300
 + 400,-1250 + 400,-1300 + 400,- 450 + 400,-1250
 + 400,-1300 + 400,- 400 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 450,-1250 + 400,-1250 + 450,-1250
 + 400,-1250 + 400,-1300 + 350,-1300 + 400,-1300
 + 400,-1250 + 400,- 450 + 400,- 450 + 400,- 400
 + 400,-1300 + 350,- 500 + 400,- 400 + 400,- 450
 + 400,- 450 + 400,-1250 + 400,- 450 + 400,- 450
 + 350,-1300 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,-1300 + 350,-1300 + 400,- 450 + 400,- 450
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,- 400
 + 450,- 400 + 400,- 450 + 400,-1300 + 400,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 400,-1300
 + 400,-1250 + 400,-1300 + 400,- 400 + 450,- 400
 + 400,- 450 + 400,- 450 + 350,- 450 + 450,- 400
 + 400,- 450 + 400,- 450 + 400,- 400 + 400,- 450
 + 400,-1300 + 400,- 400 + 400,- 450 + 450,- 400
 + 400,- 400 + 450,- 400 + 400,- 450 + 400,- 450
 + 400,- 400 + 400,-1300 + 350,-1300 + 400,- 450
 + 400,- 450 + 400,- 450 + 400,- 400 + 400,- 450
 + 400,- 450 + 400,-1300 + 350,-1300 + 400,- 400
 + 400,- 500 + 350,- 500 + 350,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,-1300
 + 400,- 450 + 400,- 450 + 350,- 450 + 400,- 450
 + 400,- 450 + 350,- 500 + 350,- 450 + 400,- 450
 + 400,- 450 + 350,- 500 + 350,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 350,- 500
 + 350,- 450 + 400,- 450 + 400,- 450 + 400,- 450
 + 350,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,-1300 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,- 450
 + 350,- 500 + 350,- 450 + 400,- 450 + 400,-1300
 + 350,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400,-1300 + 350,-1300 + 400,-1300 + 350,- 450
 + 400,- 450 + 400,- 450 + 350,- 500 + 350,- 450
 + 400
Duration=227100us

I also used the ReceiveAndSendDistanceWidth example

/*
 * ReceiveAndSendDistanceWidth.cpp
 *
 * Record and play back last received distance width IR signal at button press.
 * Using DistanceWidthProtocol covers a lot of known and unknown IR protocols,
 * and requires less memory than raw protocol.
 *
 * The logic is:
 * If the button is pressed, send the IR code.
 * If an IR code is received, record it.
 *
 * An example for simultaneous receiving and sending is in the UnitTest example.
 *
 * An IR detector/demodulator must be connected to the input IR_RECEIVE_PIN.
 *
 * A button must be connected between the input SEND_BUTTON_PIN and ground.
 * A visible LED can be connected to STATUS_PIN to provide status.
 *
 * See also https://dronebotworkshop.com/ir-remotes/#ReceiveAndSendDistanceWidth_Code
 *
 *  This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
 *
 ************************************************************************************
 * MIT License
 *
 * Copyright (c) 2023 Armin Joachimsmeyer
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is furnished
 * to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 ************************************************************************************
 */
#include <Arduino.h>

#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if !defined(IR_SEND_PIN)
#define IR_SEND_PIN         3
#endif

/*
 * Specify DistanceWidthProtocol for decoding. This must be done before the #include <IRremote.hpp>
 */
#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
//
#if !defined(RAW_BUFFER_LENGTH)
// For air condition remotes it may require up to 750. Default is 200.
#  if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH  360
#  elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
#define RAW_BUFFER_LENGTH  750
#  endif
#endif

//#define NO_LED_FEEDBACK_CODE      // saves 92 bytes program memory
//#define RECORD_GAP_MICROS 12000   // Default is 8000. Activate it for some LG air conditioner protocols
//#define SEND_PWM_BY_TIMER         // Disable carrier PWM generation in software and use (restricted) hardware PWM.
//#define USE_NO_SEND_PWM           // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition

//#define DEBUG // Activate this for lots of lovely debug output from the decoders.

#include <IRremote.hpp>

#define SEND_BUTTON_PIN                     APPLICATION_PIN

#define DELAY_BETWEEN_REPEATS_MILLIS        70

// Storage for the recorded code, pre-filled with NEC data
IRRawDataType sDecodedRawDataArray[DECODED_RAW_DATA_ARRAY_SIZE] = { 0x7B34ED12 }; // Initialize with NEC address 0x12 and command 0x34
DistanceWidthTimingInfoStruct sDistanceWidthTimingInfo  = { 9000, 4500, 560, 1690, 560, 560 }; // Initialize with NEC timing
uint8_t sNumberOfBits = 32;

bool sSendButtonWasActive;

void setup() {
    pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);

    Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
    || defined(SERIALUSB_PID)  || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
    delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif
    // Just to know which program is running on my Arduino
    Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));

    // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
    IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
    Serial.println(F("Ready to receive pulse distance/width coded IR signals at pin " STR(IR_RECEIVE_PIN)));

    IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
    Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
    Serial.println(SEND_BUTTON_PIN);
}

void loop() {

    // If button pressed, send the code.
    bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == LOW); // Button pin is active LOW

    /*
     * Check for current button state
     */
    if (tSendButtonIsActive) {
        if (!sSendButtonWasActive) {
            Serial.println(F("Stop receiving"));
            IrReceiver.stop();
        }
        /*
         * Button pressed -> send stored data
         */
        Serial.print(F("Button pressed, now sending "));
        Serial.print(sNumberOfBits);
        Serial.print(F(" bits 0x"));
        Serial.print(sDecodedRawDataArray[0], HEX);
        Serial.print(F(" with sendPulseDistanceWidthFromArray timing="));
        IrReceiver.printDistanceWidthTimingInfo(&Serial, &sDistanceWidthTimingInfo);
        Serial.println();
        Serial.flush(); // To avoid disturbing the software PWM generation by serial output interrupts

        IrSender.sendPulseDistanceWidthFromArray(38, &sDistanceWidthTimingInfo, &sDecodedRawDataArray[0], sNumberOfBits,
#if defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
                PROTOCOL_IS_MSB_FIRST
#else
                PROTOCOL_IS_LSB_FIRST
#endif
                , 100, 0);

        delay(DELAY_BETWEEN_REPEATS_MILLIS); // Wait a bit between retransmissions

    } else if (sSendButtonWasActive) {
        /*
         * Button is just released -> activate receiving
         */
        // Restart receiver
        Serial.println(F("Button released -> start receiving"));
        IrReceiver.start();

    } else if (IrReceiver.decode()) {
        /*
         * Button is not pressed and data available -> store received data and resume
         * DistanceWidthTimingInfo and sNumberOfBits should be constant for all keys of the same IR remote / protocol
         */
        IrReceiver.printIRResultShort(&Serial);
        if (IrReceiver.decodedIRData.protocol != UNKNOWN) {
            IrReceiver.printIRSendUsage(&Serial);

            if (memcmp(&sDistanceWidthTimingInfo, &IrReceiver.decodedIRData.DistanceWidthTimingInfo,
                    sizeof(sDistanceWidthTimingInfo)) != 0) {
                Serial.print(F("Store new timing info data="));
                IrReceiver.printDistanceWidthTimingInfo(&Serial, &IrReceiver.decodedIRData.DistanceWidthTimingInfo);
                Serial.println();
                sDistanceWidthTimingInfo = IrReceiver.decodedIRData.DistanceWidthTimingInfo; // copy content here
            } else {
                Serial.print(F("Timing did not change, so we can reuse already stored timing info."));
            }
            if (sNumberOfBits != IrReceiver.decodedIRData.numberOfBits) {
                Serial.print(F("Store new numberOfBits="));
                sNumberOfBits = IrReceiver.decodedIRData.numberOfBits;
                Serial.println(IrReceiver.decodedIRData.numberOfBits);
            }
            if (sDecodedRawDataArray[0] != IrReceiver.decodedIRData.decodedRawDataArray[0]) {
                *sDecodedRawDataArray = *IrReceiver.decodedIRData.decodedRawDataArray; // copy content here
                Serial.print(F("Store new sDecodedRawDataArray[0]=0x"));
                Serial.println(IrReceiver.decodedIRData.decodedRawDataArray[0], HEX);
            }
        }
        IrReceiver.resume(); // resume receiver
    }

    sSendButtonWasActive = tSendButtonIsActive;
    delay(100);
}

and got this:

OFF
Protocol=UNKNOWN 1 bits (incl. gap and start) received
Protocol=PulseDistance Raw-Data=0x7800801 224 bits LSB first Gap=49300us Duration=227100us
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x40301001, 0x11FE01BF, 0x38040312, 0x6060100, 0x0, 0x0, 0x7800801};
    IrSender.sendPulseDistanceWidthFromArray(38, 3400, 1650, 400, 1250, 400, 400, &tRawData[0], 224, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
Store new timing info data=3400, 1650, 400, 1250, 400, 400

ON
Protocol=PulseDistance Raw-Data=0x7000801 224 bits LSB first Gap=49300us Duration=227150us
Send on a 8 bit platform with: 
    uint32_t tRawData[]={0x40301001, 0x11FE01BF, 0x38040312, 0x6060100, 0x8000, 0x0, 0x7000801};
    IrSender.sendPulseDistanceWidthFromArray(38, 3350, 1700, 400, 1250, 400, 400, &tRawData[0], 224, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
Store new timing info data=3350, 1700, 400, 1250, 400, 400 

Using this code:

/*
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)


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(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

}

I get this:

OFF
Raw: (453) 30076, -49768, 3448, -1624, 476, -1212, 480, -364, 476, -372, 476, -368, 476, -368, 476, -368, 476, -368, 476, -372, 476, -368, 476, -368, 476, -368, 476, -368, 476, -1224, 476, -360, 476, -368, 476, -368, 476, -368, 476, -368, 480, -368, 476, -368, 476, -1212, 476, -1212, 480, -364, 480, -368, 476, -368, 476, -368, 476, -368, 476, -368, 480, -368, 476, -368, 480, -1208, 480, -364, 480, -1212, 476, -1212, 476, -1212, 480, -1212, 476, -1216, 476, -1212, 476, -368, 476, -1212, 476, -1212, 480, -364, 480, -368, 476, -368, 480, -364, 476, -368, 480, -364, 480, -368, 476, -368, 476, -1212, 480, -1208, 484, -1208, 476, -1212, 476, -1216, 476, -1212, 476, -1212, 476, -1212, 480, -368, 476, -368, 476, -368, 480, -1208, 480, -368, 476, -368, 476, -368, 476, -368, 476, -1216, 476, -368, 476, -368, 476, -1216, 476, -368, 476, -368, 476, -368, 476, -1212, 476, -1212, 480, -368, 476, -368, 476, -368, 476, -368, 476, -368, 476, -368, 476, -368, 480, -368, 476, -1212, 476, -368, 476, -368, 476, -372, 476, -368, 476, -368, 476, -1212, 476, -372, 476, -368, 476, -1212, 476, -1212, 476, -1216, 476, -368, 472, -372, 476, -368, 476, -372, 476, -364, 480, -368, 476, -368, 476, -368, 476, -368, 476, -372, 472, -368, 476, -1212, 476, -372, 476, -368, 476, -372, 472, -368, 476, -368, 476, -368, 476, -372, 472, -1216, 476, -1212, 476, -368, 476, -372, 472, -368, 476, -372, 472, -372, 476, -368, 476, -1212, 476, -1212, 476, -372, 472, -372, 472, -372, 472, -372, 476, -368, 476, -368, 476, -372, 476, -364, 476, -372, 472, -372, 472, -372, 476, -368, 476, -368, 476, -368, 476, -372, 472, -372, 472, -372, 472, -372, 472, -372, 500, -344, 476, -368, 476, -372, 472, -368, 476, -372, 472, -372, 472, -372, 472, -372, 476, -368, 476, -368, 472, -372, 476, -372, 472, -372, 472, -372, 472, -372, 476, -368, 472, -376, 472, -372, 472, -372, 472, -372, 472, -372, 472, -372, 476, -368, 472, -372, 476, -368, 476, -372, 472, -372, 472, -372, 472, -372, 472, -372, 472, -372, 472, -372, 500, -348, 472, -372, 472, -372, 472, -372, 472, -372, 472, -372, 476, -372, 472, -368, 476, -368, 476, -372, 476, -368, 476, -368, 476, -368, 476, -368, 476, -372, 472, -372, 472, -372, 476, -372, 472, -1212, 476, -372, 472, -372, 472, -392, 472, -356, 472, -372, 472, -372, 472, -372, 476, -368, 476, -368, 476, -372, 472, -1216, 500, -344, 472, -376, 472, -372, 472, -372, 472, -372, 476, -368, 476, -368, 476, -372, 472, -372, 472, -372, 476, -372, 472, -1216, 472, -1216, 472, -372, 472, -1220, 472, -372, 472, -372, 472, -396, 448, -396, 448, -388, 468,

ON
Raw: (453) 30020, -49824, 3412, -1676, 440, -1232, 440, -404, 440, -404, 440, -404, 440, -404, 440, -408, 440, -404, 440, -404, 440, -404, 444, -404, 440, -404, 440, -404, 440, -1252, 440, -404, 440, -404, 440, -404, 440, -408, 440, -404, 436, -408, 440, -404, 440, -1252, 444, -1244, 444, -400, 440, -404, 444, -404, 440, -404, 440, -404, 440, -412, 440, -400, 436, -408, 440, -1252, 440, -404, 436, -1252, 444, -1248, 440, -1248, 444, -1244, 444, -1244, 444, -1248, 444, -400, 440, -1252, 440, -1252, 464, -376, 440, -408, 440, -404, 440, -404, 440, -404, 440, -404, 444, -404, 440, -404, 440, -1252, 440, -1248, 444, -1248, 440, -1252, 440, -1248, 440, -1248, 440, -1248, 444, -1248, 440, -404, 440, -404, 440, -404, 440, -1252, 444, -400, 440, -404, 440, -404, 472, -372, 440, -1256, 440, -400, 440, -408, 440, -1248, 444, -400, 440, -404, 440, -404, 440, -1252, 444, -1248, 440, -404, 436, -408, 440, -404, 440, -404, 440, -408, 440, -404, 440, -404, 440, -404, 440, -1252, 440, -404, 440, -404, 440, -404, 440, -408, 440, -404, 440, -404, 440, -1252, 440, -1248, 444, -400, 440, -1252, 440, -1248, 444, -400, 440, -404, 440, -404, 440, -408, 440, -404, 440, -404, 440, -404, 440, -408, 440, -404, 436, -408, 440, -1252, 440, -404, 436, -408, 440, -404, 440, -416, 440, -396, 440, -404, 436, -408, 440, -404, 440, -1252, 440, -1252, 440, -400, 440, -408, 436, -408, 436, -408, 440, -404, 440, -404, 440, -1276, 420, -1268, 420, -400, 444, -400, 444, -404, 444, -400, 444, -400, 444, -400, 444, -372, 472, -404, 444, -400, 444, -420, 424, -428, 416, -424, 420, -432, 412, -432, 416, -428, 392, -452, 392, -452, 392, -456, 392, -452, 392, -452, 392, -1300, 388, -456, 392, -452, 392, -456, 392, -452, 392, -452, 392, -452, 392, -452, 396, -448, 396, -452, 392, -452, 392, -432, 440, -400, 440, -404, 416, -428, 444, -404, 440, -404, 440, -404, 440, -404, 416, -428, 440, -404, 416, -432, 412, -432, 416, -428, 416, -428, 416, -428, 416, -432, 412, -432, 412, -432, 416, -428, 416, -428, 416, -428, 416, -432, 412, -432, 412, -432, 412, -432, 412, -432, 416, -432, 412, -432, 412, -432, 412, -432, 412, -432, 412, -432, 416, -432, 412, -432, 412, -432, 412, -432, 412, -432, 412, -436, 408, -1280, 412, -432, 412, -432, 412, -436, 408, -436, 408, -436, 408, -436, 412, -432, 412, -436, 408, -436, 408, -436, 408, -1304, 388, -436, 408, -436, 408, -460, 384, -460, 384, -460, 388, -456, 388, -472, 384, -448, 384, -464, 384, -456, 384, -464, 384, -460, 384, -1308, 380, -464, 384, -460, 384, -1308, 380, -464, 380, -464, 380, -468, 376, -468, 376,

I try sending the raw data pulses using the associated sending codes but my AC does not detect them. If anyone could please guide me towards the right direction because I'm at a loss. I already went through this forum post: Sending IR code to air conditioner (clone IR remote) - Projects / General Guidance - Arduino Forum

and various others with no success. Any help is much appreciated.

Your received signal looks valid hitachi 224bit code.
So I expect you have problem on the transmission side.Your link to transmitter circuit doesn't open.

Ps. If you have any Esp board, this library would likely have your signal decoded out of the box:


I couldn't post it in the original post because of the limited embedded items. I tried the esp32 board but same transmission problem

If that's the circuit, you have probably fried transmitter. There's nothing limiting the current through LED. You can test with phone camera if it's working.

With the library I linked??

yup did that, and it be flashing. I also did already try using the esp32 with the library you mentioned but it didn't work, I assume it's a different model.

I think my problem is how I'm supposed to transmit the raw data, and which one since each code has their own unique way of representing it. That's the part I'm struggling with since it's unclear what the AC actually reads.

So you were using this example receive code (receiver on GPIO14) ?

Hard to believe it didn't work. So what's the output it gives?

This is the output I receive from my esp32 using the library and example you mentioned

ESP32 IRrecvDumpV2

OFF
Timestamp : 000023.413
Library   : v2.8.6

Protocol  : MULTIBRACKETS
Code      : 0xE0 (8 Bits)
uint16_t rawData[453] = {30048, 49874,  3418, 1658,  444, 1244,  444, 384,  462, 368,  476, 402,  440, 406,  444, 398,  446, 366,  478, 370,  474, 400,  446, 400,  446, 400,  446, 400,  446, 1246,  442, 402,  446, 398,  444, 372,  472, 402,  444, 366,  480, 402,  442, 400,  446, 1246,  444, 1248,  444, 398,  446, 416,  460, 350,  464, 400,  444, 402,  444, 400,  446, 372,  472, 402,  442, 1248,  444, 402,  444, 1248,  446, 1242,  444, 1246,  444, 1248,  444, 1248,  442, 1248,  444, 366,  476, 1248,  442, 1248,  444, 400,  444, 402,  444, 400,  444, 402,  444, 402,  446, 406,  442, 392,  446, 400,  446, 1246,  444, 1248,  442, 1248,  444, 1248,  444, 1244,  442, 1250,  444, 1246,  444, 1248,  444, 400,  444, 400,  442, 404,  442, 1248,  444, 402,  444, 368,  474, 404,  442, 370,  476, 1248,  444, 370,  476, 400,  420, 1270,  442, 404,  420, 426,  442, 402,  444, 1248,  442, 1250,  442, 402,  418, 426,  444, 402,  444, 400,  442, 402,  420, 426,  438, 408,  420, 424,  442, 1248,  444, 402,  418, 426,  418, 428,  440, 402,  478, 354,  456, 402,  444, 400,  444, 404,  420, 1272,  442, 1246,  420, 1274,  418, 424,  442, 404,  444, 400,  420, 424,  418, 426,  422, 424,  420, 424,  420, 426,  420, 426,  416, 428,  442, 1248,  418, 428,  416, 428,  420, 426,  418, 426,  422, 424,  418, 428,  416, 428,  418, 428,  416, 1298,  420, 1270,  420, 424,  396, 450,  420, 424,  420, 424,  420, 424,  420, 424,  418, 1270,  420, 1270,  422, 424,  420, 424,  422, 424,  418, 428,  418, 426,  418, 426,  418, 426,  418, 426,  420, 424,  420, 426,  420, 436,  420, 414,  418, 428,  416, 428,  416, 428,  418, 428,  416, 430,  418, 426,  418, 426,  418, 426,  418, 428,  418, 428,  416, 430,  416, 428,  416, 430,  390, 454,  416, 430,  414, 410,  412, 432,  436, 410,  416, 428,  412, 432,  414, 434,  412, 432,  436, 410,  436, 406,  414, 432,  412, 432,  438, 408,  414, 432,  412, 432,  436, 408,  414, 436,  416, 424,  438, 406,  414, 430,  414, 432,  414, 432,  412, 432,  412, 432,  412, 432,  414, 432,  414, 432,  414, 432,  412, 434,  412, 434,  414, 430,  412, 432,  412, 432,  414, 432,  414, 432,  414, 432,  410, 434,  410, 434,  410, 436,  436, 410,  410, 434,  410, 434,  410, 436,  410, 1282,  410, 434,  410, 436,  408, 440,  406, 436,  408, 456,  388, 458,  388, 456,  388, 458,  388, 456,  388, 458,  388, 1304,  388, 458,  388, 456,  388, 458,  388, 458,  388, 456,  388, 458,  388, 458,  388, 458,  386, 460,  386, 460,  384, 460,  384, 1306,  384, 1304,  384, 1306,  384, 1306,  384, 462,  384, 462,  382, 464,  380, 464,  378, 466,  378};  // MULTIBRACKETS E0
uint64_t data = 0xE0;


ON
Timestamp : 000027.296
Library   : v2.8.6

Protocol  : MULTIBRACKETS
Code      : 0xE0 (8 Bits)
uint16_t rawData[453] = {30024, 49900,  3416, 1660,  444, 1248,  444, 400,  446, 400,  446, 398,  446, 374,  470, 400,  446, 398,  444, 402,  446, 400,  442, 402,  446, 400,  442, 366,  480, 1248,  444, 398,  446, 370,  476, 398,  444, 370,  478, 400,  444, 400,  444, 400,  446, 1246,  444, 1248,  442, 400,  444, 400,  446, 368,  476, 400,  444, 368,  480, 396,  448, 400,  442, 402,  446, 1246,  444, 402,  446, 1246,  442, 1248,  444, 1246,  444, 1246,  446, 1248,  442, 1246,  444, 398,  446, 1260,  442, 1234,  446, 400,  444, 368,  480, 362,  480, 372,  476, 304,  538, 402,  446, 366,  478, 402,  442, 1246,  444, 1248,  444, 1246,  444, 1244,  442, 1250,  442, 1248,  422, 1270,  442, 1246,  442, 402,  446, 398,  444, 402,  444, 1248,  444, 322,  524, 362,  480, 398,  446, 402,  444, 1244,  446, 400,  420, 424,  422, 1270,  444, 402,  444, 400,  444, 402,  442, 1250,  442, 1248,  444, 400,  446, 402,  418, 414,  428, 424,  420, 424,  446, 398,  442, 402,  444, 400,  420, 1270,  442, 404,  412, 430,  446, 402,  444, 398,  420, 424,  442, 404,  420, 424,  420, 424,  420, 1270,  440, 1250,  444, 1246,  420, 426,  420, 424,  422, 424,  420, 424,  442, 402,  442, 402,  420, 426,  420, 424,  418, 426,  444, 402,  440, 1250,  416, 428,  420, 428,  414, 426,  420, 426,  418, 428,  420, 424,  414, 430,  420, 428,  416, 1274,  418, 1272,  418, 426,  444, 400,  420, 426,  442, 402,  442, 402,  442, 402,  442, 1250,  446, 1246,  444, 402,  444, 424,  420, 440,  424, 406,  420, 426,  422, 422,  422, 424,  422, 424,  418, 428,  418, 424,  422, 426,  418, 424,  418, 426,  420, 424,  418, 426,  420, 424,  418, 426,  420, 426,  420, 424,  420, 426,  420, 1248,  440, 428,  418, 428,  416, 426,  420, 428,  418, 426,  416, 428,  416, 430,  416, 428,  416, 430,  416, 428,  416, 428,  416, 430,  416, 420,  434, 398,  412, 432,  438, 406,  438, 406,  412, 432,  414, 430,  414, 432,  414, 428,  416, 430,  414, 430,  414, 430,  440, 406,  414, 430,  414, 430,  440, 404,  416, 428,  438, 408,  414, 430,  414, 432,  438, 406,  414, 432,  412, 430,  442, 404,  412, 434,  412, 434,  412, 434,  412, 434,  412, 432,  410, 430,  414, 432,  414, 432,  412, 434,  434, 410,  412, 432,  410, 434,  412, 1280,  410, 434,  410, 432,  412, 434,  414, 432,  410, 438,  406, 436,  410, 436,  410, 436,  410, 436,  410, 436,  410, 1282,  406, 438,  406, 438,  408, 438,  406, 456,  388, 458,  416, 428,  388, 458,  388, 456,  386, 460,  388, 456,  388, 458,  388, 456,  388, 1304,  388, 1304,  386, 1304,  386, 458,  386, 460,  382, 460,  384, 460,  384, 464,  384};  // MULTIBRACKETS E0
uint64_t data = 0xE0;

Weird...
Try to send it (GPIO18).

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>

const uint16_t kIrLed = 18;  // ESP GPIO pin to use. .

IRsend irsend(kIrLed);  // Set the GPIO to be used to sending the message.

// Example of data captured by IRrecvDumpV2.ino
uint16_t rawData[453] = {30024, 49900,  3416, 1660,  444, 1248,  444, 400,  446, 400,  446, 398,  446, 374,  470, 400,  446, 398,  444, 402,  446, 400,  442, 402,  446, 400,  442, 366,  480, 1248,  444, 398,  446, 370,  476, 398,  444, 370,  478, 400,  444, 400,  444, 400,  446, 1246,  444, 1248,  442, 400,  444, 400,  446, 368,  476, 400,  444, 368,  480, 396,  448, 400,  442, 402,  446, 1246,  444, 402,  446, 1246,  442, 1248,  444, 1246,  444, 1246,  446, 1248,  442, 1246,  444, 398,  446, 1260,  442, 1234,  446, 400,  444, 368,  480, 362,  480, 372,  476, 304,  538, 402,  446, 366,  478, 402,  442, 1246,  444, 1248,  444, 1246,  444, 1244,  442, 1250,  442, 1248,  422, 1270,  442, 1246,  442, 402,  446, 398,  444, 402,  444, 1248,  444, 322,  524, 362,  480, 398,  446, 402,  444, 1244,  446, 400,  420, 424,  422, 1270,  444, 402,  444, 400,  444, 402,  442, 1250,  442, 1248,  444, 400,  446, 402,  418, 414,  428, 424,  420, 424,  446, 398,  442, 402,  444, 400,  420, 1270,  442, 404,  412, 430,  446, 402,  444, 398,  420, 424,  442, 404,  420, 424,  420, 424,  420, 1270,  440, 1250,  444, 1246,  420, 426,  420, 424,  422, 424,  420, 424,  442, 402,  442, 402,  420, 426,  420, 424,  418, 426,  444, 402,  440, 1250,  416, 428,  420, 428,  414, 426,  420, 426,  418, 428,  420, 424,  414, 430,  420, 428,  416, 1274,  418, 1272,  418, 426,  444, 400,  420, 426,  442, 402,  442, 402,  442, 402,  442, 1250,  446, 1246,  444, 402,  444, 424,  420, 440,  424, 406,  420, 426,  422, 422,  422, 424,  422, 424,  418, 428,  418, 424,  422, 426,  418, 424,  418, 426,  420, 424,  418, 426,  420, 424,  418, 426,  420, 426,  420, 424,  420, 426,  420, 1248,  440, 428,  418, 428,  416, 426,  420, 428,  418, 426,  416, 428,  416, 430,  416, 428,  416, 430,  416, 428,  416, 428,  416, 430,  416, 420,  434, 398,  412, 432,  438, 406,  438, 406,  412, 432,  414, 430,  414, 432,  414, 428,  416, 430,  414, 430,  414, 430,  440, 406,  414, 430,  414, 430,  440, 404,  416, 428,  438, 408,  414, 430,  414, 432,  438, 406,  414, 432,  412, 430,  442, 404,  412, 434,  412, 434,  412, 434,  412, 434,  412, 432,  410, 430,  414, 432,  414, 432,  412, 434,  434, 410,  412, 432,  410, 434,  412, 1280,  410, 434,  410, 432,  412, 434,  414, 432,  410, 438,  406, 436,  410, 436,  410, 436,  410, 436,  410, 436,  410, 1282,  406, 438,  406, 438,  408, 438,  406, 456,  388, 458,  416, 428,  388, 458,  388, 456,  386, 460,  388, 456,  388, 458,  388, 456,  388, 1304,  388, 1304,  386, 1304,  386, 458,  386, 460,  382, 460,  384, 460,  384, 464,  384};


void setup() {
  irsend.begin();
#if ESP8266
  Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
#else  // ESP8266
  Serial.begin(115200, SERIAL_8N1);
#endif  // ESP8266
}

void loop() {
  
  Serial.println("a rawData capture from IRrecvDumpV2");
  irsend.sendRaw(rawData, 453, 38);  // Send a raw data capture at 38kHz.
  delay(5000);
  
}

I tried using the code. Nothing, the ac doesn't do anything, not even a sound.
IMG_6890.zip (876.0 KB)
Here is a video clip of my ir transmitter trying to send the signal.

I just want to say thank you for helping me, I love working with Arduino and can usually figure things out but the invisible waves through the air are out of my expertise .-.

Sorry, i'm not opening compressed files.
That pre-header {30024, 49900, is something I wouldn't expect to see.
Anyway, at this point I would focus on your transmitter hardware. If it really is like you posted, i's basically abusing every component on the circuit and twice arduino/esp. If LED doesn't have resistor in series, it draws undefined current and can get damaged. Also the transistor has max current rating. And if it's powered from arduino, sudden high current draw might cause voltage drop and even reset arduino. On top of that 100R resistor is generally too low to protect the GPIO pin.
If you built it and have components, rebuild it with new components and for example 330R base resistor and 22R in series with IR-LED.

Fair enough, just trying to provide as much info as I can, didn't have a chance to upload to Youtube.

I'm going back to my UNI tomorrow and will try with the AC there if I can get it working with a new circuit combo. I also have an adafruit IR transmitter I can try, but is that any better than the LED+transistor combo?

Better not, but since it's correctly built, it should work. If it's a model with transistor it's good. If without, the range is pretty low, test it with short distance.

I'll try both. Here's the circuit video link https://youtube.com/shorts/CZnzOUcrW4k?feature=share
and a screenshot in case you're uncomfortable following the youtube link.


I'll try both tomorrow with the new AC which is a VOLTAS and see if anything works, fingers crossed, will keep the thread posted.

1 Like

I would suggest that you try to get it working on something a little less challenging than an AC, just to be sure you have it connected correctly. Something like a TV, where IRremote.h can give you an address/command combination rather than just raw data.

Also, do you know what the IR carrier frequency is? Usually it's 38KHz for TVs, but is that correct for Hitachi?

I'm living in a hostel dorm so the only IR device I have is the AC, which I wanted to make smarter via IR signal control to learn more about it .-.

So I just got back to my dorm and got the new AC remote values. This AC is a VOLTAS the main reason for this project attempt

OFF VOLTAS
rawData[162]: 
 -3276750
 +1050,- 550
 +1050,- 550 +1000,-2550 +1000,-2600 +1000,- 550
 +1050,- 550 +1050,-2500 +1050,-2550 +1000,-2550
 +1050,-2500 +1050,-2550 +1000,- 550 +1050,-2550
 +1000,- 550 +1050,- 550 +1050,- 550 +1000,- 600
 +1000,- 550 +1050,- 550 +1050,- 550 +1000,- 600
 +1000,- 550 +1050,- 550 +1050,- 550 +1050,- 550
 +1000,- 550 +1050,- 550 +1050,-2550 +1000,-2550
 +1050,- 550 +1000,-2550 +1050,- 550 +1000,- 600
 +1000,- 550 +1050,-2550 +1000,-2550 +1050,-2550
 +1000,- 550 +1050,-2550 +1000,-2550 +1000,- 600
 +1000,- 550 +1050,-2550 +1000,-2550 +1050,-2500
 +1050,- 600 +1000,-2550 +1000,-2550 +1000,- 600
 +1000,- 600 +1000,-2550 +1000,-2550 +1050,-2500
 +1050,- 600 +1000,-2500 +1050,-2550 +1000,- 600
 +1000,- 550 +1050,- 550 +1050,-2500 +1050,- 550
 +1050,- 550 +1000,- 600 +1000,-2550 +1050,- 550
 +1000,- 550 +1050,- 550 +1050,-2550 +1000,- 550
 +1050,- 550 +1050,- 550 +1000,- 600 +1000,-2550
 +1050,-2550 +1000,-2550 +1000,-2550 +1000,-2600
 +1000,- 550 +1050,- 550 +1000,- 600 +1000
Duration=195350us


OFF VOLTAS
#define RAW_DATA_LEN 100
uint16_t rawData[RAW_DATA_LEN]={
	1022, 586, 1014, 586, 1018, 2586, 1018, 2586, 
	1018, 586, 1018, 586, 1018, 2582, 1018, 2586, 
	1018, 2586, 1014, 2586, 1018, 2586, 1014, 586, 
	1018, 2586, 1018, 586, 1018, 586, 1018, 586, 
	1018, 586, 1018, 586, 1018, 586, 1018, 586, 
	1018, 586, 1018, 590, 1014, 586, 1018, 586, 
	1018, 586, 1018, 586, 1018, 586, 1018, 2586, 
	1018, 2582, 1018, 586, 1018, 2590, 1014, 586, 
	1018, 586, 1018, 586, 1018, 2586, 1018, 2586, 
	1014, 2586, 1018, 586, 1018, 2586, 1018, 2586, 
	1014, 586, 1018, 586, 1018, 2586, 1018, 2586, 
	1018, 2586, 1014, 586, 1018, 2586, 1018, 2586, 
	1014, 586, 1018, 1000};

ON VOLTAS
rawData[162]: 
 -3276750
 +1050,- 550
 +1000,- 550 +1050,-2550 +1000,-2600 +1000,- 550
 +1000,- 600 +1000,-2550 +1050,-2550 +1000,-2550
 +1000,-2550 +1050,-2550 +1000,- 550 +1050,-2550
 +1000,- 550 +1050,- 550 +1050,- 550 +1000,-2600
 +1000,- 550 +1000,- 600 +1000,- 550 +1050,- 550
 +1050,- 550 +1050,- 550 +1000,- 550 +1050,- 550
 +1050,- 550 +1050,- 550 +1000,-2600 +1000,-2550
 +1000,- 550 +1050,-2550 +1000,- 550 +1050,- 550
 +1050,- 550 +1000,-2600 +1000,-2550 +1000,-2550
 +1000,- 600 +1000,-2550 +1050,-2500 +1050,- 550
 +1050,- 550 +1000,-2550 +1050,-2550 +1000,-2550
 +1000,- 600 +1050,-2500 +1050,-2500 +1050,- 550
 +1050,- 550 +1000,-2550 +1050,-2500 +1050,-2550
 +1000,- 600 +1000,-2550 +1050,-2500 +1050,- 550
 +1050,- 550 +1000,- 600 +1000,-2550 +1050,- 550
 +1000,- 550 +1050,- 550 +1050,-2550 +1000,- 550
 +1050,- 550 +1050,- 550 +1000,-2550 +1050,- 550
 +1000,- 600 +1000,- 550 +1050,- 550 +1050,- 550
 +1050,-2550 +1000,-2550 +1000,-2550 +1050,-2550
 +1000,- 550 +1050,- 550 +1000,- 600 +1000
Duration=195350us

ON
Raw: (161) 1068, -532, 1068, -536, 1068, -2540, 1064, -2536, 1068, -536, 1068, -536, 1068, -2532, 1068, -2536, 1068, -2532, 1068, -2540, 1064, -2536, 1064, -536, 1068, -2536, 1068, -532, 1068, -540, 1064, -536, 1068, -2536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -2540, 1060, -2540, 1064, -536, 1068, -536, 1068, -2536, 1068, -536, 1068, -536, 1068, -2536, 1068, -2532, 1068, -2536, 1068, -536, 1068, -2532, 1068, -2536, 1068, -536, 1068, -536, 1068, -2532, 1068, -2536, 1068, -2532, 1068, -564, 1016, -2560, 1040, -2560, 1044, -584, 1016, -588, 1020, -2556, 1044, -2560, 1040, -2564, 1020, -608, 1016, -2560, 1044, -2556, 1048, -584, 1020, -560, 1040, -564, 1040, -2560, 1044, -560, 1040, -564, 1040, -564, 1064, -2536, 1040, -564, 1040, -564, 1040, -564, 1040, -2564, 1036, -564, 1040, -564, 1040, -564, 1040, -564, 1040, -564, 1040, -2564, 1036, -2564, 1040, -2564, 1036, -2568, 1036, -564, 1040, -564, 1036, -2588, 1016, 


OFF
Raw: (161) 1064, -536, 1068, -536, 1068, -2560, 1044, -2536, 1068, -536, 1068, -536, 1068, -2532, 1068, -2536, 1068, -2532, 1068, -2536, 1068, -2536, 1068, -536, 1064, -2540, 1064, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1068, -536, 1064, -540, 1068, -536, 1068, -536, 1064, -536, 1072, -536, 1068, -2532, 1068, -2536, 1064, -536, 1068, -536, 1068, -2536, 1068, -536, 1064, -540, 1068, -2532, 1068, -2536, 1064, -2536, 1064, -540, 1068, -2536, 1064, -2536, 1064, -540, 1064, -536, 1068, -2536, 1068, -2536, 1064, -2536, 1068, -532, 1068, -2536, 1068, -2536, 1064, -564, 1040, -564, 1040, -2536, 1044, -2556, 1068, -2532, 1044, -588, 1016, -2560, 1040, -2560, 1044, -584, 1016, -588, 1016, -588, 1020, -2556, 1044, -564, 1044, -560, 1040, -564, 1040, -2560, 1040, -564, 1052, -552, 1040, -564, 1040, -2560, 1040, -564, 1044, -560, 1040, -564, 1040, -564, 1040, -2560, 1040, -2560, 1040, -2564, 1040, -2564, 1036, -2564, 1040, -564, 1040, -564, 1036, -2568, 1036,

but when I tried sending it via the pre-built emitter it's not working. I have an oscilloscope, is there any way to decode this IR signal completely manually? Or how exactly should I send it? My esp32 is packed so I'll also try that tomorrow but I feel like I'm either missing something obvious or these AC protocols are just too unique to duplicate.

I don't follow you at all now.
This last raw data has nothing to do with the previous.

Yes, expect multiple days full time job though...
Anyway, you don't have to decode anything to repeat a code. If you have working receiver and transmitter, in few minutes you can read the signal and repeat it.

ah let me explain real quick. I'm currently in university. I wanted to control my dorm rooms ac using an Arduino but had to go home for a week holiday. I have an AC at home so I started this thread while I was at home attempting to decode my Hitachi AC remote control signal for my entire week break with no success, so I started the thread thinking I might have missed something obvious. By the time I this thread gained traction I had to return to my dorm, and that's where I am now. My last post

I provided the updated values for the Voltas Brand AC which has no protocol data online in any arduino project I could find, the main reason I started on this journey. I tried recreating the steps you previously asked me to in this thread but they didn't work on this AC either. So I updated the thread with these values :slight_smile:
I'm assuming the carrier frequency is 38kHz but not sure how I would 100% verify it. I'm also currently located in India so unclear if these brands have different protocol methods.
I appreciate all the advice and feedback, just hoping something clicks eventually .-.

Quite likely it's 38kHz. Just use the previous library receiver code for Esp.

1 Like

If you have a scope, you can confirm the carrier frequency. But you will need to take the remote apart so you can put the probe directly on the anode or cathode of the transmitting IR LED. This gives you direct access to the drive signal to the LED. Put your scope in single mode, and just capture the beginning of the output. If it's 38Khz, you should get cycles of 26.3us.

1 Like