Arduino projectsHome Automation

Arduino Bluetooth Home Automation

Arduino Bluetooth Home Automation

Automation has become the part of our day to day life and it has made our life easier.

Have you ever wondered that how it would be to control you home appliances using Smartphone ?

Then, this project will provide you the easy to follow tutorial on making your imagination a reality.

Automation has become the part of our day to day life and it has made our life easier.

Here, you will learn to automate your home appliances by using smartphone via Bluetooth connectivity. The knowledge gained in this project will benefit you in projects related to the use of Bluetooth module HC-05 and further you will be able to make any automation projects related to industries, Home, School or office.

Project Level: Intermediate

Prerequisite Required: Basics of Arduino, HC-05, Relay and MIT App Inventor (for making your own edition of App).

Warning: This project involve interfacing HIGH VOLTAGE supply, so check connection
twice and seek the help from elder or someone, who have better knowledge of 
handling High Voltage supply.

So, let’s get started!

Components Required:

  • Arduino Uno/Nano/Mega (Amazon/Ebay/Flipkart/AliExpress)
  • Relay Module (Amazon/Ebay/Flipkart/AliExpress)
  • Jumper Wires (Amazon/Ebay/Flipkart/AliExpress)
  • Bluetooth Module HC-05 (Amazon/Ebay/Flipkart/AliExpress)
  • Connecting wire/Switch Board

*Please note: These are affiliate links. I may make a commission if you buy
the components through these links.

I would appreciate your support in this way to help this website!

 

Circuit Schematics:

Arduino Pin Relay Module
6 IN1( Input 1 )
7 IN2( Input 2 )
8 IN3( Input 3 )
9 IN4( Input 4 )
5V Vcc
Gnd Gn
                                                                                     Bluetooth HC-05
3.3v VCC
Gnd Gnd
10 Tx
11 Rx

 

Code Section:

 //This is written by Alok Shaw, author of www.roboshala.com. Anyone one is free to use and modify the code. 
 //  Visit : www.roboshala.com for more info.

#include<SoftwareSerial.h>
SoftwareSerial BT(10,11); // Connect Tx to pin 10 and Rx to pin 11 of HC-05/HC-06
String readData;          // String for storing data send from the Bluetooth device

int Relay1=6;
int Relay2=7;
int Relay3=8;
int Relay4=9;
int val1=0;
int val2=0;
int val3=0;
int val4=0;


void setup()
{
BT.begin(9600);
Serial.begin(9600);
 pinMode(Relay1,OUTPUT);
 pinMode(Relay2,OUTPUT);
 pinMode(Relay3,OUTPUT);
 pinMode(Relay4,OUTPUT);
 digitalWrite(Relay1,HIGH);
 digitalWrite(Relay2,HIGH);
 digitalWrite(Relay3,HIGH);
 digitalWrite(Relay4,HIGH);
}

void loop() 
{
while (BT.available())
  {
    delay(10);
    char c=BT.read();
    readData +=c;
  }
  if(readData.length()>0)
{
      Serial.println(readData);
    
  if (readData=="relay1")  
  {
    val1=digitalRead(Relay1);
    if(val1==0)
    {
      digitalWrite(Relay1,HIGH);
      val1=1;
    }
    else
    {
      digitalWrite(Relay1,LOW);
      val1=0;
    }  
    delay(200);
  }

  
  if (readData=="relay2")  
  {
    val2=digitalRead(Relay2);
    if(val2==0)
    {
      digitalWrite(Relay2,HIGH);
      val2=1;
    }
    else
    {
      digitalWrite(Relay2,LOW);
      val2=0;
    }  
    delay(200);
   }

   
    if (readData=="relay3")  
  {
    val3=digitalRead(Relay3);
    if(val3==0)
    {
      digitalWrite(Relay3,HIGH);
      val3=1;
    }
    else
     {
      digitalWrite(Relay3,LOW);
      val3=0;
     }  
      delay(200);
   }

   
    if (readData=="relay4")  
  {
    val4=digitalRead(Relay4);
    if(val4==0)
    {
      digitalWrite(Relay4,HIGH);
      val4=1;
    }
    else
    {
      digitalWrite(Relay4,LOW);
      val4=0;
    }  
    delay(200);
   }
   readData="";
}   
   
}

Code : Download

Make Your Own version of App :

The app is developed on MIT App Inventor which is an open source and easy to use platform where you can make your own app without having any coding experience. Just you need to arrange the blocks as depicted in the images below.

Layout Design :

Blocks:

Direct App : Download

You can check the other tutorials on Home Automation :

 

Tags
Show More

Related Articles

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close