Smart Home Automation Using Arduino

Published

Introduction: Smart Home Automation Using Arduino

About: GUYS FOLLOW US AT OUR FB PAGE ..DO LIKE ND SHARE ..OUR YOUTUBE CHANNEL IS S_R TRONICS...WATCH..TRY..INNOVATE..TASTE THE SUCCESS..THANK U..

hello guys..

Nowadays, people have smartphones with them all the time. So it makes sense to use these to control home appliances. Presented here is a home automation system using a simple Android app, which you can use to control electrical appliances with clicks Commands are sent via Bluetooth to Arduino Uno.

Step 1: Components

Step 2: Relay Connecting With Arduino

.It is a simple project and but its also very dangerous ...

because we are going to deal with high voltage 220v . Do not attempt if you are a amateur in dealing with high voltage.

Why to use relay for controlling AC light,fan and other appliances...

AC is alternating current 220v (india) which powers the ac lights,fans,cfl ets.... Arduino cannot control high volt n amp, but a relay can do this job, which is the sole design of it.

so we are using relay as switch to control high power devices.

What is NO NC and COM in relay?

C = Common Connection

NC = Normally Closed Connection

Step 3: Set Up Circuit Using Relay,arduino and Bluetooth

here is connection...

bluetooth is connect to arduino in tx and rx pin...

we have to connect all appliances to relay board.....

one relay board for one lights,then 2nd for CFL,3rd for fan and 4th relay for tubelight....

thats it....

Step 4: Connect App With Bluetooth

this is the screenshot of the app...which is made by mit app inventor..

download the app link description below ..

install it in your phone..and connect it with hc-05 bluetooth module..

..

thats it...

Step 5: Uploading the Code

here the full code..just copy the code and paste in your arduino software...

compile it and the upload to your arduino board..

int L1=12;
int L2=11; int L3=10; int L4=9;

char receive=Serial.read;

int L1_state=0; int L2_state=0; int L3_state=0; int L4_state=0;

void setup() {

Serial.begin(9600);

pinMode(L1,OUTPUT); pinMode(L2,OUTPUT); pinMode(L3,OUTPUT); pinMode(L4,OUTPUT);

}

void loop() {

if(Serial.available()>0){receive = Serial.read();}

if(L1_state==0 && receive =='1') { digitalWrite(L1,HIGH); receive=0; L1_state=1;} if(L1_state==1 && receive =='1') { digitalWrite(L1,LOW); receive=0; L1_state=0;}

if(L2_state==0 && receive =='2') { digitalWrite(L2,HIGH); receive=0; L2_state=1;} if(L2_state==1 && receive =='2') { digitalWrite(L2,LOW); receive=0; L2_state=0;}

if(L3_state==0 && receive =='3') { digitalWrite(L3,HIGH); receive=0; L3_state=1;} if(L3_state==1 && receive =='3') { digitalWrite(L3,LOW); receive=0; L3_state=0;}

if(L4_state==0 && receive =='4') { digitalWrite(L4,HIGH); receive=0; L4_state=1;} if(L4_state==1 && receive =='4') { digitalWrite(L4,LOW); receive=0; L4_state=0;}

///////////////////////////////////////////////////////////voice //////////////////////////

if(L1_state==0 && receive =='') { digitalWrite(L1,HIGH); receive=0; L1_state=1;} if(L1_state==1 && receive =='1') { digitalWrite(L1,LOW); receive=0; L1_state=0;}

if(L2_state==0 && receive =='2') { digitalWrite(L2,HIGH); receive=0; L2_state=1;} if(L2_state==1 && receive =='2') { digitalWrite(L2,LOW); receive=0; L2_state=0;}

if(L3_state==0 && receive =='3') { digitalWrite(L3,HIGH); receive=0; L3_state=1;} if(L3_state==1 && receive =='3') { digitalWrite(L3,LOW); receive=0; L3_state=0;}

if(L4_state==0 && receive =='4') { digitalWrite(L4,HIGH); receive=0; L4_state=1;} if(L4_state==1 && receive =='4') { digitalWrite(L4,LOW); receive=0; L4_state=0;}

if( receive =='5') { digitalWrite(L1,LOW);digitalWrite(L2,LOW);digitalWrite(L3,LOW);digitalWrite(L4,LOW); receive=0; L1_state=0; L2_state=0; L3_state=0; L4_state=0;} }

Step 6: Result

how it works?????...

so this is our video link on you tube.....of our channel s_r tronics..

plz subscribe our channel......and share our projects alsoo..thank you

Share

    Recommendations

    • Oil Contest

      Oil Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Clocks Contest

      Clocks Contest

    Discussions