Voice Controlled Lamp Using Arduino and Bluetooth

by rayankiwan63 in Circuits > Arduino

1520 Views, 1 Favorites, 0 Comments

Voice Controlled Lamp Using Arduino and Bluetooth

bluetooth control lamp.png

Ever thought of controlling your home lights by voice. If you are the one who fascinated it as I do, this project might help you do it for real. Voice powered products are already taking over the market and this voice controlled home lights project will enable you you to build one for your own.

We have developed a prototype of this “Voice controlled home lights” project and we are going to share the steps to build it. We are pretty sure that this will help elderly and disabled in home also it will give control of places with difficult reach.

HARDWARE REQUIREMENTS

  1. ARDUINO UNO
  2. RELAY 220V TO 12V
  3. WIRES
  4. LAMP
  5. BLUETOOTH MODULE HC-05
  6. SMART PHONE

SOFTWARE REQUIREMENTS

AMR Voice app

CIRCUIT DIAGRAM

bluetooth control lamp.png

NOTE I WILL USE ONLY ONE RELAY MODULE

VOICE CONTROL LAMP USING BLUETOOTH ,ARDUINO &RELAY #BLUETOOTH #ARDUINO #RELAY #VOICE CONTROL #APP
#include<SoftwareSerial.h>
#define RELAY 4       //initialize digital pin 4 to relay

SoftwareSerial  BT(11, 10); //initialize bluetooth TX and RX to pin11 and pin10 of  
                                                    arduino
String voice;


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

  Serial.begin(9600);


  pinMode(RELAY, OUTPUT);

}

void loop()
{

  while (BT.available())      //Check if there is an available byte to read
  {

    delay(10);              //Delay added to make thing stable

    char c = BT.read();

    if (c == '#')

    {
      break;             //Exit the loop when the # is detected after the word
    }

    voice += c;           //build the string
  }

  if (voice.length() > 0)
  {

    Serial.println(voice);

    
if (voice == "*light on")
    
{
    
  digitalWrite(RELAY, 1); // turn the LIGHT ON
    
}
    
else if (voice == "*light off")
    
{
    
  digitalWrite(RELAY, 0); // turn the LIGHT ON
    
}
    

    
    
voice = "";         //Reset the variable
  
}

}