Arduino based Automatic Air Conditioning System

Hi everyone,today I am gonna share a project entitled  Arduino Based Automatic Air Conditioning System.This is the Arduino version of the project "Temperature Controlled Automatic Air Conditioning System" which was done for Minor Project in which I was a part of the team.As the name implies the main purpose of this project is to devise a system whose sole purpose is to condition or maintain the temperature within the predefined limits.Thus,this system proves to be useful to be used as a Air Conditioning System inside room,offices,departmental stores etc.Apart from that,it can also be used in various industrial applications such as to control the temperature in boilers,refrigerator,AC computers and Laboratories etc.
Now lets look at each element of the design turn by turn:
First lets have a glance at flowchart of the system:
Block Diagram:

Above figure  shows the block diagram of the system that we have designed.Basically, it consists of microcontroller  as a central processor of the entire control operation. The temperature sensor gives the analog output voltage based on the temperature of the room.This analog voltage is fed to the A/D converter.The A/D converter then converts the analog input voltage from the temperature sensor into equivalent binary bits.The converted binary data from the A/D converter is applied to microcontroller.The microcontroller reads binary data from A/D converter,convert it to suitable form and performs different operations based on the value of temperature read from A/D converter.
The LCD is used to display the data given by microcontroller.Microcontroller can turn on dc fan through the optocoupler if required.We have used led as prototype model for heater.If appropriate condition is met microcontroller can turn on heater(i.e. LED).
In this system,if the temperature read is in between 20-25 degree celcius,it is considered normal state.In this condition both fan and heater are off but the temperature and status is displayed in LCD.If the temperature of the room is  greater that 25 degree celcius it is considered to be a situation to turn on fan and turn off heater. If the temperature of the room is in between 25-30 degree celcius it is considered as a situation to turn on fan with speed of level one.In this level,appropriate temperature and status is displayed on the LCD. If the temperature of the room is in between 30-35 degree celcius it is considered as a situation to turn on fan with speed of level two.In this level,appropriate temperature and status is displayed on the LCD. If the temperature of the room is greater than 35 degree celcius it is considered as a situation to turn on fan with speed of level three.In this level,appropriate temperature and status is displayed on the LCD. If the temperature of the room is  less that 20 degree celcius it is considered to be a situation to turn on Heater and turn off fan. If the temperature of the room is in between 10-20 it is considered as a situation to turn one heater on with heat of level one.In this level,appropriate temperature and status is displayed on the LCD. If the temperature of the room is in between 0-10 it is considered as a situation to turn two heater  on with heat of level two.In this level,appropriate temperature and status is displayed on the LCD.

Circuit Diagram:




Source Code:
/**********************************************************
Programmer: Bikal Adhikari                                                              *
Designation: Student                                                                        *
Compiled on: Arduino IDE under Windows 8 OS                                *
Project: Arduino Based Automatic Air Conditioning System                  *
***********************************************************/


#include <LiquidCrystal.h>

 int tempr=0;
 int mtrPin=8;
 int htrPin1=9;
 int htrPin2=10;
 int analogpin=3;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  pinMode(mtrPin,OUTPUT);
  pinMode(htrPin1,OUTPUT);
  pinMode(htrPin2,OUTPUT);
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  analogReference(EXTERNAL);
}



void loop() {
 tempr=readTempr();


 while(tempr<=20 && tempr>10) //Heater level 1 logic
  {
    templateHtr(1);
    lcd.setCursor(6,0);
    lcd.print(tempr);
    digitalWrite(mtrPin,HIGH);
    digitalWrite(htrPin1,HIGH);
    digitalWrite(htrPin2,LOW);
    
    tempr=readTempr();
     }
  while(tempr>=0 && tempr<=10) //Heater level 2 logic
  {
    templateHtr(2);
    lcd.setCursor(7,0);
    lcd.print(tempr);
    digitalWrite(mtrPin,HIGH);
    digitalWrite(htrPin1,HIGH);
    digitalWrite(htrPin2,HIGH);
    tempr=readTempr();
   }
   while(tempr>20 && tempr<=25)  //Normal state logic
    {
    digitalWrite(mtrPin,HIGH);
    templateNorm();
    lcd.setCursor(6,0);
    lcd.print(tempr);
    tempr=readTempr();
     }
  
   while(tempr>25 && tempr<=30)//fan level one logic
    {
    turnhtrOff();
    templateFan(1);
    lcd.setCursor(6,0);
    lcd.print(tempr);
    digitalWrite(mtrPin,LOW);
    delay(25);
    digitalWrite(mtrPin,HIGH);
    delay(75);
    tempr=readTempr();
    }

  while(tempr>30 && tempr<=35) //fan level two logic
  {
    turnhtrOff();
    templateFan(2);
    lcd.setCursor(6,0);
    lcd.print(tempr);
    digitalWrite(mtrPin,LOW);
    delay(50);
    digitalWrite(mtrPin,HIGH);
    delay(50);
    tempr=readTempr();
   }

   while(tempr>35)   //fan level 3 logic
  {
    turnhtrOff();
    templateFan(3);
    lcd.setCursor(6,0);
    lcd.print(tempr);
    digitalWrite(mtrPin,LOW);
    tempr=readTempr();
   }
}//loop closed


int readTempr() //reads temperature 
{
  
 tempr=analogRead(analogpin);
 tempr=tempr*0.48828125;
 return tempr;

}

void templateFan(int a)
{
  lcd.setCursor(0,0);
  lcd.print("TEMPR:");
  delay(50);
  lcd.setCursor(8,0);
  lcd.print("C");
  delay(50);
  lcd.setCursor(10,0);
  lcd.print("FAN ON");
  delay(50);
  lcd.setCursor(0,1);
  lcd.print("Speed: Level");
  lcd.print(a);
  lcd.print("   ");
  delay(50);
}


void templateNorm()
{
  lcd.setCursor(0,0);
  lcd.print("TEMPR:");
  delay(50);
  lcd.setCursor(8,0);
  lcd.print("C");
  delay(50);
  lcd.setCursor(10,0);
  lcd.print("NORM  ");
  delay(50);
  lcd.setCursor(0,1);
  lcd.print("MTR,HTR OFF     ");
  delay(50);
}


void templateHtr(int b)
{
  lcd.setCursor(0,0);
  lcd.print("TEMPR:");
  delay(50);
  if(b==2)
  {
    lcd.print(" ");
  lcd.setCursor(7,0);
  lcd.print(tempr);
  lcd.print("C ");
  }
 if(b==1)
 {
  lcd.setCursor(6,0); 
  lcd.print(tempr);
  lcd.setCursor(8,0);
  lcd.print("C ");
 }
  delay(50);
  lcd.setCursor(10,0);
  lcd.print("HTR ON");
  delay(50);
  lcd.setCursor(0,1);
  lcd.print("Heating: Level");
  lcd.print(b);
  lcd.print(" ");
  delay(50);
}


void turnhtrOff()
{
  digitalWrite(htrPin1,LOW);
  digitalWrite(htrPin2,LOW);
}




The arduino IDE's .ino source file, proteus isis files and .jpg files can be downloaded in the form of a single .rar archive by clicking here.

Be sure that you have done following:
i. Installed Arduino IDE
ii.Proteus ISIS
Also in order to run simulation in proteus:
i.Download the Arduino library for proteus.
ii. You must copy the location of hex file from Arduino IDE into the proteus model. 

2 comments:

  1. why bother thinking hard about it? Koreans have no urgent reason to debate what the precise cause of Fan Death is.
    ac troubleshooting

    ReplyDelete
  2. A radiative cooling technology could help cut energy consumption in new buildings by nearly 70 percent—and significantly shave demand in existing structures, too.central air conditioner cost

    ReplyDelete