Introduction: ARDUINO BASED VOICE ACTIVATED HOME APPLIANCES
ACTIVATING HOME APPLIANCES with voice using bluetooth is a simplest way of making your home "A SMART HOME". In this series of STEPS.we are going to find out how cool is that to switch on the fan by simply sitting in a place.
INTERESTINGLY you can command your ARDUINO like "IRONMAN COMMANDS JARVIS"
i had made a sheild for arduino and bluetooth.ARDUINO is at the back of the board.
Step 1: HARDWARE REQUIRES
COMPONENTS
1) ARDUINO UNO
2) HC05
3) RELAY BOARD
4) ANDROID PHONE
5) JUMPER WIRES
6) LAMP
CONNECTIONS
BLUETOOTH --> ARDUINO UNO
Tx --> (0)Rx
Rx --> (1)Tx
5V --> 5V
GND --> GND
2ND PIN OF ARDUINO --> RELAY’S 1st pin
3RD PIN OF ARDUINO --> RELAY’S 2nd pin
Step 2: Step 2 :SOFTWARE REQUIREMENTS
ARDUINO IDE
BLUETOOTH APPLICATION
This project is done in arduino ide and it’s available in the following link https://www.arduino.cc/en/Main/Software
The Bluetooth application we used is AMR VOICE. This application converts the voice commands we give into text and then it transmits them to the arduino via serial communication. The application can be downloaded by this link https://play.google.com/store/apps/details?id=robotspace.simplelabs.amr_voice&hl=en
Then the same is read by arduino as strings and then it performs the switching function of household items with the help of relay circuit.
Step 3: PROGRAMMING
the simple and easy program to do such a project explained below
// VOICE CONTROLLED HOME AUTOMATION
#define light 2 //CONNECTED TO RELAY 1
#define fan 3 //CONNECTED TO RELAY 2
String voiceString;
String light1="*tesla turn on the lights#";
String light2="*it's too dark tesla#";
String light3="*lights on tesla#";
String light4="*tesla turn off the lights#";
String light5="*turn off the lights#";
String light6="*i dont need lights now#";
String fan1="*tesla please turn on the fan#";
String fan2="*turn on the fan please#";
String fan3="*fans on tesla#";
String fan4="*tesla please turn off the fan#";
String fan5="*turn off the fan tesla#";
String fan6="*tesla i dont need fan right now#"
String FL1="*turn ON everything#";
String FL2="*it's too dark and hot tesla#";
String FL3="*i want fans and light#";
String FL4="*turn off everything tesla#";
String FL5="*no need of fan and light tesla#";
String FL6="*turn off everything tesla#";
String GD="*good night tesla#";
void setup() {
Serial.begin(9600);
pinMode(light,OUTPUT);
pinMode(fan,OUTPUT);
delay(3000);
}
void loop()
{
while (Serial.available())
{
delay(10);
if (Serial.available() >0) {
char c = Serial.read();
voiceString += c;
}
Serial.println(voiceString);
}
if (voiceString.length() >0)
{
if((voiceString.equalsIgnoreCase(light1))||(voiceString.equalsIgnoreCase(light2))||(voiceString.equalsIgnoreCase(light3)))
digitalWrite(light,HIGH);
else if((voiceString.equalsIgnoreCase(light4))||(voiceString.equalsIgnoreCase(light5))||(voiceString.equalsIgnoreCase(light6)))
digitalWrite(light,LOW);
else if((voiceString.equalsIgnoreCase(fan1))||(voiceString.equalsIgnoreCase(fan2))||(voiceString.equalsIgnoreCase(fan3)))
digitalWrite(fan,HIGH);
else if((voiceString.equalsIgnoreCase(fan4))||(voiceString.equalsIgnoreCase(fan5))||(voiceString.equalsIgnoreCase(fan6)))
digitalWrite(fan,LOW);
else if((voiceString.equalsIgnoreCase(FL1))||(voiceString.equalsIgnoreCase(FL2))||(voiceString.equalsIgnoreCase(FL3)))
{
digitalWrite(fan,HIGH);
digitalWrite(light,HIGH);
}
else if((voiceString.equalsIgnoreCase(FL4))||(voiceString.equalsIgnoreCase(FL5))||(voiceString.equalsIgnoreCase(FL6)))
{
digitalWrite(light,LOW);
digitalWrite(fan,LOW);
}
voiceString="";
}
}
Step 4: READY TO GO
Open the app and connect to the Bluetooth module.
If connected THE GREEN/RED LED IN THE HC-05 WILL GLOW ONCE EVERY 3 SECONDS.
Once connecting speak to the arduino with the commands you had set for the lights and fan to be turned on and off.
one of the SMALL DEMO is shown in this VIDEO.