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};