Introduction: How to Control Any Arduino Projects Using Voice Recognition

Picture of How to Control Any Arduino Projects Using Voice Recognition

This Arduino project utilizes a speech recognition app developed by the author to control any appliances in your house using your voice. In this example, the app turns On and OFF a couple of leds using your voice. To turn on the RED light, just say "ON". To turn on the blue light, say "BLUE". To turn off the leds, say "OFF". To blink the red led, say "BLINK". All these LEDs can be replaced by real home appliances like your television, refrigerator, dining lights and more. Therefore, the app can be used for home automation as well.

Step 1: Gather All Your Components

Picture of Gather All Your Components

The following components needed for this project:

1 red led

1 blue led

arduino uno R3

android phone or tablet

bluetooth HC-05

iHackrobot voice recognition app (free upon request)

connecting wires

Step 2: Voice Recognition Sketch

Picture of Voice Recognition Sketch

#include // include softwareserial h-library

SoftwareSerial BTserial(2, 3); // RX | TX

int ledPin = 12;
String vox;
int x=10;
int var=0;

void setup()
{
pinMode(ledPin, OUTPUT);
BTserial.begin(9600);
// Serial.begin(9600);
// BTserial.println("Speech Recognition");
}

void loop()
{
while (BTserial.available())
{
delay(x);
char c = BTserial.read();
vox += c;
}
if (vox.length() > 0) {

if(vox== "on")
{
digitalWrite(ledPin , HIGH);
}

if(vox== "off")
{
digitalWrite(ledPin , LOW);
}
vox=""; // variable reset
}
}

Step 3: The Final Arduino Voice Control Project

CHALLENGE:

1. Write a sketch that will blink the RED Led when you say the command "BLINK".

2. Step up your programming and building skills by controlling your home appliances.

3. When you are done please share your project on this site or post it on my website.

If you can't figure it out, you may send me an email.

Thank you for subscribing on my channel.

Comments

About This Instructable

165views

9favorites

License:

Bio: Thinker and Tinker ;)
More by iHackRobot:How to Control Any Arduino Projects Using Voice Recognition10 Basic Arduino ProjectsArduino Robot controlled by Android Phone App
Add instructable to: