tusham_agarwalishaan1490mechatronakroid
Published © MIT

Home Automation System

This Home Automation System is design to control the speed of fan to cool the light bulb and perform several different functions.

IntermediateShowcase (no instructions)1,027
Home Automation System

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
JustBoom IR Remote
JustBoom IR Remote
×1
Thermopile IR Sensor, TS105-10L5.5mm
Thermopile IR Sensor, TS105-10L5.5mm
×1
LED Light Bulb, Frosted GLS
LED Light Bulb, Frosted GLS
×1
Geared DC Motor, 12 V
Geared DC Motor, 12 V
×1
Power Relay, SPDT
Power Relay, SPDT
×3

Story

Read more

Schematics

Schematic of project

This is the schematic of our creation of our project " Home Automation System"

Code

Code of project

Arduino
Code
#include <IRremote.h>
#include <LiquidCrystal.h>

const int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int x=0;
int y=0;
int z=0;

void setup() {
  pinMode(12, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  irrecv.enableIRIn();
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("Home Automation");
}

void loop() {
  if (irrecv.decode(&results))
  {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Bulb Fan Speed");
    if(results.value == 0xFD08F7)
    {
      x++;
      if(x%2==1)
      {
        digitalWrite(12, HIGH);
        lcd.setCursor(0,2);
        lcd.print("ON");
      }
      else
      {
        digitalWrite(12, LOW);
        lcd.setCursor(0,2);
        lcd.print("OFF");
      }
    }
      if(results.value == 0xFD8877)
     {
       y++;
       if(y%2==1)
       {
         digitalWrite(9, HIGH);
         lcd.setCursor(5,2);
         lcd.print("ON");
         lcd.setCursor(9,2);
             lcd.print(z);
       }
       else
       {
         digitalWrite(9, LOW);
         lcd.setCursor(5,2);
         lcd.print("OFF");
         lcd.setCursor(9,2);
             lcd.print(z);
       }
     }
       if(results.value == 0xFD807F && z>=0 && z<6)
         {
           z++;
           if(z==1)
           {
             analogWrite(10, 51);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==2)
           {
             analogWrite(10, 102);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==3)
           {
             analogWrite(10, 153);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==4)
           {
             analogWrite(10, 204);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==5)
           {
             analogWrite(10, 255);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
         }
    	if(results.value == 0xFD906F && z>0 && z<=6)
         {
           z--;
           if(z==1)
           {
             analogWrite(10, 51);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==2)
           {
             analogWrite(10, 102);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==3)
           {
             analogWrite(10, 153);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==4)
           {
             analogWrite(10, 204);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
           if(z==5)
           {
             analogWrite(10, 255);
             lcd.setCursor(9,2);
             lcd.print(z);
           }
          if(z==0)
           {
             analogWrite(10, 0);
            lcd.setCursor(9,2);
             lcd.print(z);
           }
         }
    
    Serial.println(results.value, HEX);
    Serial.print(x);
    Serial.print(y);
    Serial.print(z);
    irrecv.resume();
  }
}

Credits

tusham_agarwal

tusham_agarwal

0 projects • 3 followers
ishaan1490mechatron

ishaan1490mechatron

0 projects • 0 followers
akroid

akroid

0 projects • 5 followers

Comments