loading

Hey this instructable is about Android - Arduino Connection and Controlling Arduino over Voice and Buttons in Android App, Have Fun Making it and Lets us Know How you did and any Suggestions @ micky.patel41@gmail.com

For our Android App BlueUino in Play Store

https://play.google.com/store/apps/details?id=com.himansh.bluetoothArduino

Step 1: Requirement

Step 2: Connections

Connection as Shown in Image:


Arduino Pin ==> HC-05

Pin-RX (0) Pin ==> TX

Pin- TX (1) Pin ==> RX

GND ==> GND

VCC ==> VCC

Step 3: Coding and Stuff

//Note:- Use only non 0(Zero) Integers as Code <br>
#define Relay1  13
#define Relay2  12
#define Relay3  11
#define Relay4  10
#define Relay5  9
#define Relay6  8
#define Relay7  7
#define Relay8  6

void setup()
{
  Serial.begin(9600);

  digitalWrite(Relay1, LOW);
  digitalWrite(Relay2, LOW);
  digitalWrite(Relay3, LOW);
  digitalWrite(Relay4, LOW);
  digitalWrite(Relay5, LOW);
  digitalWrite(Relay6, LOW);
  digitalWrite(Relay7, LOW);
  digitalWrite(Relay8, LOW);
 
  pinMode(Relay1, OUTPUT);
  pinMode(Relay2, OUTPUT);
  pinMode(Relay3, OUTPUT);
  pinMode(Relay4, OUTPUT);
  pinMode(Relay5, OUTPUT);
  pinMode(Relay6, OUTPUT);
  pinMode(Relay7, OUTPUT);
  pinMode(Relay8, OUTPUT);
 
  Serial.println("Ready!");

}

void loop()
{

  int incomingByte = 0;

  if (Serial.available() > 0) {

     incomingByte = Serial.parseInt();
    //Serial.println(incomingByte); 

    if (incomingByte == 2) {
      digitalWrite(Relay1, HIGH);
      Serial.println("Device 1 ON.");
    }
    if (incomingByte == 1) {
      digitalWrite(Relay1, LOW);
      Serial.println("Device 1 OFF.");
    }
    if (incomingByte == 4) {
      digitalWrite(Relay2, HIGH);
      Serial.println("Device 2 ON.");
    }
    if (incomingByte == 3) {
      digitalWrite(Relay2, LOW);
      Serial.println("Device 2 OFF.");
    }
    if (incomingByte == 6) {
      digitalWrite(Relay3, HIGH);
      Serial.println("Device 3 ON.");
    }
    if (incomingByte == 5) {
      digitalWrite(Relay3, LOW);
      Serial.println("Device 3 OFF.");
    }
    if (incomingByte == 8) {
      digitalWrite(Relay4, HIGH);
      Serial.println("Device 4 ON.");
    }
    if (incomingByte == 7) {
      digitalWrite(Relay4, LOW);
      Serial.println("Device 4 OFF.");
    }
    if (incomingByte == 10) {
      digitalWrite(Relay5, HIGH);
      Serial.println("Device 5 ON.");
    }
    if (incomingByte == 9) {
      digitalWrite(Relay5, LOW);
      Serial.println("Device 5 OFF.");
    }
    if (incomingByte == 12) {
      digitalWrite(Relay6, HIGH);
      Serial.println("Device 6 ON.");
    }
    if (incomingByte == 11) {
      digitalWrite(Relay6, LOW);
      Serial.println("Device 6 OFF.");
    }
    if (incomingByte == 14) {
      digitalWrite(Relay7, HIGH);
      Serial.println("Device 7 ON.");
    }
    if (incomingByte == 13) {
      digitalWrite(Relay7, LOW);
      Serial.println("Device 7 OFF.");
    }
    if (incomingByte == 16) {
      digitalWrite(Relay8, HIGH);
      Serial.println("Device 8 ON.");
    }
    if (incomingByte == 15) {
      digitalWrite(Relay8, LOW);
      Serial.println("Device 8 OFF.");
    }
    
  }
}

Download and Upload this Sketch Code in Arduino Board

Download App BlueUino from Play Store: Download

Start App Pair to Bluetooth HC-05, Default Pair Key Code is 1234

Enjoy Controlling Arduino on Voice and Button

Visit us: http://himansh.com/blueuino-android-bluetooth-remote-for-arduino/

Lets us Know How you did and any Suggestions @ micky.patel41@gmail.com

<p>Nice bluetooth controller project.</p>

About This Instructable

1,003views

8favorites

License:

More by HimanshuP2:Android Arduino Bluetooth HC-05 - Controlling Arduino Over Voice and Buttons in App 
Add instructable to: