0% found this document useful (0 votes)
10 views

Android home automation using Arduino

Uploaded by

Er Akash Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Android home automation using Arduino

Uploaded by

Er Akash Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Android home automation using Arduino

Hello guys, In this video I will show you how you can make a 4 channel Bluetooth
control home automation with code and apps at home very easily. By using this
you can control your Home Appliances like fan, led lights, CFL bulb, computer,
laptop, sound -system mobile charger etc.. This is very easy & everyone can make
this..

Watch Full Video of this Project

Block Diagram
Let me try to explain the Block Diagram for this project before get in to the
detailed circuit diagram. Our project is mainly having three blocks.

1. Bluetooth Module
2. Arduino UNO
3. Relay Board

Bluetooth Module: The Bluetooth Module block is mainly responsible for


establishing the connection between The Android Smart phone and the Circuit over
Bluetooth Channel. Arduino UNO: This block is the main part of our project which
controls and co-ordinates all the other peripherals that are connected with the
circuit.
Relay Board: Relay board is nothing, it is a Magnetic Switch. We are using a 4
channel relay board for this project to control 4 different Appliances.
ReferFigure1.
Figure 1
Let me explain few things about the Android smart phone as well.
We are using an Android Application Named: Bluetooth Control for
Arduino for this project that can be downloaded from the Google Play store.
This Application will be used to control our Home Appliances. Refer Figure 2
Figure 2

Let's see the working of this project by using the below figure (Figure 3). Arduino
will get ready to receive commands once the Android App successfully paired with
the Circuit over the Bluetooth channel. Once a button is pressed a value will be
sent (E.g.:- "A") by the App and it will be received by the Circuit though the
Bluetooth Module. The value received by the Bluetooth Module will be sent to the
receive port of Arduino. Arduino will check the Value received and it will Control
the Relay according to that. The actual values that I am using for this project is
listed below.
Relay1ison="1"
Relay2ison="2"
Relay3ison="3"
Relay4ison="4"

Relay1isOFF="A"
Relay2isOFF="B"
Relay3isOFF="C"
Relay4isOFF="D"

AllRelayON="9"
All Relay OFF= "I"
Figure3
We are using below components for this project. All these components can be
purchased from third party vendors like Amazon, E-Bay etc.
Figure 4

Below figure (Figure 5) shows the circuit diagram that I have used for this project.
The Digital Pins 10 to 13 are used to control the Relay Board. The Transmit pin of
Bluetooth Module is connected with the receive pin of Arduino.
Our Home Appliances will be connected to the Relay Board
Figure5
The below figure (Figure 6) can be used explain the working of a Relay board. I
took a Single Channel relay board for the simplicity. A relay is having two parts.
INPUTandOUTPUT.Input part is having three pins. The Signal Trigger port is
used to control (ON and OFF Relay). DC- and DC+ are used to provide the
operationalvoltagefortherelay(12VDC).Output part is having three Ports. AC +ve
terminal will be connected to the Common Port. +ve terminal of the Appliance will
be connected to the normally open Port and Next end of the Appliance will be
grounded.The common port will get in touch with the normally opened port when
the Signal Trigger port gets a Digital High Signal (+5 V). So the Load connected to
theRelayboardwillgetpoweredON.Same like the common port will get in touch
with the normally closed port when the Signal Trigger port gets a Digital Low
Signal (GND V). So the Load connected to the Relay board will get powered OFF.
ReferFigure6formoredetails

Figure 6
Below is the code that we are going to use for this project. Upload the sketch to
ArduinoandcompletetheCircuitconnection.

/*
RelayIN1connectedtoPinout10Arduino
RelayIN2connectedtoPinout11Arduino
RelayIN3connectedtoPinout12Arduino
RelayIN4connectedtoPinout13Arduino
--->youcanconnectedtorelaymodule4channel
SerialdatasendingfromArduinoBluetoothRelay4CH.apk
data'1'-'4'toonisRalayCH1-4
data'A'-'D'tooffisRalayCH1-4
data'9'toonALLCH1-4
data'I'tooffALLCH1-4
*/
intrelay1=10;
intrelay2=1
intrelay3=12;
intrelay4=13;
charval;
voidsetup()
{
pinMode(relay1,OUTPUT);
pinMode(relay2,OUTPUT);
pinMode(relay3,OUTPUT);
pinMode(relay4,OUTPUT);
digitalWrite(relay1,HIGH);
digitalWrite(relay2,HIGH);
digitalWrite(relay3,HIGH);
digitalWrite(relay4,HIGH);
Serial.begin(9600);
}
voidloop()
{
//checkdataserialfrombluetoothandroidApp
whileSerial.available()>0)
{
val=Serial.read();
Serial.println(val);
}
//Relayison
if(val=='1')
{
digitalWrite(relay1,HIGH);
}
elseif(val=='2')
{
digitalWrite(relay2,HIGH);
}
elseif(val=='3')
{
digitalWrite(relay3,HIGH);
}
elseif(val=='4')
{
digitalWrite(relay4,HIGH);
}
//relayallon
elseif(val=='9')
{
digitalWrite(relay1,HIGH);
digitalWrite(relay2,HIGH);
digitalWrite(relay3,HIGH);
digitalWrite(relay4,HIGH);
}
//relayisoff
elseif(val=='A')
{
digitalWrite(relay1,LOW);
}
elseif(val=='B')
{
digitalWrite(relay2,LOW);
}
elseif(val=='C')
{
digitalWrite(relay3,LOW);
}
elseif(val=='D')
{
digitalWrite(relay4,LOW);
}
//relayalloff
elseif(val=='I')
{
digitalWrite(relay1,LOW);
digitalWrite(relay2,LOW);
digitalWrite(relay3,LOW);
digitalWrite(relay4,LOW);
}
}

Once everything is OK. You can connect your Home Appliances with the Circuit.
Please watch the below video for more details.

You might also like