Arduino BLUETOOTH Home control android

Arduino BLUETOOTH Home control.

Hello world! Today i made a Android APP to control 8 relays with arduino using the HC-06 Bluetooth module.
The video just shows 2, but i changed the app!
You can control 8 lights or devices with it.
Just contact me for the open source code of the APP.
DOWNLOAD THE APP ON GOOGLE PLAY! (english version only)

Arduino BLUETOOTH Home control, google-play

Schematic:
arduino home control android, Arduino BLUETOOTH Home control

Parts list:
Arduino Uno, I used the RobotDyn uno a very good copy with 7 analog pins.
2 x 1 channel Relay KY-019 (You can add more if you buy the open source app)
HC-06 Bluetooth Module.
Jumper wires set MM/FF/MF
Power cables + lamp sockets (optional, you can add any device instead of lamps)

Code:

/*
Arduino BLUETOOTH Home control.
Author: Danny van den Brande, Arduinosensors.nl. BlueCore Tech.
This code will work with the app i created for it to control relays.
You can build a home automation system with it, or control other devices. 
I build it originaly for home control.
If you want the Code for the APP open source You can contact me @ contact@arduinosensors.nl
 */
int relay1 = 2;
int relay2 = 3;
int relay3 = 4;
int relay4 = 5;
int relay5 = 6;
int relay6 = 7;
int relay7 = 8;
int relay8 = 9;

String readString;

void setup() {
  Serial.begin(9600);
  pinMode(relay1, OUTPUT); 
  pinMode(relay2, OUTPUT); 
  pinMode(relay3, OUTPUT); 
  pinMode(relay4, OUTPUT); 
  pinMode(relay5, OUTPUT); 
  pinMode(relay6, OUTPUT); 
  pinMode(relay7, OUTPUT); 
  pinMode(relay8, OUTPUT); 
}

void loop() {
  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }
  if (readString.length() >0) {
    Serial.println(readString);
    if (readString == "1 ON")     
    {
      digitalWrite(relay1, HIGH);
    }
    if (readString == "1 OFF")
    {
      digitalWrite(relay1, LOW);
    }
    //relay2
    if (readString == "2 ON")     
    {
      digitalWrite(relay2, HIGH);
    }
    if (readString == "2 OFF")
    {
      digitalWrite(relay2, LOW);
    }
    //relay3    
    if (readString == "3 ON")     
    {
      digitalWrite(relay3, HIGH);
    }
    if (readString == "3 OFF")
    {
      digitalWrite(relay3, LOW);
    }
    //relay4    
    if (readString == "4 ON")     
    {
      digitalWrite(relay4, HIGH);
    }
    if (readString == "4 OFF")
    {
      digitalWrite(relay4, LOW);
    }
    //relay5    
    if (readString == "5 ON")     
    {
      digitalWrite(relay5, HIGH);
    }
    if (readString == "5 OFF")
    {
      digitalWrite(relay5, LOW);
    }
    //relay6    
    if (readString == "6 ON")     
    {
      digitalWrite(relay6, HIGH);
    }
    if (readString == "6 OFF")
    {
      digitalWrite(relay6, LOW);
    }
    //relay7    
    if (readString == "7 ON")     
    {
      digitalWrite(relay7, HIGH);
    }
    if (readString == "7 OFF")
    {
      digitalWrite(relay7, LOW);
    }
    //relay8    
    if (readString == "8 ON")     
    {
      digitalWrite(relay8, HIGH);
    }
    if (readString == "8 OFF")
    {
      digitalWrite(relay8, LOW);
    }
    //All on / off    
    if (readString == "ALL ON")     
    {
      digitalWrite(relay1, HIGH);
      digitalWrite(relay2, HIGH);
      digitalWrite(relay3, HIGH);
      digitalWrite(relay4, HIGH);
      digitalWrite(relay5, HIGH);
      digitalWrite(relay6, HIGH);
      digitalWrite(relay7, HIGH);
      digitalWrite(relay8, HIGH);
    }
    if (readString == "ALL OFF")
    {
      digitalWrite(relay1, LOW);
      digitalWrite(relay2, LOW);
      digitalWrite(relay3, LOW);
      digitalWrite(relay4, LOW);
      digitalWrite(relay5, LOW);
      digitalWrite(relay6, LOW);
      digitalWrite(relay7, LOW);
      digitalWrite(relay8, LOW);
    }
    //next
    readString="";
  } 
}

Good luck building your Arduino BLUETOOTH Home control android.

Danny van den Brande

http://www.arduinosensors.nl

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

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