Arduino - BLUETOOTH Voice And Remote Home Control Android

Arduino - BLUETOOTH Voice And Remote Home Control Android © CC BY-SA

Hello world! Today I made a voice control and remote control app combined. In my opinion this is the best one I made.

  • 3,080 views
  • 1 comment
  • 3 respects

Components and supplies

Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
Mcp23008 scr8g5le 10a b%20(1)
ControlEverything.com Relay Shield for Particle Photon I²C 8-Channel SPDT 10-Amp
×1
11026 02
Jumper wires (generic)
×1
Power Cables and Lamp sockets
×1
1434509556 android phone color
Android device
×1
Bluetooth Low Energy (BLE) Module (Generic)
×1

About this project

Hello world! Today I made a voice control and remote control app combined. In my opinion this is the best one I made and I'm going to use it in my home myself, also check out the others apps I made.

I will also put the commands in the tutorial as a text file and in the tutorial itself. You can control your home with Buttons or Voice with this app.

Follow the next steps for the code, app, parts list and schematic. If you want the Source just contact me!

Step 1: Parts list + Android APP

Just connect it as the schematic and everything should work. Also make sure not to have the Bluetooth connected when uploading the code!

DOWNLOAD THE APP ON GOOGLE PLAY

Parts list.

  • Arduino Uno, Any copy will do.
  • Jumper wires set MM/FF/MF
  • Power Cables and Lamp sockets (optional to test relays)
  • Android phone + the APP.

The Commands in english 

  • All on / all off
  • livingroom on / livingroom off
  • kitchen on / kitchen off
  • balcony on / balcony off
  • bathroom on / bathroom off
  • bedroom on / bedroom off
  • attic on / attic off
  • barn on / barn off
  • closet on / closet off

To change baudrate, name and pin of your Bluetooth device follow step 2. (optional)

Step 2: How to change the name of your HC-06

What is needed?

How to connect the Programmer?

  • VCC to VCC
  • GND to GND
  • RXD to TX
  • TXD to RX

Lets get started...

  • Connect the USB TTL programmer to the HC-06
  • Plug in the USB and open up The Arduino IDE
  • Open the serial monitor.
  • Type "AT" without quotes. You should see a respond in the Serial monitor saying "OK"
  • Type "AT+NAMExyz" Sets the module name to “xyz” (Replace xyz with the name you want.) response should be OKsetname.
  • Type "AT+PIN1234" Set the pin to 1234 (replace 1234 with your desired pin) respond should be OKsetPIN. For more info on changing baudrate etc. I included a PDF file. Good luck!

Code

BLUETOOTH_voice_home_control_2.0.inoArduino
This code is written for my home voice control app.
The app simply reads the bytes @ case, 1,2,3,etc.
You can control 8 relays trough your phone with this.
You can add any device you want to the relays.
/*
Author: Danny van den Brande. Arduinosensors.nl. BlueCore Tech.
This code is written for my home voice control app.
The app simply reads the bytes @ case, 1,2,3,etc.
You can control 8 relays trough your phone with this.
You can add any device you want to the relays.
 */
int relay1 = 2;
int relay2 = 3;
int relay3 = 4;
int relay4 = 5;
int relay5 = 6;
int relay6 = 7;
int relay7 = 8;
int relay8 = 9;     
  byte serialA;
void setup()
{
  
  Serial.begin(9600); //Check step 2 of my instructable on how to change your HC-06 modules name and baudrate.
  //my HC-06 has a baudrate set of 9600. Your can be different. But you can change it.
  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() {

if (Serial.available() > 0) {serialA = Serial.read();Serial.println(serialA);}
/*
below are the commands 
 all on / all off
 livingroom on / livingroom off
 kitchen on / kitchen off
 balcony on / balcony off
 bathroom on / bathroom off
 bedroom on / bedroom off
 attic on / attic off
 barn on / barn off
 closet on / closet off
*/   
      switch (serialA) {
    case 1:
      digitalWrite(relay1, HIGH);//livingroom on
      break;
    case 2:
      digitalWrite(relay1, LOW);//livingroom off
      break;
      //
    case 3:
      digitalWrite(relay2, HIGH);//kitchen on
      break;
    case 4:
      digitalWrite(relay2, LOW);//kitchen off
      break;
      //
    case 5:
      digitalWrite(relay3, HIGH);//balcony on
      break;
    case 6:
      digitalWrite(relay3, LOW);//balcony off
      break;
      //
    case 7:
      digitalWrite(relay4, HIGH);//bathroom on
      break;
    case 8:
      digitalWrite(relay4, LOW);//bathroom off
      break;
      //
    case 9:
      digitalWrite(relay5, HIGH);//bedroom on
      break;
    case 10:
      digitalWrite(relay5, LOW);//bedroom off
      break;
      //
    case 11:
      digitalWrite(relay6, HIGH);//attic on
      break;
    case 12:
      digitalWrite(relay6, LOW);//attic off
      break;
      //
    case 13:
      digitalWrite(relay7, HIGH);//barn on
      break;
    case 14:
      digitalWrite(relay7, LOW);//barn off
      break;
      //
    case 15:
      digitalWrite(relay8, HIGH);//closet on
      break;
    case 16:
      digitalWrite(relay8, LOW);//closet off
      break;
      //        
    case 17:
      delay(100);//everything 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);
      delay(100);
    break;
    case 18://everything 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); 
     default:

      break;
  }

}

Schematics

schematic
Bluetooth%20voice%20%26%20remote%20home%20control bb

Comments

Similar projects you might like

Control LED Using Your Voice Command

by IoTBoys

  • 50,345 views
  • 4 comments
  • 36 respects

Arduino/Android - BLUETOOTH Multi Servo Motor Control

Project tutorial by Danny van den Brande

  • 31,893 views
  • 13 comments
  • 48 respects

Bluetooth Smart phone control with remote arduino

Project tutorial by DFRobot

  • 7,783 views
  • 2 comments
  • 14 respects
Add projectSign up / Login