Arduino - Home Control With Bluetooth And Voice

Arduino - Home Control With Bluetooth And Voice © CC BY-SA

Simple Home control device using Bluetooth and Android.

  • 1,340 views
  • 5 comments
  • 3 respects

Components and supplies

About this project

Hello world! Today I made a home control device with 2 relays and a Bluetooth module to use it as a voice control system. You can use this app to control it-> (CLICK HERE FOR THE APP). You can set any word in the code as long as the language of your phone recognizes it. Follow the next steps for the code schematic and Parts list.

Step 1: Parts list.

Parts List.

(NOTE: the schematic show the relays connected to 3.3v these should be connected to 5v, Only the HC-06 needs to be connected to 3.3v)

Also make sure not to have the Bluetooth connected when uploading the code!

  • Arduino Uno.
  • HC-06 Bluetooth Module. (You can also use the HC-05)
  • Jumper wires set MM/FF/MF
  • Lamp socket + Power cable (Optional)

Good luck!

(Follow the next step to find out how to rename your HC-06). You do not need to rename your device! So you can skip next step if you want.

Step 2: How to rename 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.inoArduino
Voice control for 2 relays. You can add more relays if needed.
This code only controls 2 lamps or devices.
/*
Author: Danny van den Brande, ArduinoSensors.nl, BlueCore Tech.
Voice control for 2 relays. You can add more relays if needed.
This code only controls 2 lamps or devices. Just copy/paste the "COPY/PASTE SECTION" that i made.
 */

String voice;

#define relay1 2    
#define relay2 3 // You can add more relays if needed like this.
//#define relay3 4 // Just uncomment these lines to use more relays 
//#define relay4 5 // i set up 3 extra for you.  

void setup()
{
  Serial.begin(9600);            
  pinMode(relay1, OUTPUT);  
  pinMode(relay2, OUTPUT);//uncomment these lines when using more relays.
//  pinMode(relay3, OUTPUT);
//  pinMode(relay4, OUTPUT);     
}
void loop()
{
  while(Serial.available())   
  {
    delay(10);                 
    char c = Serial.read();   
    if (c == '#'){
      break;                   
    }
    voice += c;                //Means voice = voice + c
  }
    if (voice.length() >0)
    {
      Serial.println(voice); 
      if(voice == "*all on"){ //dont remove the *
        digitalWrite(relay1, HIGH);// This will turn on everything.
        digitalWrite(relay2, HIGH);
//        digitalWrite(relay3, HIGH);
//        digitalWrite(relay4, HIGH);
      }               
      else if(voice == "*all off"){// This will turn off everything.
        digitalWrite(relay1, LOW);
        digitalWrite(relay2, LOW);
//        digitalWrite(relay3, LOW);
//        digitalWrite(relay4, LOW);
      }               
      else if(voice == "*livingroom on"){ //you can fill in whatever you want.
        digitalWrite(relay1, HIGH);
      }
      else if(voice == "*livingroom off"){
        digitalWrite(relay1, LOW);
      }
      // COPY/PASTE SECTION BEGIN
      else if(voice == "*kitchen on"){    //paste from here to add more relays.
        digitalWrite(relay2, HIGH);
      }
      else if(voice == "*kitchen off"){
        digitalWrite(relay2, LOW);
      }                                   //Paste to here to add more relays.
      // COPY/PASTE SECTION END

      voice="";
    }
}

Schematics

Schematic
Bluetooth%20voice%20home%20control bb

Comments

Similar projects you might like

Voice Control Bluetooth TV Remote

Project in progress by pravin desai

  • 4,172 views
  • 1 comment
  • 7 respects

Control LED Using Your Voice Command

by Team IoTBoys

  • 50,361 views
  • 4 comments
  • 36 respects

Control Christmas Lights with Voice Commands using Arduino

Project tutorial by ahmed ismail

  • 4,347 views
  • 2 comments
  • 15 respects

Arduino/Android - BLUETOOTH Multi Servo Motor Control

Project tutorial by Danny van den Brande

  • 31,890 views
  • 13 comments
  • 48 respects
Add projectSign up / Login