hIOTron
Created July 14, 2020 © GPL3+

Smart Home Automation Using Arduino

The project describes about how to control home appliances by easily sending data from Android smartphone to Arduino.

Smart Home Automation Using Arduino

Things used in this project

Story

Read more

Code

Run a program

Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.print("**AUTOMATION**");
}

void loop() {
  if (Serial.available() > 0)
  { 
    char c = Serial.read();
    if (c == 'a')
    {
     Serial.print("in a code");
     digitalWrite(10,HIGH);
     digitalWrite(11,LOW);
     Serial.print("10 HIGH");
     lcd.clear();
     lcd.print("**BULB1 ON**");
    }
    
    if(c=='b')
    {
     digitalWrite(11,HIGH);
     digitalWrite(10,LOW);
     Serial.print("11 HIGH");
     lcd.clear();
     lcd.print("**BULB2 ON**");
    }
    
    if(c=='c')
    {
     digitalWrite(10,HIGH);
     digitalWrite(11,HIGH);
     lcd.clear();
     lcd.print("**BULB 1,2 ON**");
    }
    
    if(c=='d')
    {
     digitalWrite(10,LOW);
     digitalWrite(11,LOW);
     lcd.clear();
     lcd.print("**BULB 1,2 OFF**");
    }
  }
}
 

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments