Simple Home Automation with Bluetooth and Relay

Simple Home Automation with Bluetooth and Relay © CC BY

Combine Arduino with Bluetooth and relay, and control your AC appliance with a smartphone app.

  • 4,371 views
  • 7 comments
  • 27 respects

Components and supplies

About this project

I want to control my room ac appliances with my smartphone so I made this minimal setup which uses HC05 to trigger the relay.

watch the video for tutorial

Code

Untitled fileC/C++
char junk;
String inputString="";

void setup()                    // run once, when the sketch starts
{
 Serial.begin(9600);            // set the baud rate to 9600, same should be of your Serial Monitor
 pinMode(3, OUTPUT);
 pinMode(4, OUTPUT);
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
}

void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char inChar = (char)Serial.read(); //read the input
      inputString += inChar;        //make a string of the characters coming on serial
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    { junk = Serial.read() ; }      
    if(inputString == "A"){      
      digitalWrite(3, HIGH);  
    }else if(inputString == "a"){  
      digitalWrite(3, LOW);
    }else if(inputString == "B"){  
      digitalWrite(4, HIGH);
    }else if(inputString == "b"){  
      digitalWrite(4, LOW);
    }else if(inputString == "C"){  
      digitalWrite(5, HIGH);
    }else if(inputString == "c"){  
      digitalWrite(5, LOW);
    }else if(inputString == "D"){  
      digitalWrite(6, HIGH);
    }else if(inputString == "d"){  
      digitalWrite(6, LOW);
    }
    
    
    inputString = "";
  }
}

Schematics

maxresdefault_(3)_WbtchKWFqP.jpg
connect the relay instead led
Maxresdefault (3) wbtchkwfqp

Comments

Similar projects you might like

Simple Home Automation Using Bluetooth, Android and Arduino

Project tutorial by Prasanth K S

  • 20,946 views
  • 2 comments
  • 18 respects

Bluetooth Based Home Automation

Project tutorial by Team Brink.IO

  • 9,652 views
  • 13 comments
  • 38 respects

Bluetooth Home Automation

Project tutorial by Team TATCO

  • 4,788 views
  • 2 comments
  • 13 respects

Arduino – Bluetooth 12 Channel Relay App

by TayfMavi

  • 1,188 views
  • 0 comments
  • 7 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,290 views
  • 4 comments
  • 34 respects
Add projectSign up / Login