Overview
In this project, we will learn how to make Voice Controlled Robot Car Using Arduino. The robotic car can be controlled wirelessly via voice commands directly from the user. The robot can move forward, backward, left, and right and can also be stopped.
The Arduino voice-controlled robot car is interfaced with a Bluetooth module HC-05 or HC-06. We can give specific voice commands to the robot through an Android app installed on the phone. At the receiving side, a Bluetooth transceiver module receives the commands and forwards them to the Arduino and thus the robotic car is controlled.
Previously we made some other robotic projects. You can check a few of them below:
1. Wireless Bluetooth Controlled Robot using Arduino
2. Wireless Gesture Controlled Robot Car Using Arduino
3. WiFi Controlled Robot using ESP8266
4. Make an Automatic Grass Cutting Robot using Arduino
Bill of Materials
The components required for these projects are given below. All these components can be purchased from the Amazon Link.
S.N. | Components Name | Quantity | Purchase Links |
---|---|---|---|
1 | Arduino UNO Board | 1 | Amazon | AliExpress |
2 | HC-05 Bluetooth Module | 1 | Amazon | AliExpress |
3 | DC Motors 9V | 2 | Amazon | AliExpress |
4 | 9V Battery | 1 | Amazon | AliExpress |
5 | Motor Driver IC L293D | 1 | Amazon | AliExpress |
6 | Robot Chasis & Wheels | 1 | Amazon | AliExpress |
7 | Connecting Wires | 10-20 | Amazon | AliExpress |
8 | Breadboard | 1 | Amazon | AliExpress |
Block Diagram
The block diagram of Arduino Wireless Voice Controlled Robot is given below.
The Arduino Wireless Voice Controlled Robot consists of a transmitter and a receiver section. The transmitter end consists of Smartphone Bluetooth and the Android app installed on it. Similarly, the Receiver section has Arduino board as a processor, HC-05 Bluetooth Module as a wireless communication module, L293D for driving motors, and a pair of DC geared as a part for moving robot.
Circuit Diagram & Connections
The circuit consists of Arduino UNO Board, HC-05/HC-06 Bluetooth Module, L293D Motor Driver IC, a pair of DC Geared Motors of 200 RPM and a 9V Battery.
The TX, RX pins of Arduino is connected to Rx, Tx pins of Bluetooth Module. The Bluetooth Module is supplied with 5V. Similarly, left DC motor is connected to pin no 3 & 6 of L293D and right DC motor to pin no 14 & 11 of L293D. Arduino digital pins 2,3,4,5 is connected to L293D 2, 7, 10, 15 respectively.
The L293D IC Pins 2, 5, 12, 13 is GND pins, and 9, 1, 16 is supplied with 5V. But pin 8 of L293D is directly supplied with 9V.
The Android App
The screenshot of the Android App is given below. Android smartphone with an app is the transmitter end. The Android speech-recognition app used here was developed using MIT App Inventor.
Initially, there needs to be pairing of Bluetooth HC-05/HC-06. Once pairing is done, then it needs to be connected. When the app is running in the smartphone, the user’s voice commands are detected by the phone microphone.
Download the Android App from here: Download
Commands are processed, and speech-to-text conversion is done within the app using Google’s speech-recognition technology. Text is then sent to the receiver side via Bluetooth.
Working of the Project
As mentioned above Voice Commands are processed by phone, and speech-to-text conversion is done within the app using Google’s speech-recognition technology. The text is then sent to the receiver side via Bluetooth. Text received via Bluetooth is forwarded to the Arduino Uno board using UART serial communication protocol. Arduino code checks the text received. Whenever the text is a matching string, Arduino controls the movements of the robot accordingly in forwarding, backward, Turning Right, Turning Left & Stop.
Signal logic levels at the different stages of the circuits for proper controlling of the robotic car are given below.
Source Code/Program
The source code/Program for Arduino Voice Controlled Robot is given below. Copy this code and upload it to the Arduino Board.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
String readvoice; int k=0; void setup() { Serial.begin(9600); pinMode(2,OUTPUT); pinMode(3,OUTPUT); pinMode(4,OUTPUT); pinMode(5,OUTPUT); } void loop() { while (Serial.available()) { delay(3); char c = Serial.read(); readvoice += c; } if(readvoice.length() > 0) { Serial.println(readvoice); if(readvoice == "forward") { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); k=1; } if(readvoice == "backward") { digitalWrite(2, LOW); digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(5, HIGH); k=2; } if(readvoice == "left") { if (k==2) { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); delay(1000); digitalWrite(2, LOW); digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(5, HIGH); } else { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); delay(1000); digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); } } if(readvoice == "right") { if (k==2) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(1000); digitalWrite(2, LOW); digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(5, HIGH); } else { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(1000); digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(5, LOW); } } if(readvoice == "stop") { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); } } readvoice=""; } |
16 Comments
I completed all the connection according to your diagram but unfortunately one of the wheel is not moving resulting the car moving in circular motion. can you please tell me what might be the problem.
In video and materials required, there are only two motors. But in code, 4 motors are mentioned. Why ?
Only 2 motor needed. In the code each motor will go forward and backward making 2 direction for each motor.
Your project is very helpful. Thank you very much. I have doctoral degree and I am preparing Arduino booklet which includes some Arduino projects for teachers. These teachers are working in the government schools. My booklet is not a commercial material. Teachers can help from my booklet and can help students to make Arduino projects in government schools.
Can i use that project and pictures (similar pictures more than one) in my booklet? Is there a copyright problem? I will show and cite your page in the references section.
Thanks for your help.
Best regards.
Of course you can use. But attach the reference link.
Thank you very much. I cited your project adress. Cong! and thanks.
sir my code is not working its shows ererreor at readvoice >
Hello im getting an error on the code gt was not declared in this scope
im also getting the same error
Code Error Solved:
String readvoice;
int k=0;
void setup() {
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}
void loop() {
while (Serial.available())
{
delay(3);
char c = Serial.read();
readvoice += c;
}
if(readvoice.length() >0)
{
Serial.println(readvoice);
if(readvoice == “forward”)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
k=1;
}
if(readvoice == “backward”)
{
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
k=2;
}
if(readvoice == “left”)
{
if (k==2)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
}
else
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
}
if(readvoice == “right”)
{
if (k==2)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
}
else
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
}
if(readvoice == “stop”)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}
readvoice=””;
}
Please Subscribe My channel And Support Me https://www.youtube.com/channel/UCa-GTOHtQFAd-40NGJOtOkg
can you check the connection of one wheel
can you please share the image of the breadboard connection
Can u ple send me the breadboard connection because i cant abe to make with direct connection and with direct connection it is not working so please send me the breadboard connection
i connected everything as in the video it is switched on and bluetooth is connected but when we give the command its not moving what we need to do
App is not working on my mobile
when i start command move forward that time the smartphone show like this “move forward is unrecognized command try again or check your connection i connected correctly but comes like this so please give the solution sir