Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

VOICE CONTROLLED ROBOT USING ARDUINO

AIM: Robot should be controlled by the given voice commands from


the phone. The voice is transferred from the mobile phone application to
the Bluetooth module connected to the Arduino. Based on the
commands for ex: If we say “10 forward” the robot should move 10
centimetres forward.

COMPONENTS REQUIRED:
1. Arduino UNO with cable
2. Bluetooth HC-05
3. L293D motor driver
4. Two-wheel robot chassis
5. Two dc motors
6. jumper wires
7. mini breadboard
8. 9v battery (power bank)
9. 2 Battery clip connectors (1 connector must be suitable with dc
jack on arduino)
10. Speed sensor with encoder wheel
CIRCUIT DIAGRAM :

Bluetooth Mode Connectios


MOTOR CONNECTIONS
IDEA:

A robot which can be controlled using specific voice commands. Speech


to Text functionality is used to convert voice commands to text which
are then sent to Arduino through Bluetooth communication.

Voice commands have become a primary way to interact with devices


after the development of devices like Alexa and Google Home. Through
this project, control of the robots becomes handy.

The voice commands are perceived using an android application which


converts speech to text. This text is in the form of a string. It is then sent
to Arduino via the Bluetooth module. We accept character by character
from the serial buffer sent by the app and combine them to form a string.
Then the code compares it to the command. If it matches, the command
is carried out. For example, if the string we received is "right", the bot
turns right.
ARDUINO CODE:

int motor_input1=11;
int motor_input2=10;
int motor_input3=5;
int motor_input4=6;
String voice;
void setup()
{
Serial.begin(9600);
pinMode(motor_input1, OUTPUT); //RIGHT MOTOR
pinMode(motor_input2, OUTPUT); //RIGHT MOTOR
pinMode(motor_input3, OUTPUT); //LEFT MOTOR
pinMode(motor_input4, OUTPUT); //LEFT MOTOR
}
void loop()
{
while(Serial.available()>0)
{
delay(10);
char c=Serial.read();
if(c=='#')
{
break;
}
voice+=c;
}
if(voice=="forward"){
digitalWrite(motor_input1, LOW);
digitalWrite(motor_input2, HIGH);
digitalWrite(motor_input3, LOW);
digitalWrite(motor_input4, HIGH);
delay(5000);
}
else
if(voice=="back"){
digitalWrite(motor_input1, HIGH);
digitalWrite(motor_input2, LOW);
digitalWrite(motor_input3, HIGH);
digitalWrite(motor_input4, LOW);
delay(5000);}
else
if(voice=="left"){
digitalWrite(motor_input1, LOW);
digitalWrite(motor_input2, HIGH);
digitalWrite(motor_input3, HIGH);
digitalWrite(motor_input4, LOW);
delay(800);
}
else
if(voice=="right"){
digitalWrite(motor_input1, HIGH);
digitalWrite(motor_input2, LOW);
digitalWrite(motor_input3, LOW);
digitalWrite(motor_input4, HIGH);
delay(800); }
if(voice.length()>0)
{
Serial.println(voice);
voice="";
digitalWrite(motor_input1, LOW);
digitalWrite(motor_input2, LOW);
digitalWrite(motor_input3, LOW);
digitalWrite(motor_input4, LOW);
}
}
RESULT :
The experiment of voice robot movements w.r.t the given commands
has perfomed successfully by using Arduino,Dc motors and Mobile
(Bluetooth) App.

You might also like