- This Project is about doing any kind of Automation Using the Bluetooth communication between Android an Arduino.
- All you need is:
- We are going to communicate in Bluetooth , Obviously a Bluetooth HC=05 or HC-06 module is required for this communication. You interface this to your Arduino Board. And then your Arduino will talk in bluetooth to about a maximum range of 5 meters.
- For we are controlling the Arduino using our Android Phones , we need an Android Application that will have buttons for every device you want to control via bluetooth. But I am not going to teach your how to make this Application. So, better open download it from this Play Store link https://play.google.com/store/apps/details?id=apps.BT .
- A Screenshot of this application is give here. You can set names for every device you want to control.
- Now when you 've set name for every button . Then, you have to set a character for every device button which will be sent via Bluetooth to your Arduino. But for this particular Project I want you set them as given below.
- Button1 => 1
- Button2 => 2
- Button3 => 3
- Button4 => 4
- Button5 => 5
- Button6=> 6
- Button7 => 7
- Button8 => 8
- Button9 => 9
- You are the with the Android Part NOW.
- Upload this code to your Arduino.
int room[10]={13,12,11,10,9,8,7,6,5};
int j,k;
void setup()
{
for(int i=0;i<=8;i++)
{
pinMode(room[i],OUTPUT);
digitalWrite(room[i],LOW);
}
Serial.begin(9600);
}
void loop()
{
bluetooth();
}
void bluetooth()
{ if(Serial.available()>0)
{
k=Serial.read();
if(k=='1')
{
toggle();
}
else
if(k=='2')
{
toggle();
}
else
if(k=='3')
{
toggle();
}
else
if(k=='4')
{
toggle();
}
else
if(k=='5')
{
toggle();
}
else
if(k=='6')
{
toggle();
}
else
if(k=='7')
{
toggle();
}
else
if(k=='8')
{
toggle();
}
else
if(k=='9')
{
toggle();
}
}
}
void toggle()
{
j=digitalRead(room[k+1]);
if(j==HIGH)
digitalWrite(room[k+1],LOW);
else
digitalWrite(room[k+1],HIGH);
delay(250);
}
- Now give 5-Volts to the Bluetooth Module and connects its tx pin to rx pin of arduino and vice versa. Picture says it.
- Connect a 5V-Relay to the pin 5,6,7,8,9,10,11,112,13 of Arduino. Picture again says it. Remember this picture is only telling how to use relay shields. You have to use 9 relays for 9 Appliances.
- In the end , you have to connect the relays with your 220/110V AC Appliances. This Picture again tells you how to do it.
- Simply Press the Scan Button in the Android application and it will search for the devices. When the devices are scanned , you then select your Bluetooth Module which is HC_05.
- Then , for building the connection it asks for a password. Press "1234" in that and the connection will be established .
Enjoyyyyyyyy.









awsm,
ReplyDelete