Controlling a Nobel air conditioner by esp8266 using IR led transmitter

Hello everyone, I am currently working on a project to develop a monitoring and control application for Nobel air conditioners using ESP8266, IR LEDs, and IR receivers. To begin with, I am developing a prototype to replace the remote control. I was able to decode the remote control buttons using an infrared receiver. However, I am currently facing an issue where the air conditioner doesn't respond when I develop an Arduino code to send these commands. Attached is the code for sending the signals using the remote control decoding and the schematic used. I want to validate this step before moving on to the design of the mobile application. Thank you in advance for your responses.
Envoi en cours : IMG_20230608_120705.jpg…
teh arduino code :

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

const char* ssid = "SMART GUEST";
const char* password = "new@$m-TI@2322";

const int IR_PIN = D5; // The GPIO pin connected to the IR transmitter

IRsend irsend(IR_PIN);

// Raw IR data for power on command
uint16_t powerOnRawData[] = {8354, 4232,  502, 562,  504, 1630,  502, 1630,  504, 562,  504, 1630,  504, 562,  502, 1630,  504, 562,  504, 564,  502, 1630,  504, 1630,  502, 562,  504, 1630,  502, 1628,  504, 1628,  504, 564,  502, 562,  504, 564,  502, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  502, 562,  504, 562,  504, 562,  504, 562,  506, 1628,  504, 562,  504, 564,  502, 562,  504, 562,  504, 1630,  504, 562,  504, 562,  502, 1632,  502, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  502, 564,  502, 562,  504, 562,  504, 562,  502, 564,  502, 562,  504, 564,  502, 564,  502, 564,  504, 562,  504, 564,  502, 562,  504, 562,  502, 562,  504, 562,  504, 564,  502, 564,  502, 562,  502, 564,  502, 562,  504, 564,  502, 562,  504, 564,  502, 564,  502, 564,  502, 564,  504, 562,  502, 562,  504, 562,  504, 562,  502, 564,  502, 564,  502, 562,  504, 564,  502, 564,  502, 564,  504, 562,  502, 564,  504, 562,  502, 562,  504, 564,  502, 564,  504, 562,  504, 564,  502, 562,  504, 562,  504, 562,  502, 562,  504, 564,  502, 562,  502, 564,  502, 564,  504, 562,  502, 564,  502, 564,  502, 562,  504, 564,  504, 562,  504, 562,  504, 564,  502, 564,  502, 562,  504, 562,  504, 562,  504, 1630,  502, 1628,  504, 1630,  502, 562,  504, 564,  502, 564,  504};  // MIRAGE

// Raw IR data for power off command
uint16_t powerOffRawData[] = {8356, 4230,  506, 560,  506, 1628,  506, 1626,  506, 562,  504, 1628,  506, 560,  504, 1628,  506, 562,  504, 562,  504, 1628,  506, 1626,  506, 560,  504, 1628,  504, 1628,  504, 1626,  506, 562,  504, 560,  506, 560,  504, 562,  506, 562,  504, 560,  506, 560,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  502, 562,  504, 562,  504, 1628,  504, 562,  504, 562,  504, 562,  504, 562,  504, 1628,  504, 562,  504, 562,  504, 1628,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 1628,  504, 1628,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  504, 560,  504, 562,  504, 562,  504, 562,  504, 562,  504, 562,  502, 562,  504, 562,  504, 562,  504, 560,  506, 562,  504, 560,  506, 560,  506, 560,  504, 562,  506, 560,  506, 562,  504, 562,  504, 560,  504, 562,  504, 562,  504, 562,  504, 560,  506, 562,  504, 562,  504, 562,  504, 560,  504, 562,  506, 560,  504, 562,  506, 560,  506, 560,  504, 560,  506, 560,  506, 562,  504, 562,  504, 560,  506, 560,  504, 562,  504, 562,  504, 562,  504, 560,  504, 562,  504, 562,  504, 560,  506, 562,  504, 560,  504, 562,  504, 562,  504, 1628,  506, 562,  506, 1628,  504, 560,  506, 560,  506};
void setup() {
  Serial.begin(115200);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }

  Serial.println("Connected to WiFi");
}

void loop() {
  sendIRPowerOnCommand();
  delay(5000); // Wait for 5 seconds
  sendIRPowerOffCommand();
  delay(5000); // Wait for 5 seconds
}

void sendIRPowerOnCommand() {
  for (int i = 0; i < 3; i++) {
    irsend.sendRaw(powerOnRawData, sizeof(powerOnRawData) / sizeof(powerOnRawData[0]), 38);
    delay(50);
  }
}

void sendIRPowerOffCommand() {
  for (int i = 0; i < 3; i++) {
    irsend.sendRaw(powerOffRawData, sizeof(powerOffRawData) / sizeof(powerOffRawData[0]), 38);
    delay(50);
  }
}

and the data from decoding the IR remote control,
09:52:05.574 -> Timestamp : 000085.987
09:52:05.574 -> Library : v2.8.5
09:52:05.574 ->
09:52:05.574 -> Protocol : MIRAGE
09:52:05.574 -> Code : 0x56760000210100000000000000001C (120 Bits)
09:52:05.574 -> Mesg Desc.: Model: 2 (KKG29AC1), Power: On, Mode: 2 (Cool), Temp: 26C, Fan: 1 (High), Turbo: Off, Sleep: Off, Quiet: Off, Light: -, Swing(V): Off, Swing(H): On, Filter: Off, Clean: -, On Timer: Off, Off Timer: Off, IFeel: Off
09:52:05.621 -> uint16_t rawData[243] = {8354, 4232, 502, 562, 504, 1630, 502, 1630, 504, 562, 504, 1630, 504, 562, 502, 1630, 504, 562, 504, 564, 502, 1630, 504, 1630, 502, 562, 504, 1630, 502, 1628, 504, 1628, 504, 564, 502, 562, 504, 564, 502, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 502, 562, 504, 562, 504, 562, 504, 562, 506, 1628, 504, 562, 504, 564, 502, 562, 504, 562, 504, 1630, 504, 562, 504, 562, 502, 1632, 502, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 502, 564, 502, 562, 504, 562, 504, 562, 502, 564, 502, 562, 504, 564, 502, 564, 502, 564, 504, 562, 504, 564, 502, 562, 504, 562, 502, 562, 504, 562, 504, 564, 502, 564, 502, 562, 502, 564, 502, 562, 504, 564, 502, 562, 504, 564, 502, 564, 502, 564, 502, 564, 504, 562, 502, 562, 504, 562, 504, 562, 502, 564, 502, 564, 502, 562, 504, 564, 502, 564, 502, 564, 504, 562, 502, 564, 504, 562, 502, 562, 504, 564, 502, 564, 504, 562, 504, 564, 502, 562, 504, 562, 504, 562, 502, 562, 504, 564, 502, 562, 502, 564, 502, 564, 504, 562, 502, 564, 502, 564, 502, 562, 504, 564, 504, 562, 504, 562, 504, 564, 502, 564, 502, 562, 504, 562, 504, 562, 504, 1630, 502, 1628, 504, 1630, 502, 562, 504, 564, 502, 564, 504}; // MIRAGE
09:52:05.760 -> uint8_t state[15] = {0x56, 0x76, 0x00, 0x00, 0x21, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C};
09:52:05.760 ->
09:52:05.760 ->
09:52:29.015 -> Timestamp : 000109.431
09:52:29.015 -> Library : v2.8.5
09:52:29.015 ->
09:52:29.015 -> Protocol : MIRAGE
09:52:29.015 -> Code : 0x5676000021C1000000000000000028 (120 Bits)
09:52:29.062 -> Mesg Desc.: Model: 2 (KKG29AC1), Power: Off, Mode: 2 (Cool), Temp: 26C, Fan: 1 (High), Turbo: Off, Sleep: Off, Quiet: Off, Light: -, Swing(V): Off, Swing(H): On, Filter: Off, Clean: -, On Timer: Off, Off Timer: Off, IFeel: Off
09:52:29.062 -> uint16_t rawData[243] = {8356, 4230, 506, 560, 506, 1628, 506, 1626, 506, 562, 504, 1628, 506, 560, 504, 1628, 506, 562, 504, 562, 504, 1628, 506, 1626, 506, 560, 504, 1628, 504, 1628, 504, 1626, 506, 562, 504, 560, 506, 560, 504, 562, 506, 562, 504, 560, 506, 560, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 502, 562, 504, 562, 504, 1628, 504, 562, 504, 562, 504, 562, 504, 562, 504, 1628, 504, 562, 504, 562, 504, 1628, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 1628, 504, 1628, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 504, 560, 504, 562, 504, 562, 504, 562, 504, 562, 504, 562, 502, 562, 504, 562, 504, 562, 504, 560, 506, 562, 504, 560, 506, 560, 506, 560, 504, 562, 506, 560, 506, 562, 504, 562, 504, 560, 504, 562, 504, 562, 504, 562, 504, 560, 506, 562, 504, 562, 504, 562, 504, 560, 504, 562, 506, 560, 504, 562, 506, 560, 506, 560, 504, 560, 506, 560, 506, 562, 504, 562, 504, 560, 506, 560, 504, 562, 504, 562, 504, 562, 504, 560, 504, 562, 504, 562, 504, 560, 506, 562, 504, 560, 504, 562, 504, 562, 504, 1628, 506, 562, 506, 1628, 504, 560, 506, 560, 506}; // MIRAGE
09:52:29.202 -> uint8_t state[15] = {0x56, 0x76, 0x00, 0x00, 0x21, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28};

I see you have placed a lot of work into this. Did you know for noise immunity etc the IR signals are modulated. I do not know your unit so I do not know the modulation frequency. Your IR signal needs to be modulated properly for the unit to receive it. From your missing schematic I see nothing as to how you are trying to accomplish this.

Thank you so much for your respone
I used the attached air conditioner
For the ciruit I used an esp8266, IR LED , Transistor NPN , Resistor 100ohm
But in your response, how can I protect the IR signals from the noise ? can you give me more explanations please? did you mean that with those codes I can't send the IR signals to the air conditioner ?

Thank you in advance

Sorry I do not do well with word schematics. Also you will have to do some research to find what codes etc they are using and what the modulation frequency is. I do not have any of that information nor do I have the time to look for you. You might consider contacting the manufacturer. You could possibly get a remote for much less than your approach.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.