Ac Fan ON OFF Timer
1399 6
mani

Ac Fan ON OFF Timer

In these busy lives, sleep is important to get ready for the next day. And it was irritating in the...

Description:-

In these busy lives, sleep is important to get ready for the next day. And it was irritating in the middle of the night to wake due to heat and it was more irritating to get up during sleep, put off the AC, and put ON the fan to overcome the heat. So the automatic ac-fan timer does the job for us while we are in sleep, so we have better sleep at night and brisk during the next day. Every day we put a 4-hour timer on the AC at night. after Ac has OFF we woke and turn ON the fan. So I decided to make a timer that turns off the AC after the desired time and turns on the fan.

Automatic AC Turn On-OFF Timer

AC FAN Turn On-OFF Timer

Project Used Hardware

Arduino pro mini, IR led, single channel relay module, 5v power supply, 1k pot.

Project Used Software

Arduino IDE

Project Hardware Software Selection

SOFTWARE:

Arduino IDE - it's easy to program in, and it has many libraries.

HARDWARE:

Arduino pro mini - used here because it's compact in size and does the job.

1K potentiometer - for adjusting the Timer value.

IR LED - to turn ON and turn OFF the AC. Relay costs almost 400rs but for IR led, the cost is 2rs. It is our choice to use Relay or the IR sensor.

5v Single channel relay - to turn ON or OFF the ceiling fan after turning ON or OFF the AC.

5v power supply - it is sufficient to power the Arduino and other components.

AC Fan Turn ON-OFF System

AC Fan Timer

Circuit Diagram

The idea is a bit complex but not the circuit diagram. Everyone can make it.

AC Fan Timer Circuit Diagram

Code

#include
#include
IRsendRaw mySender;
int pot = A0;
int sensorValue = 0;
int fanrelay = 11
void setup() {
  Serial.begin(9600);
  delay(2000);
  pinMode(fanrelay, OUTPUT);
  pinMode(acrelay, OUTPUT);
  digitalWrite(fanrelay, HIGH);
  digitalWrite(acrelay, LOW);   
}
#define RAW_DATA_LEN 212
uint16_t rawData[RAW_DATA_LEN]={
8964, 4516, 524, 1696, 504, 1716, 528, 572, 524, 572, 528, 568, 528, 572, 524, 1696, 528, 1692, 504, 1716, 528, 1696, 500, 1720, 500, 596, 528, 572, 500, 1720, 512, 584, 528, 1692, 504, 596, 500, 596, 528, 568, 528, 572, 504, 592, 504, 1716, 528, 1696, 500, 1720, 528, 568, 504, 596, 524, 572, 504, 592, 528, 572, 500, 596, 504, 592, 528, 572, 500, 596, 504, 592, 504, 596, 504, 592, 528, 572, 500, 1720, 524, 572, 504, 592, 528, 572, 504, 592, 528, 572, 524, 572, 528, 568, 528, 568, 528, 572, 504, 592, 504, 596, 524, 572, 504, 596, 500, 596, 524, 572, 504, 1716, 528, 572, 500, 596, 524, 572, 504, 596, 500, 596, 504, 592, 528, 572, 500, 596, 524, 572, 528, 572, 524, 572, 500, 596, 528, 572, 552, 544, 504, 592, 528, 572, 524, 572, 500, 600, 500, 596, 500, 596, 528, 572, 524, 572, 500, 596, 504, 596, 500, 596, 524, 572, 528, 572, 500, 596, 500, 596, 528, 572, 500, 596, 504, 592, 528, 572, 524, 572, 524, 1700, 524, 572, 524, 1696, 528, 568, 528, 572, 524, 576, 500, 592, 528, 572, 524, 1696, 524, 1696, 504, 1716, 504, 1720, 524, 572, 504, 592, 504, 596, 552, 1668, 528, 1000};
void loop() {
  sensorValue = analogRead(sensorPin);
  //For testing purpose
  if (sensorvalue == 0 ) {
    // ir data to turn off the AC
    mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
    delay(1000)
  }
  // For 2 houre delay
  elseif (0256){
    for(int i=0;i<=7200;i++){ // 2 hours dealy
    delay(1000);}
    // turn off the AC with ir controller
    mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
    delay(1000)
    digitalWrite(fanrelay, LOW);// turn on the fan
        }       
  // For 4 houre delay
  elseif (256512){
    for(int i=0;i<=14400;i++){ // 4 hours dealy
    delay(1000);}
    // turn off the AC with ir controller
    mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
    delay(1000)
    digitalWrite(fanrelay, LOW);// turn on the fan
}
  // For 6 houre delay
  elseif (sensorvalue<512){
    for(int i=0;i<=21600;i++){ // 6 hours dealy
    delay(1000);}
        // turn off the AC with ir controller
    mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
    delay(1000)
    digitalWrite(fanrelay, LOW);// turn on the fan
    }
}