Introduction:
Think about a creating a car which would be controlled by your voice. By giving a command, the car would drive you to your destination. The voice recognition algorithm we used could be applied to daily life; for example it would be most helpful to disabled people to perform their daily work. We created a speech controlled car using various electrical and mechanical domains such as digital signal processing, analog circuit design, and interfacing the robot with the computer.
In this project we are controlling the robot based on the speech.
Based on the words we uttered the robot perform the required action. For example if we utter the word “FORWARD” the robot will move in the forward direction.
Goal of the project: The main goal of this project is to control a robot using the speech commands from the user
Development of the project:
1.Speech recognition: speech coding is done in MATLAB.
2.Parallel communication: code is written in MATLAB(PC) and the parallel port of the PC is used.
Initial Problem:
A human can easily recognize a familiar voice however, getting a computer to distinguish a particular voice among others is a more difficult task. Immediately, several problems arise when trying to write a voice recognition algorithm. The majority of these difficulties are due to the fact that it is almost impossible to say a word exactly the same way on two different occasions. Some factors that continuously change in human speech are how fast the word is spoken, emphasizing different parts of the word, etc. In order to analyze two sound files in time domain, the recordings would have to be aligned just right so that both recordings would begin at precisely the same moment.
Requirements:
Hardware requirements:
- Chassis for robot.
- DC gear head motors
- Parallel Port cable and sockets
- L293D(motor controller IC)
Software requirements:
- MATLAB 7.0
Actual Hardware
State chart description:
Running State: Executing previous command and waiting for new command.
X =Right/ Left/Forward/Back/
Working:
- 1. Training Process:
Recognition of orders is based on a dictionary of words. The creation of the dictionary represents the training operation – to determine the specifics of each word, e.g. the way a word is said and save it for later recognition. Training is done by repeating the words and updating the Dictionary after each pronounced command.
The training process is carried out by recording the voice input from the microphone at the sampling rate of 88200 resulting in 44100 voice samples.
2. Analysis:
The recorded speech is analyzed in order to have the parameters that will further be compared to recognize the commands by the user. The analysis process includes the calculation regarding the number of samples crossing the threshold value in the time frame in which the word is spoken. Hence speech part of the recording is extracted and the number of samples crossing the threshold amplitude approximated for the voice commands is calculated and stored in an array.
The same process is carried out for each of four commands. At the same time the plots of the voice commands are obtained as follows :
Magnitude Plots of Voice Commands:
1. Recognition:
Recognition process involves matching the command given by the user to the commands stored in the dictionary and identifying the right word. For the recognition process the voice command is again recorded and then is compared to the previously recorded commands. The value of the samples voice part crossing the threshold value are again counted and compared to the previously recorded commands. The command closely matching is considered as the spoken word. According to the command recognized the output is produced at the parallel port.
2. Implementation:
Now to implement this hardware we required a machine so chosen the easiest i.e. a robot. This robot has got parallel port connector which is used to connect the robot to PC. Now as the recognition of a word or command is complete then the motors of the robot is controlled by sending the respective binary vector through the parallel port again through the MATLAB. And the respective movement is seen in the robot.
Software description:
The code of this project is written in MATLAB, both for speech recognition and robot control via Parallel port. The following files in the voice recognition folder contain the code of the project:
Code Structure:
- 1. voicetrain.m
The training part of the process is done by typing the ‘voicetrain’ in the command window. It serves the purpose of taking input from the microphone and replaying it for the user to identify is it correct or not. The similar process is carried out for each of four commands individually. The respective value of each command is stored in an array so that can be used further comparison of the voice.
- 2. voicecomp.m
The comparison part of the speech can be carried out by typing ‘voicecomp’ in the command window. This file will again take the recording from the user and will replay it for the user to identify if it is correct or not. Now this recording is compared with the previously recorded commands and the nearest possible match is considered as the command given by the user. This file also contains the code for initialization and control of the parallel port and hence the respective value of the command is sent to the parallel port and accordingly the motors are controlled.
The general commands used in the code are described as follows:
- 1. Wavrecord:
Record sound using a PC-based audio input device.
Syntax:
y = wavrecord(n,Fs)
y = wavrecord(…,ch)
Description:
y = wavrecord(n,Fs) records n samples of an audio signal, sampled at a rate of Fs Hz (samples per second). The default value for Fs is 11025 Hz.
- 2. sound :
Convert vector into sound
Syntax:
sound(y,Fs)
Description:
sound(y,Fs) sends the signal in vector y (with sample frequency Fs) to the speaker on PC. Stereo sound is played on platforms that support it when y is an n-by-2 matrix.
- 3. Disp:
Display text or array
Syntax:
disp(X)
Description:
disp(X) displays an array, without printing the array name. If X contains a text string, the string is displayed.
- Digitalio:
Create digital I/O object
Syntax
DIO = digitalio(‘adaptor’,ID)
Description:
DIO = digitalio(‘adaptor’,ID) creates the digital I/O object DIO for the specified adaptor and for the hardware device with device identifier ID. ID can be specified as an integer or a string.
- Addline:
Add hardware lines to digital I/O object
Syntax:
lines = addline(obj,hwline,’direction’)
lines = addline(obj,hwline,port,’direction’)
Description:
lines = addline(obj,hwline,’direction’) adds the hardware lines specified by hwline to the digital I/O object obj. direction configures the lines for either input or output. lines is a row vector of lines.
lines = addline(obj,hwline,port,’direction’) adds the hardware lines specified by hwline from the port specified by port to the digital I/O object obj.
- Putvalue:
Write values to lines
Syntax:
putvalue(obj,data)
putvalue(obj.Line(index),data)
Description:
putvalue(obj,data) writes data to the hardware lines contained by the digital I/O object obj.
putvalue(obj.Line(index),data) writes data to the hardware lines specified by obj.Line(index)
Other commands used in MATLAB include control statements like while, for, if etc.
Hardware description
Hardware of this project is build using a simple robot body having two DC gear head motors. These gear head motors are controlled by an H-Bridge IC (L293D). This IC is directly driven by parallel port of the PC connected via parallel port cable. The motor movements are controlled through MATLAB by sending the commands through parallel port.
Circuit Diagram:
The hardware components of the projects are:
- 1. H-Bridge IC:
The L293D is a quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage n loads in positive-supply applications.
This IC contains two H-bridge circuits that can control maximum of two motors. Here the four control inputs of the IC are coupled with the four data pins of the parallel port. The descriptive connection of the motor with the motors is shown in the figure below. Also the figure below shows the detailed pin description of L293D.
Pin Diagram:
The L293D comes in 16 pin DIP package whose pin description is shown below:
Motor connections to L293D:
Controls:
Both Inputs motor (1 -1 ) halt
first high second low (1 – 0) motor forward
first low second high (0 – 1) motor reverse
both low (0-0) motor stop
1. Parallel Port
A parallel port is a type of interface found on computers (personal and otherwise) for connecting various peripherals. In computing, a parallel port is a parallel communication physical interface. It is also known as a printer port or Centronics port. The IEEE 1284 standard defines the bi-directional version of the port, which allows the transmission and reception of data bits at the same time.
Parallel port is preferred in our project in order to have an easy interface of our robot with the PC as well as to MATLAB.
Hence the four data pins of the parallel port 2,3,4,5 respectively are connected to the control pins of L293D. The pin numbers 18 to 25 are ground pins and are connected to ground.
Originally designed only for printers, the parallel port turned out to be an amazingly flexible and universal interface for attaching a host of different devices to a variety of PCs. While rather slow, the parallel port has the advantages of being (mostly) standard, and present on virtually every PC. For this reason, it is often used for attaching external devices such as hard disks, CD-ROM drives and tape drives, especially for PCs that lack other expansion alternatives such as notebooks. For many years, I personally used a parallel-port Iomega Zip drive when I was maintaining several dozen PCs that were not networked; it was very helpful for transferring files between machines and doing backups. The parallel port can also be used with special software to connect two PCs together to let them share files.
DC Gear head Motors:
We have used plastic gear head motors as they are economic and light weight. They also consume less power hence battery can last long. Though they can be replaced by iron gear head motors so as to increase torque and minimize the inertial effects.
Motor alignment:
Ajitesh Pandey
Oriental engineering College Jabalpur (MP)
Contact for code-+919770947098


























First this was just an idea we saw one day on the internet ,it was
Bob Blick who made it first using the PIC 16C84, but I was not