Introduction: The Complete Home Automation System

Fit it inside your switch board and your home turn automatic..
Just need to have an android mobile to in your hand...
So lets be a bit lazy...

Step 1: Requirments

1. An Arduino Board( I used an Arduino UNO)
2. A hc-05 bluetooth module
3. An LDR
4. An FSR
5. 5 volt relays- 8 in number
6. Connecting wires

Step 2: Circuit Connection

Relay connection: Connect the 5v input of 8 relays to the digital pins 0,1,4,5,6,7,8 and 9 of the UNO board and short the gnd pins and connect them to gnd pin of the board. Give a common input voltage to the relays of 230V 50Hz AC. The output pins of the relays should be connected to the wire from electrical appliances connected to the switches in the switch board. Connect the output pins of relay 0 and 1 to the electrical lamps, 4 and 5 to the fans, 6 to the A.C, 7 to the water pump, 8 to the TV, and 9 to the kitchen chimney.

Bluetooth connection: Connect the Vcc and Gnd of the hc-05 to 5V and Gnd of the UNO board. Now connect the Tx and Rx of the module to digital pins 2 and 3.

Sensor connections: Connect the LDR and FSR to the 5V and then a 1K ohm resistor in series with each one of them, connected to the Gnd. Wires should be connected to the terminal of LDR/FSR with resistor. Wire coming from LDR resistor terminal should go to analog pin A0 and that coming from FSR resistor terminal should go to analog pin A2.


The circuit diagram is given. Including this the UNO board requires to be power using the usb cable or 2.1 channel.

Step 3: Programming

For programming the UNO board you need to have Arduino IDE in your PC.

Copy this sketch on a new ino file, compile it and then upload it to the UNO.






#include

SoftwareSerial b(2,3);//bluetooth pins

int a=1,c=1,e=1,f=1,k=1,l=1,p=1,t=1,/*status of switches*/ks=0,ls=0,ps=0,/*status of sensors*/ldr=1023,/*light intensity to switch on lights*/prs1=0,/*water level to start pump*/prs2=1023/*water level to stop pump*/;

void setup()
{
Serial.begin(9600);
b.begin(9600);//bluetooth
pinMode(0,OUTPUT);//light pins
pinMode(1,OUTPUT);//light pins
for(int i=4; i pinMode(i,OUTPUT);
//analog pins taken as input by default
}
void loop()
{
while(b.available())
{
switch(b.read())
{
case 75://K sent
digitalWrite(0,k);
k=!k;//toggle switch
ks=0;
break;
case 76://L sent
digitalWrite(1,l);
l=!l;//toggle switch
ls=0;
break;
case 69://E sent
digitalWrite(4,e);
e=!e;//toggle switch
break;
case 70://F sent
digitalWrite(5,f);
f=!f;//toggle switch
break;
case 65://A sent
digitalWrite(6,a);
a=!a;//toggle switch
break;
case 80://P sent
digitalWrite(7,p);
p=!p;//toggle switch
ps=0;
break;
case 84://T sent
digitalWrite(8,t);
t=!t;//toggle switch
break;
case 67://C sent
digitalWrite(9,c);
c=!c;//toggle switch
break;
case 107://k sent
ks=1;
break;
case 108://l sent
ls=1;
break;
case 112://p sent
ps=1;
break;
case 73://I sent
ldr=analogRead(A0);//save light intensity to switch on lights
break;
case 87://W sent
prs1=analogRead(A2);//save water level to start pump
break;
case 88://X sent
prs2=analogRead(A2);//save water level to stop pump
break;
}}
if(ks==1)//check sensor status
{
if(analogRead(A0) digitalWrite(0,1);
if(analogRead(A0)>(ldr+25))
digitalWrite(0,0);
}
if(ls==1)//check sensor status
{
if(analogRead(A0) digitalWrite(1,1);
if(analogRead(A0)>(ldr+25))
digitalWrite(1,0);
}
if(ps==1)//check sensor status
{
if(analogRead(A2) digitalWrite(7,1);
if(analogRead(A2)>(prs2))
digitalWrite(7,0);
}
}

Step 4: Placing in Your Room.

Place the board and the bluetooth module inside the switch board with the power wire connected.

The LDR and FSR should be connected with long wires. The LDR should be placed behind the lamp of the room where the lamp's light wont reach since we want it to sense the daylight only. Place the FSR below the water water tank of your room.

Remark: The FSR should be choosen according to the size, volume and weight of your water tank. It should sense more than the total filled up weight of the tank.

Step 5: FINALLY... Using Your Completely Automated Home.

These are the instructions for using the automation features of your completely automated home. For this you need to have an android app called arduino bt installed in your android mobile. You will get it on google play.
Connect the device to the hc-05 device. The pin is usually 1234. Start the application and start sending comands.

(In uppercase)
K to toggle the lamp 1 on/off.
L to toggle the lamp 2 on/off.
E to toggle the fan 1 on/off.
F to toggle the fan 2 on/off.
A to toggle the A.C on/off.
P to toggle the pump on/off.
T to toggle the T.V on/off.
C to toggle the chimney on/off.
I to save the light intensity at which the light should toggle on/off at sensor mode.
W to save the water level at which the pump should start.
X to save the water level at which the pump should stop.

(In lowercase)
k to connect lamp 1 to sensor mode.
l to connect lamp 2 to sensor mode.
p to connect pump to sensor mode.


Remark: Before using sensor mode the system requires the sensor levels to be set once( by sending I, W and X).

Comments

author
nikolin (author)2015-03-18

That's a great job

How i can connect TV into NO contact of the relay?

I mean the wiring connection between TV and relay?

author
TheGreatResistor (author)nikolin2015-10-09

if u need to control a tv then use a solid state relay because it has more tolerance and the normal ones might be dangerous with high loads on to it

author

If you are taking about the power source of TV its very simple. Better if you use a Female socket. In the relay connect live with its source and connect NO to one terminal of the socket. Connect other terminal of socket to neutral. Now you can plug in the TV male plug to the socket.

Now if you are asking about the TV cable connection. You will require 2 or 3 relays.

author
Mr innovative (author)2015-03-02

i need help.

dear simon72post i am building bluetooth remote relay switch same as yours. i am using components as mention below

1) arduino uno.

2) 4 channel, 12vdc relay card.

3) HC-05 Bluetooth module.

4) Arduino bluetooth control device android app

5) jumper wires etc.

How i wired my componnents i have shown in blow pic.

now please can you provide me a sketch so that i can operate relay via my android mobile using Arduino bluetooth control device android app.

i think u understand what i want from you i am a bignner in this arduino world and i found your this post very much closer to my need

and please guied me my friend

please my friend help me you can mail me on sharmaz747@gmail.com

MY CIRCUIT.png
author

This is not an instructable by simpson72post...

author
dipayankarmakar37 (author)2014-10-23

Friends if you like this, please vote for me...:-)

author
AadavV (author)dipayankarmakar372015-01-09

hello boss..
I like your concept. Can i able get exact output for this?

author
dipayankarmakar37 (author)2014-12-09

Still working on it.. Its just a small part...

author
nipun.ahuja.77 (author)2014-12-09

nice project boss,do some innovative add more sensor.

author
dipayankarmakar37 (author)2014-10-24

Just please vote for my project

author
dipayankarmakar37 (author)2014-10-23

I have changed the photo

author
djk1409 (author)2014-10-23

Hello

About This Instructable

7,032views

74favorites

License:

Bio: Imagination is the initiation
More by dipayankarmakar37:The Complete Home Automation System
Add instructable to: