Voice Controlled Robot Car
Voice Controlled Robot Car
Submitted By
1
2
SHRI MATA VAISHNO DEVI UNIVERSITY
School of Electronics and Communication Engineering
STUDENT DECLARATION
I hereby declare that the work which is presented in the B. Tech Mini Project Report entitled
“Voice Controlled Robot Car”, in the partial fulfilment of the requirements for the award of
the degree of Bachelor of Technology in Electronics & Communication Engineering and
submitted to the School of Electronics & Communication Engineering, Shri Mata Vaishno
Devi University, Katra, J&K is an authentic record of our own work which has carried out
during a period from December, 2020 to June, 2021 under the guidance of Dr. Sachin Kumar
Gupta. The matter presented in this report has not been submitted elsewhere by us for the
award of any other degree.
(17BEC043) (17BEC002)
Rakshit Abrol
(17BEC044)
2
SHRI MATA VAISHNO DEVI UNIVERSITY
School of Electronics and Communication Engineering
CERTIFICATE
This is to be certified that the mini project entitled “Voice Controlled Robot Car” being
submitted by Rajeev Kumar (17BEC043), Abhinandan Joshi (17BEC002), Rakshit Abrol
(17BEC044), to the School of Electronics and Communication Engineering is completed
under the supervision and guidance of the Dr. Manish Sabraj. The report has reached the
standard of fulfilling of requirement of the regulation related to degree.
(Signature of Students)
3
ACKNOWLEDGEMENT
I would like to express my profound gratitude and thanks to my project guide Dr. Manish Sabraj,
Department of Electronics and Communication Engineering, Shri Mata Vaishno Devi University,
for introducing the present topic and intellectual support, inspiring guidance and his invaluable
encouragement, suggestions and cooperation helps a lot to completion of my project work
successfully. I am also thankful to Dr. Kumud Ranjan Jha, Head of Department, Electronics and
Communication Engineering, Shri Mata Vaishno Devi University, for providing necessary
information and guidance regarding the project. Last but not least, I would like to thank Shri Mata
Vaishno Devi University for providing me this wonderful opportunity and all my friends for their
kind co-operation which helps me to complete my project.
Rakshit Abrol
(17BEC044)
4
ABSTRACT
In this final report I will mention about my project. My project is Voice Controlled Robot Car. In
this project my aim is to control a Robot car with my speech. I am going to use a mobile to take my
voice and simply process it with a google play app and send result values to the wireless controlled
car that I made. I want to understand how to make speech recognition program and sending this
program result to a car wirelessly and real time.
5
Contents
TITLE……………………………………………………………………………………………...
STUDENT DECLARATION.........................................................................................................2
CERTIFICATE…….......................................................................................................................3
ACKNOWLEDGEMENT..............................................................................................................4
ABSTRACT………….....................................................................................................................5
1. INTRODUCTION……...............................................................................................................8
2. TECHNICAL CONTENT........................................................................................................12
3. WORK PLAN……....................................................................................................................15
6
3.4 Bluetooth Communication Plan........................................................16
4. RELATED WORK...................................................................................................................17
7. CONCLUSION……..................................................................................................................23
8. REFERENCES……..................................................................................................................23
7
1. INTRODUCTION
This project is about voice controlled robot car. Due to making this project speech recognizing
fundamental and other importing issue is sending speech recognizing results to car via using
wireless system. Speech recognizing also known as "automatic speech recognition (ASR)",
"computer speech recognition", "speech to text (STT)". This project has several parts like voice
input and recognizing, computer to microprocessor communication, microprocessor to
microprocessor wireless data transmission (wireless remote controller), controlling multiple motor
using by microprocessors.
Voice is a sound which produced by humans or animals. Voice uses airflow that comes from lungs.
Air makes pressure over vocal folds and these vocal folds vibrate. Normally speech produces as
whisper in our throat by using neck, chest, head and abdomen this whisper becomes our speech.
Our speech is unique for every people and also it helps other people to understand each other’s
personality, mood and most importantly it helps people to communicate. Sounds are using
mechanical waves for traveling around gases, liquids and solids. Mechanical waves transport their
energy to one medium to another medium while using vibration. Due to take voice microphone is
required. Microphone is a hardware which can convert analog input to a digital output. Digital data
can be understand, modify and store by computers. Computers can recognize speech by using some
complex algorithms and good dictionaries for these algorithms. Most of recognition programs use
Hidden Markov Model (HMM) and Mel-frequency cepstral coefficients (MFCC) and frequency
spectral decomposing technique to use both of those algorithms. I have used Microsoft Visual Basic
for making speech recognition it can access Microsoft’s speech recognition tool while using
framework, .NET and C# programming language. First Microsoft speech recognition tool has been
introduced for Microsoft vista at 2006 and this toll uses Microsoft SAPI (Speech Application
Programming Interface) interface packed and this packed includes Microsoft speech recognizer
program for windows.
8
1.2 Microcontroller Devices
Microcontroller is an integrated chip and it’s also called as embedded system which includes CPU,
RAM, ROM, I/O parts. Microcontrollers is like small computers but they are much simpler than the
todays computers they can do simple specific tasks to control system. The advantage of the
Microcontroller is, it is far cheaper than a complex controller. Microcontroller generally uses metal
oxide semiconductor (CMOS) technology on the manufacturing process developers used less power
and less resources. Generally microcontrollers’ uses 5V DC voltage to work but this can be change
by the different microcontrollers. In this project I used microcontroller to make the car and while
doing this I have used microchip’s PIC 16F877A microcontroller. PIC 16F877A microcontroller
has forty pin four of them for the feeding, two of them for oscillator. Oscillator is a simply clock
with constant frequency in the project I have tried two different oscillator one of them 4 Hz and the
other were 8 Hz. For the programming PIC microcontroller there are many option PIC
microcontroller does not interested complier or editor too much as long as code and configuration
setting were true and hex file correctly complied. In my project I used microchip’s MicroC editor
and complier program. Codding is not so hard on these microcontrollers the hard part is setting true
configuration settings for right hardware. To add hex files to the microcontroller there are many
ways we can use debugger or an installer board can fix this problem but for different platforms we
need to change our installer software too.
Wireless systems are very common in these days and I want to make wireless a simple wireless
receiver and transmitter to communicate speech recognition program with car. PIC is a
microcontroller producing by Microchip Company and their microchips have a lot of application
areas like wireless so I want to make a wireless receiver and transmitter that use PIC
microcontrollers. Due to this kind of communication applications PIC microcontrollers generally
uses UART library to communicate with each other. After establish code there is necessary to have
receiver and transmitter components. For the transmitter part I have to take values from my
computer to doing this I have to use some component. MAX232 is a very useful solution for this
connection; MAX232 uses RS232 serial port cable to communicate with PIC microcontroller.
MAX232 converts computers signals coming from RS232 cable and sends converted signals to the
PIC microcontroller. MAX232 component uses 5V DC as a input but it can also stands
approximately 7.5V DC
9
1.4. Controlling Multiple Motor Using By Microprocessors
By using motor drivers PIC microcontrollers can control DC, AC or any other kind of motors.
Drivers protect PIC and motor from burning problem. Motor drivers also provide bigger voltage for
motors because PIC microcontrollers use five volt input and output. There are some drivers can
help microcontroller to control two different motor those component called as dual h-bridge motor
driver. I have used a motor driver that can control two different motors but instead using one to
control two motor I used two of them because these drivers get hot so quickly to avoid this situation
I could use a metal panel but I had two motor drivers and I wanted to use both of them in my
project that is why I used two motor controller in my car circuit.
Arduino is open source electronic prototyping platform based on flexible to use easy to use
hardware and software tool. Arduino has a microcontroller inside its hardware it is different than I
used on the microcontroller part of the project part. Arduino uses ATmega series there is many type
of Arduino exist today most popular ones are Arduino MEGA, Arduino UNO and many other type.
I have used Arduino UNO it uses ATmega328 series of microcontroller has 28 ports inside it.
Software of Arduino is very easy to use it does not requires too much configuration one you choose
your dictionaries and wrote your code Arduino takes care of all other configuration settings and
makes things much more easier. To installing code to Arduino is also very easy after code verified
its complier than user just need to connect its cable to the PC than Arduino’s software finds its
hardware and when user installs code to the hardware it is still easy to debug Arduino without using
different hardware or software. If user defines serial communication with PC then user can check
what Arduino does when it’s working.
10
1.6. Bluetooth communication
Bluetooth is one of the popular devices to communicate in short range it is using on computers, cell
phones, head phones and many other devices. Bluetooth devices use 2.4 to 2.5 GHz frequency to
communicate with each other’s. Bluetooth standardized as IEEE 802.15.1 but then it changed that
802.15.1 Bluetooth’s range is 2400–2483.5 MHz approximately. Bluetooth devices generally use
frequency-hopping spread spectrum communication technique to communicate each other. It can
have approximately 40 channels and signals hops 1600 hop per second. Bluetooth devices firstly
search each other once one find other it shows device to its user if user decides to communicate
with device he paired those two devices and starts communication. Design level 0 has showed in
design 1.1.
Hardware designs,
Hardware connections,
Hardware integrations,
Communication tools,
Hardware errors
Input voice,
Computer programs,
Coding languages,
Communication protocols,
Coding errors
There is too many control devices in the environment like car steering wheel, computer keyboards,
elevator buttons, etc. But all these processes can be made easily with human speech. Speech
recognition programs can be also using by government or a company to communicate or guide to
people who need some official paper or other applications from these companies. People can speak
with speech recognition programs and find their way, buying something things or services, access
data from data base, write their documents, writing text messages, making internet search,
controlling wheelchair for paralyzed people etc. all those services are available with touch system
but with very good speech recognizing system this kind of services will be using much more easily
and make for user search efficient and faster. With improvements in artificial intelligent systems
speech recognizing systems will be more importing and its using area will be increased faster.
Microcontrollers using in many different applications by now on the first computer developers used
microcontrollers and in the basic daily life many device we see controlling by microcontrollers.
Microcontrollers do specific jobs on the circuit they used in battery charges, printers, scanners,
stereo systems, etc. there some different processors for embedded systems there are general purpose
processors like intel and AMD, Micro-controller processors like PIC microchip and 8051, special
processors like TMS320 series DSP and finally application specific instruction processors. In our
case microcontroller processors have four main features one of them is on chip peripherals like
timers, analog to digital converters, secondly on chip program and data memories, third direct
programmer access to chips pins, and fourth is specialized instructions for bit manipulation and
lower level operations. And their applications are reading sensor data, setting actuators, dealing
with bits little amount of data, they can be using on the disk drive, digital camera, washing machine
12
or etc. microprocessor works with using hex files.
Max232 component is very useful for the projects like mine, PIC microcontroller need to
understand what computer commands but in this part communication between them is pretty
complicated to make this job I have used this component. It simply converts computer data to
biliary numbers which my PIC can easily understands and process.
Wireless systems is very importing in these days, these systems removes cables around and gives its users to
ability connect internet and wireless networks for many different applications. With smart phones wireless
technology using area increased these systems are very importing for community. Government use this
wireless networks in the public areas like Istanbul metropolitan municipality use wireless technology to get
location of their busses and via mobile applications they share this information with the Istanbul citizens. In
these days communicating is very importing issue and with improvements in the wireless technology
systems communicating is being much easier and efficient. On the project I have used two type of wireless
device these devices are radio frequency and Bluetooth.
Motors are using in many industrial and daily application like cars, elevators, etc. to make our live
more easy. Without of motors people could make many hard jobs with their body power and this is
not so efficient for today’s industry. Motors are very popular and controlling them is very importing
issue engineers and scientists still try to control motors more efficient. With efficient motor control
13
industrial technology could be improve much faster and this affects other areas either. There is
much kind of motors in the industrial area because their applications vary due to application it used.
Arduino is open source electronic prototyping platform based on flexible to use easy to use
hardware and software tool. Arduino has a microcontroller inside this microcontroller control its
own hardware and while using given pins it help user to do different kind of applications. Today
many artists, designers, engineers and hobbyists, who interested in creating interactive objects or
environments on their systems, use this prototype to create new projects. Arduino has its own
software it can be freely downloadable on the internet and it is just one file easily installing and
there is no necessary configuration requires. Arduinos dictionaries are fairly easy to use, they have
its own examples on the software and these examples are very tutoring.
Connecting things is getting very complex thing because there is too many cables and too many
port. With Bluetooth technology this problem could be solving and people could connect their
devices more easily, more beautify. The main idea of this invention is cable-free computer
connections, which means real freedom for working environment regardless wire availability and
device restriction. This Bluetooth technology allows portable computers, notebooks, mobile
phones, personal digital assistant and other helpful materials to use short range, low power radio
technology to connect to each other very easily. Bluetooth is using 2.4 to 2.5 GHz frequency
spectrum to communicate. While Bluetooth communication with other Bluetooth device its
signals hops between channels and frequencies. It can communicate in the short range but its
usage areas very varying, it can be used to data transmission between two devices like computer
to computer, computer to cell phone, cell phone to computer, cell phone to cell phone. Bluetooth
14
also using to head phones to connect musical device, computer or cell phone wirelessly, Bluetooth
communication is pretty secure it hops between frequencies so jammers and similar devices
getting hard time to restrict its communication. Bluetooth also can easily choose device that it will
send its data, firstly Bluetooth device search device near it and second it ask user should I get
paired with this device to connect it securely and if user permits they starts to their
communications
3. WORK PLAN
I used motor controller component on this circuit. U used my microcontroller to control motor
driver I choose a motor driver and programmed my microprocessor with it. I also added an H bridge
to this motor driver circuit, this H Bridge provides more control and also it protect my motor and
motor controller components. I tried to control four dc motor but I controlled two of them other two
directly connected to the other motors pins to do same rotation.
15
I brought an Arduino board and a motor controller board for four motor but I just used two motor. I
downloaded Arduino’s program on the internet and made some exercises to learn it and I also
installed and learned how to use motor controlling with looking its exercises and its forums. I have
learned how to connect Arduino with my computer and how to install program inside it. I have
learned how to control motor how many motor can I control which pins are never used and which
are used. I learned how to supply Arduino without of connecting computer.
I fist decided to communicate over something more accurate than RF communication than I came
up with Bluetooth idea. Bluetooth is a short range communication technology, it is very accurate
and works with less problem than RF. I brought Bluetooth device I firstly working something
more useful than serial communication but Arduino did not support it and I used serial
communication. I used serial communication dictionary for this work and defined two analog
ports to transmitter and receiver. I read HC-06 Bluetooth device’s data sheet and decided to give
3.3V to input but that was absolutely mistake for a long time I could not communicated with
Arduino. I tried different techniques to solve problems but after a while I solved the problem. The
problem was voltage; it was not enough I had to use 5V to communicate with Arduino. After
solved problem I finished android part of the project
16
4. RELATED WORK
I have finished speech recognition program with using Microsoft Visual Studio and fixed these
parts on this project;
1. Make a car speech command filter due to make more efficient ordering to the car.
2. Program sometimes gives wrong answers for the meaningless voices this error
should be fixed.
3. Speech recognizing tool should be connected to the PIC microprocessor with using
visual studio.
4.
I also restricted my speech results I made fine speech recognizing program with Microsoft visual
studio. I made communication between different hardware like I connected my computer to the
MAX232 circuit with using RS232 cable but I had not got RS232 so I used USB to RS232 cable
too I wrote a code to communicate between computer to microcontroller.
I also buy a Bluetooth device for Arduino communication and I write its communications too. Both
communication technologies were different but I tried to connect both of them. I have successfully
worked Bluetooth communication between computer and Arduino but in the other case there are
several problems still exist on the microcontroller RF communication protocols.
I also made two different receiver circuits these circuits also using as car circuits I could controllers
motors with different motor controllers. I could set motors velocity and torque as I wanted. I could
give directions to cars.
I made several simulations on Proteus simulation program to see if my codes truly works all the
time I could worked my simulations but in the hardware I always faced with many difficulties and
finally my microcontroller circuit did not worked.
On the other hand my Arduino code works pretty fine it gets values and controls motors. I defined
17
different type of constant for Arduino and Microcontroller, on the microcontroller I send
hexadecimal numbers but on the Arduino I sent alphabetical strings.
I have tried more useful code on the Bluetooth communication but it did not work because Arduino
did not sport this kind of protocols. On the microprocessor part I created addressing protocol with
using two number this number protect communication and avoid different signals to communicate
with my car.
Slave default baud rate: 9600; data bits: 8; stop bit: 1; parity: no parity
Auto-connect to the last device on power as default
Permits pairing device to connect as default
Auto-pairing pin: 1234 as default
18
6. CONFIGURATION AND IMPLEMENTATION
Pin description.
Enable. When enable is pulled low, the module is disabled. This means the
module will not turn on and will fail to communicate. When enable is left open
or connected to 3.3V, the module is enabled, that is, it will remain on and
communication will also take place.
Txd and Rxd. These pins act as UART interface for communication.
State. This pin acts as the status indicator. When the module is not connected
to or paired with any other Bluetooth device, the signal goes low. At this low
state, the onboard LED flashes continuously, which denotes that the module is
not paired with another device. When this module is connected to or paired
with another Bluetooth device, the signal goes high. At this high state, the
19
onboard LED blinks with a constant delay of, say, two seconds. This indicates
that the module is paired.
L293D motor driver. This is a dual H-bridge high-current motor driver IC. It is
used here because digital pins of Arduino cannot source enough current to
drive the motors of the robotic car. H-bridges are also useful in controlling the
direction of rotation of a motor. Enable pins 1 and 9 of the IC, being active high,
are connected to 5V. Four output pins of L293D IC are connected to motors M1
and M2 on the receiver side.
#include <AFMotor.h>
#include <Servo.h>
String voice;
void setup()
{
Serial.begin(9600);
myServo.attach(10);
myServo.write(90);
void loop()
{
while (Serial.available()){
delay(10);
20
char c = Serial.read();
if (c == '#') {break;}
voice += c;
}
if (voice.length() > 0){
if(voice == "*go ahead"){
forward_car();
}
else if(voice == "*go back"){
back_car();
}
else if(voice == "*right") {
right_car();
}
else if(voice == "*left") {
left_car();
}
else if(voice == "*stop") {
stop_car();
}
voice="";
}
}
void forward_car()
{
motor1.run(FORWARD);
motor1.setSpeed(700);
motor2.run(FORWARD);
motor2.setSpeed(700);
delay(2000);
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void back_car()
{
motor1.run(BACKWARD);
motor1.setSpeed(700);
motor2.run(BACKWARD);
motor2.setSpeed(700);
delay(2000);
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void right_car()
{
21
myServo.write(0);
delay(1000);
myServo.write(90);
delay(1000);
motor1.run(FORWARD);
motor1.setSpeed(190);
motor2.run(BACKWARD);
motor2.setSpeed(190);
delay(1000);
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void left_car()
{
myServo.write(180);
delay(1000);
myServo.write(90);
delay(1000);
motor1.run(BACKWARD);
motor1.setSpeed(190);
motor2.run(FORWARD);
motor2.setSpeed(190);
delay(1000);
motor1.run(RELEASE);
motor2.run(RELEASE);
}
void stop_car ()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
}
22
7. CONCLUSION
In a nutshell we can conclude that voice controlled robots can certainly be a future market for
many industrial and domestic purposes related to automating daily tasks. After several runs and
tests our proposed method of Bluetooth communication worked efficiently with an acceptable
time delay. The connections between the microcontroller and Bluetooth worked quite well with a
few errors in recognition of voice commands. We used both GSM and WIFI based internet
connectivity for the application to recognize the commands and link it to Arduino. But for future
modifications we can create an offline system for the application to recognize voice and send it
back to microcontroller. A few modifications in the android based application can result in a much
more clarity of voice recognition.
23
8. REFERENCES
[1] Dr. Joseph Picone, (1999, MAY, 15-17). Fundamentals of speech recognition: a short
course. (1nd edition). [Online]. Available:
http://speech.tifr.res.in/tutorials/fundamentalOfASR_picone96.pdf [OCTOBER 28, 2013]
[5] Cecilia CARUNCHO LLAGUNO (April 2008). cepstral analysis synthesis on the mel
frequency scale, and an adaptative algorithm for it. 1(1), pp. 1-6. Available:
http://www2.spsc.tugraz.at/www-archive/AdvancedSignalProcessing/SS08-
SpeechSynthesis/cepstral_analysis.pdf [Nov. 7,2013]
[6] Kin Hong Wong, B.Sc., Ph.D. CMSC5707. Class Lecture. Topic: Audio feature extraction
techniques Department of Computer Science and Engineering, The Chinese University of Hong
Kong, Shatin, N.T. Hong Kong. Oct. 17, 2013.
24
[7] D.L. Barron, W.C. Yip. “Speech recognition using polynomial expansion and hidden
markov model”. U.S. Patent 6,928,409 B2 , Aug 9, 2005.
[8] Ibrahim Patel, Dr. Y. Srinivas Rao. 2010 December. speech recognition using hmm with
MFCC- an analysis using frequency specral decomposion technique. [On-line]. Vol.1, No.2, pp
1- 10 Available: http://airccse.org/journal/sipij/papers/1210sipij09.pdf [Nov. 5, 2013]
[9] Aldebaro Klautau. (2005, Nov.). “The MFCC”. pp. 1-14. Available:
http://www.cic.unb.br/~lamar/te073/Aulas/mfcc.pdf [ Oct. 11,2013]
[12] Elizabeth Flock. “Alexander Graham Bell sketches his electrical speech machine”.
Internet: http://www.washingtonpost.com/blogs/blogpost/post/alexander-graham-bell-sketches-
his-electrical-speech-machine-photos/2011/05/20/AFo0qn7G_blog.html , June. 20, 2011 [Nov.
5, 2013]
[13] M. Dunn.” Give Applications a Voice: Speech synthesis and recognition in .NET”.
Internet: http://reddevnews.com/articles/2007/02/15/give-applications-a-voice.aspx?sc_lang=en
, Feb. 2007 [May. 2014].
[14] M. Michihara.(2013,Dec). “Microprocessors: The Silicon Revolution”. Volume XIV Issue III.
[On-line] Available: https://illumin.usc.edu/printer/123/microprocessors-the-silicon-revolution/
[15] Gary H. Bernstein, B.S.E.E., M.S.E.E., Ph.D. "Microprocessor,". Microsoft Corporation, One
Microsoft Way, Redmond, WA 98052. Internet:
http://autocww.colorado.edu/~toldy2/E64ContentFiles/ComputersElectronics/Microprocessor.html
[16] J. Wolfe. 2011 Oct- Mar “Electric motors and generators” University of New South Wales or
of the School of Physics. 61-2-9385 4954. Avaliable:
http://www.animations.physics.unsw.edu.au//jw/electricmotors.html#DCmotors
[18] Elizabeth Flock. “Alexander Graham Bell sketches his electrical speech machine”. Internet:
http://www.washingtonpost.com/blogs/blogpost/post/alexander-graham-bell-sketches-his-electrical-
speech-machine-photos/2011/05/20/AFo0qn7G_blog.html , June. 20, 2011 [Nov. 5, 2013]
[19] P. Yue. L. Sun. UCSB ECE 219 “Modulation, Transmitters and Receivers”. High-Speed
Silicon Lab (HS2L). Harald Frank Hall 4162. 2013 available:
http://www.ece.ucsb.edu/yuegroup/Teaching/ECE594BB/Lectures/steer_rf_chapter1.pdf
26
27