Automatic control of air conditioners

Good day, I am completely new in the arduino world and this forum has helped me a lot to learn a bit, I had not been encouraged to write because the truth, most of the doubts I had about my project were solved right here. I am about to finish a school project and it consists of an automatic temperature control with alarm, what I want to achieve with this is that the temperature inside a site is not higher than 25 ° C and lower than 16 ° C. In case these conditions are not met, monitor the temperature for one hour (1 reading every 10 minutes) and take an average, in case the average is different to the ideal values send a signal from an infrared LED with the code to raise or lower the temperature. After this, sensing the temperature again for 1 hour and if the conditions do not change send an alarm.

The air conditioners that I want to control are from the brand McQuay, Trane and York. The materials that I used for the project are:

  • Arduino UNO
  • Two temperature sensors LM35
  • 2X16 LCD
  • Potentiometer
  • LED infrared emitter
  • Four-channel relay module
  • To decode the remote controls I used the infrared module AX1838HS

I decoded remote controls of different brands of air conditioning as well as televisions, with the integrated infrared receiver AX1838HS and the example that brings the library IRremote, I worked well, in fact I practiced sending signals with a TV but when I wanted to try with the air conditioning and everything together did not work.

Also tried to do it with the RAW code sketch and it does not work either. I leave the code below:

//This is the IRremote library at the moment of including it, the 4 are added, I downloaded it from https://github.com/z3t0/Arduino-IRremote
#include 
#include 
#include 
#include 
#include 

int promedio= 0;
int lectura1= 0;
int lectura2= 0;
int lectura3= 0;
int lectura4= 0;
int lectura5= 0;
int lectura6= 0;
int analog= A0;
int analog1= A1;
LiquidCrystal lcd(12, 11, 5, 4, 6, 2);
int Temp= 0;
int Temp2= 0;
#define rele 10
int tiempo= 10000
IRsend irsend;
//----------------------------------------------------------------------------------------------
void setup() {
SerialBegin(9600);
lcd.begin(16,2);
pinMode(rele, OUTPUT);
digitalWrite(rele, HIGH);
}
//----------------------------------------------------------------------------------------------
void loop () {
Temp = analogRead(analog);
Temp = (500.0*Temp)/1023.0;
Temp2 = analogRead(analog1);
Temp2 ( (500.0*Temp2)/1023.0;
Serial.print("Interior: ");
Serial.print(Temp);
Serial.print("C");
Serial.print("Exterior: ");
Serial.print(Temp2);

lcd.setCursor(0,0);
lcd.print("Interior: ");
lcd.setCursor(10,0);
lcd.print(Temp);
lcd.setCursor(12,0);
lcd.print("C");

lcd.setCursor(0,2);
lcd.print("Exterior: ");
lcd.setCursor(10,1);
lcd.print(Temp2);
lcd.setCursor(13,1);
lcd.print("C");
//----------------------------------------------------------------------------------------------
if(Temp>25)
{
delay(tiempo);
Temp = analogRead(analog);
Tempr = (500.0*Temp)/1023.0;
lectura1=Temp;
delay(tiempo);
Temp = analogRead(analog);
Temp = (500.0*Temp)/1023.0;
lectura2=Temp;
delay(tiempo)
Temp = analogRead(analog);
Temp = (500.0*Temp)/1023.0;
lectura3=Temp;
delay(tiempo);
Temp = analogRead(analog);
Temp = (500.0*Temp)/1023.0;
lectura4=Temp;
delay(tiempo);
Temp = analogRead(analog)
Temp = (500.0*Temp)/1023.0;
lectura5=Temp;
delay(tiempo);
Temp = analogRead(analog);
Temp = (500.0*Temp)/1023.0;
lectura6=Temp;
delay(tiempo);
promedio=(lectura1+lectura2+lectura3+lectura4+lectura5+lectura6)/6;
if(promedio>25)
{
irsend.sendNEC(0x28480000,32);
Serial.println("Enviando codigo");
Serial.println("Promedio=";
Serial.print(promedio);
}
//---------------------------------------------------------------------------------------------
else if(promedio<25);
{
irsend.sendNEC(0x20480000,32);
Serial.println("Enviando codigo de apagadpo");
Serial.println("Promedio=");
Serial.print(promedio);
}
if (promedio<25) { //After being sensing the temperature for 1 hour
digitalWrite(rele, LOW); }
else { digitalWrite(rele, HIGH);
}