header ads

Voice Activated Home Automation


The idea of Home Automation is picking up fame as it helps in diminishing human exertion and blunders and consequently expanding the productivity. With the assistance of Home Automation framework, we can control distinctive machines like lights, fans, TV, AC and so on. Moreover, a home robotization framework can likewise give different highlights like security, cautions, crisis frameworks and so forth can be incorporated.

There are numerous sorts of Home Automation Systems like Bluetooth Controlled, Internet Controlled, RF Controlled, Remote Controlled (IR Remote) and so forth. Each sort has its very own favorable circumstances and drawbacks. In this undertaking, we have structured a Voice Activated Home Automation framework, where distinctive machines are constrained by sending a Voice Command.

The Voice Activated Home Automation venture is executed utilizing Arduino UNO, Bluetooth and an advanced cell. Further areas will clarify circuit chart, parts required and working of the undertaking.
Voice Activated Home Automation 1
Voice Activated Home Automation 2
Voice Activated Home Automation 3
Table of Contents

Circuit Diagram

Voice Activated Home Automation CircuitComponents Required

  • Arduino UNO – 1
  • HC – 05 Bluetooth Module – 1
  • Smart Phone or Tablet – 1
  • 2N2222 NPN Transistor – 4
  • 12V Relay – 4
  • 1 KΩ Resistor – 4
  • 1N4007 PN Junction Diode – 4
  • Power Supply
  • Connecting Wires
  • Breadboard (Prototyping Board)
  • App for transmitting voice to Bluetooth

Components Description

Bluetooth HC – 05: For wireless communication, we used Bluetooth Technology and the module used for this is HC – 05. This module can be interfaced using UART protocol with a wide range of programmable baud rates but the default baud rate is 9600 bps. HC – 05 Bluetooth Module can be configured as either master or slave, whereas another module HC – 06 can work only in slave mode.
The following image shows the HC – 05 Bluetooth Module used in this project. In this module, there are pins for VCC (5V), GND, TX and RX.
HC – 05 Bluetooth Module
BT Voice Control for Arduino: This app is developed by SimpleLabsIN for voice based Arduino projects. This Android App will use the phone’s voice recognition feature and will convert the voice commands to text and transfer the string via Bluetooth.
The app can be downloaded from here BT Voice Control for Arduino 
If you are familiar with any other similar app, you can always use that.
Relay Board (4 – Channel): A Relay is used to connect a small current transistor circuit with a large current AC circuit. In this project, we have used a pre-built relay board with 4 – channels.
Relay Board
NOTE: Be cautious when using Relay board with AC Mains Supply.

Circuit Design

We will currently observe the plan of the Voice Activated Home Automation circuit. To start with, we will interface the Bluetooth Module to the Arduino. Since Bluetooth utilizes UART convention, we have to utilize the RX and TX pins of the Arduino. We will utilize "SoftwareSerial" library to characterize our very own RX and TX pins (Pin 2 is RX and Pin 3 is TX).

NOTE: We have forgotten the Bluetooth's RX and Arduino's TX association as it isn't utilized. On the off chance that you face an issue, associate a voltage divider to change over the Arduino TX's 5V flag to Bluetooth RX's 3.3V.

Next, we will interface the transfers to the Arduino. Since we utilized a readymade hand-off board with 4 – channels, we should simply to associate the contributions of the individual transfers to the Arduino. For itemized association like the resistor, transistor, diode and transfer, allude the circuit outline.

NOTE: We didn't interface any heap to the hand-off however you can generally associate some little loads and look at the working. Be additional cautious while utilizing AC Mains with transfer board.

All the fundamental associations are clarified in the circuit graph.

Working of the Project

In this venture, a basic Voice Activated Home Automation framework is planned. Voice directions are utilized to control diverse apparatuses. We will currently observe the working of the undertaking. Every one of the associations are made according to the circuit chart above.

Subsequent to making the important associations, we need to switch on the power supply to the circuit. Presently, we have to combine the Phone's Bluetooth to the HC – 05 Bluetooth Module. Prior to that, we need to introduce the App referenced above in the telephone. The home screen of the application looks something like this.
Screenshot 1
Next step is to connect the phone with the Bluetooth module. For this, choose the option “Connect Robot” and select the appropriate Bluetooth Device. If the devices aren’t paired earlier, we need to pair them now using the Pin of the HC – 05 Bluetooth Module.
Screenshot 2
After successful connection, the devices are ready to transmit data. For that, press the press microphone icon on the app and start giving voice commands.
NOTE: Make sure that the voice recognition feature is enabled on the phone (this is usually associated with Google app).
For example, if we press the microphone icon and say “turn on light”, the app will recognise the command and the transfers it to the Bluetooth Module. Also, the command gets displayed on the screen for our reference.
Screenshot 3
When the string “turn on light” is detected by the app, it will send the string as “*turn on light#”. So, the actual message received by the Bluetooth Module is in the format of “*Message#”. The reason for padding the ‘*’ and ‘#’ at the begging and end of the string is to identify the starting and ending of the message.
We are able to delete the ‘#’ from the string but left out the ‘*’ in order to identify the starting of the string. The received message is compared with some predefined strings and if the message matches with any of them, then corresponding action like turning on or turning off the load happens.
We have used the following commands: “turn on AC”, “turn off AC”, “turn on light”, “turn off light”, “turn on TV”, “turn off TV”, “turn on fan”, “turn off fan”, “turn on all” and “turn off all”.

Code

#include <SoftwareSerial.h>
const int rxPin = 2;
const int txPin = 3;
SoftwareSerial mySerial(rxPin, txPin);
int ac=4;
int light=5;
int fan=6;
int tv=7;
String data;
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
pinMode(ac, OUTPUT);
pinMode(light, OUTPUT);
pinMode(fan, OUTPUT);
pinMode(tv, OUTPUT);
digitalWrite(ac, LOW);
digitalWrite(light, LOW);
digitalWrite(fan, LOW);
digitalWrite(tv, LOW);
}
void loop()
{
int i=0;
char ch=0;
data="";
while(1)
{
while(mySerial.available()<=0);
ch = mySerial.read();
if(ch=='#')
break;
data+=ch;
}
Serial.println(data);
if(data=="*turn on AC")
{
digitalWrite(ac,HIGH);
Serial.println("ac on");
}
else if(data=="*turn off AC")
{
digitalWrite(ac,LOW);
Serial.println("ac off");
}
else if(data=="*turn on light")
{
digitalWrite(light,HIGH);
Serial.println("light on");
}
else if(data=="*turn off light")
{
digitalWrite(light,LOW);
Serial.println("light off");
}
else if(data=="*turn on fan")
{
digitalWrite(fan,HIGH);
Serial.println("fan on");
}
else if(data=="*turn off fan")
{
digitalWrite(fan,LOW);
Serial.println("fan off");
}
else if(data=="*turn on TV")
{
digitalWrite(tv,HIGH);
Serial.println("tv on");
}
else if(data=="*turn on TV")
{
digitalWrite(tv,LOW);
Serial.println("tv off");
}
else if(data=="*turn on all")
{
digitalWrite(ac,HIGH);
digitalWrite(light,HIGH);
digitalWrite(fan,HIGH);
digitalWrite(tv,HIGH);
Serial.println("all on");
}
else if(data=="*turn off all")
{
digitalWrite(ac,LOW);
digitalWrite(light,LOW);
digitalWrite(fan,LOW);
digitalWrite(tv,LOW);
Serial.println("all off");
}
}

Applications

  • The Voice Activated Home Automation system will help us control different loads (electrical appliances) with simple voice commands.
  • This kind of system is very useful for people with disabilities.
  • Further, the project can be expanded by adding different sensors (light, smoke, etc.).

Construction and Output Video

 

Post a Comment

0 Comments