Вы находитесь на странице: 1из 129

VIRTUAL SPEAKER

Muhammad Awais, Ghulam Meeran & M.ArslanUsman

Submitted in partial fulfillment of the requirements for the degree of Bachelor of Electrical (Electronics) Engineering

Department of Electrical Engineering Air University, Islamabad (July, 2009)

CERTIFICATE
It is certified that the contents and form of thesis entitled _________________ submitted by ____________ have been found satisfactory for the requirement of the degree.

Head of department: _______________________________ (Dr. Kamal Athar)

Supervisor:

Signature: ________________________ Madam Amina Ali Official Address

Examiner 1:

Signature: ________________________ Dr. Arif Official Address

Examiner 2:

Signature: ________________________ Madam Sara Saeed Official Address ii

Declaration
I declare that all material in this thesis which is not my own work has been identified and that no material has previously been submitted and approved for the award of a degree by this or any other university.

Signature:____________________________ Authors Name:________________________

It is certified that the work in this thesis is carried out and completed under my supervision.

Supervisor:

Signature: __________________ Madam Amina Ali Official Address

iii

DEDICATION
Dedicated with love to my parents

iv

ACKNOWLEDGEMENT
First of all I would like to thank Almighty Allah, the most beneficent and the most merciful, who lead us to the success.

I would like to thanks our project supervisor Madam Amina Ali who guided us throughout the project from the beginning of the research till the completion of project in the form of a smart device.

We would like to express our gratitude to Dr. Arif who co-operated with every student, realizes the weak points of the projects. They helped us in every aspect of our project.

Dr. Kamal Athar is very kind in guiding us regarding the project. He made sure that every facility is extended towards the students even in late hours and on holidays as well.

I would also like to thank National Development Complex (NDC) who give us opportunity to work in their Lab and also sponsored our project.

We would also like to thank all the faculty members who taught us in our four years of education and made us capable of doing all this.

It was all possible because of the support of our friends morally and technically. And more importantly we all express our extreme gratitude towards our families. Their patience, support, tolerance and blessings were the driving force for our group. v

Abstract
Virtual Speaker (VS) is designed for computer generated VOICE .This project is a speaking aid for communication between dumb, deaf and normal people. VS generate voice in response of two input modes: 1. Hand Movement mode 2. Text mode We can make different hand signs by changing fingers position and tilting of the hand. This motion can be determined by using different sensors, including flex sensors and accelerometers. VS can also speak in response of text entry. Controller is programmed to take these inputs, recognize the input and instructs the speech processor to generate voice and LCD to graphically display it. VS is divided into five modules; first module consists of Keypad for Text entry and the LCD for displaying the words, second module is the collection of five bend sensors mounted on the fingers and thumb of the glove, the third module has the accelerometer for sensing hands motion and the ADC for analogue to digital conversion of the output of accelerometer , the fourth module is the microcontrollers module that controls the flow of main program, takes the inputs from sensors and generates the signals for the output module to produce output, the fifth module is the speech synthesis part for generating the voice by concatenating the allophones.

vi

Table of Contents

ACKNOWLEDGEMENT ............................................................................................. v Abstract ......................................................................................................................... vi Table of Contents .........................................................................................................vii List of Figures ..............................................................................................................xii List of Tables .............................................................................................................. xiv Abbreviations ............................................................................................................... xv Chapter 1 1.1 1.2 1.3 1.4 Introduction, Objectives and Achievable Applications ......................... 16

Introduction ................................................................................................... 16 Objectives ...................................................................................................... 17 Block Diagram .............................................................................................. 18 Achievable Applications ............................................................................... 19 Communication with Disable persons ................................................... 19 Benefit of speech synthesis .................................................................... 19 Voice announcement systems ................................................................ 19 Message reader....................................................................................... 20 Computer Mouse movement .................................................................. 20 Robot hand movement control ............................................................... 20 Speech controlled car/ robot .................................................................. 20 Sign Language ....................................................................................... 21

1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 Chapter 2 2.1 2.2 2.3 2.4

Introduction ................................................................................................... 21 Characteristics of Sign Language .................................................................. 21 American Sign Language .............................................................................. 22 Baby Sign Language ..................................................................................... 23

vii

2.5

Other Signing Systems .................................................................................. 23 Signed Exact English (SEE) .................................................................. 24 Pakistan Sign Language & Proposed Hand Signs ................................. 25

2.5.1 Chapter 3 3.1 3.2

Pakistan Sign Language ................................................................................ 25 History and development of Pakistan Sign Language .................................. 25 Sir Syed Deaf Association (SDA), Karachi ........................................... 26 ABSA Research Project ......................................................................... 26 NISE Research Project ........................................................................... 26 PAD Sign Language Research Group, Karachi ..................................... 27 Deaf Reach, FSF, Karachi ..................................................................... 27

3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.3 3.4

Characteristics of the disabled Population of Pakistan ................................. 28 Proposed Hand Signs for our system ............................................................ 29 Proposed hand signs of ASL .................................................................. 29 Some common gestures selected are as follows .................................... 30 Speech Synthesis .................................................................................... 31

3.4.1 3.4.2 Chapter 4 4.1 4.2

Speech Synthesis ........................................................................................... 31 Methods of Speech Synthesis........................................................................ 31 Concatenative Synthesis ........................................................................ 31 Formant Synthesis .................................................................................. 32 Articulatory synthesis ............................................................................ 33

4.2.1 4.2.2 4.2.3 4.3

Speech Processor (SP0256) ........................................................................... 34 Features of SP0256-AL2........................................................................ 34 The sp0256 Incorporates Four Basic Functions..................................... 34 Allophone Speech Synthesis .................................................................. 35 How to use allophone set ....................................................................... 35 Sensors ................................................................................................... 36

4.3.1 4.3.2 4.3.3 4.3.4 Chapter 5 5.1

Sensors .......................................................................................................... 36 viii

5.2 5.3 5.4 5.5

Application of Sensors .................................................................................. 37 Properties of an Ideal Sensor ......................................................................... 37 Need of Sensors in Our Design ..................................................................... 37 Sensors Available .......................................................................................... 37 Tilt Measurement ................................................................................... 37 Tilt Sensor .............................................................................................. 38 Accelerometer ........................................................................................ 38 Gyroscope .............................................................................................. 40

5.5.1 5.5.2 5.5.3 5.5.4 5.6

Bend Measurement ........................................................................................ 41 Optical Method ...................................................................................... 41 Flex Sensors ........................................................................................... 42 Flexible Stretch Sensors ......................................................................... 43

5.6.1 5.6.2 5.6.3

5.7 ............................................................................................................................. 44 5.8 Selected Sensors ............................................................................................ 44 Accelerometer MMA7261Q .................................................................. 44 Flex Sensor............................................................................................. 46 Hardware Designing .............................................................................. 47

5.8.1 5.8.2 Chapter 6 6.1 6.2 6.3 6.4 6.5

Input Hardware .............................................................................................. 47 Processing Unit ............................................................................................. 47 Output Hardware ........................................................................................... 47 Block Diagram .............................................................................................. 48 Hardware Implementation ............................................................................. 49 Basic Hardware ...................................................................................... 49 Bend Detection....................................................................................... 51 Symbol Detection................................................................................... 54 Tilt Measurement ................................................................................... 55 Speech Generation ................................................................................. 58 ix

6.5.1 6.5.2 6.5.3 6.5.4 6.5.5

6.5.6 6.6

Amplification Circuitry.......................................................................... 59

Designing the Architecture............................................................................ 61 Final Schematic ...................................................................................... 62 Practically Implemented and Integrated Hardware................................ 63

6.6.1 6.6.2 6.7

Final Outlook................................................................................................. 64 Software Designing ................................................................................ 65

Chapter 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7

Software Development .................................................................................. 65 Programming the Controlling Unit ............................................................... 65 Main Program Flow ...................................................................................... 66 Programming the ADC.................................................................................. 68 Hand Sign Detection ..................................................................................... 69 Speech Generation using Speech Processor .................................................. 70 Programming the LCD .................................................................................. 71 Conclusion and Future Enhancement .................................................... 73

Chapter 8 8.1 8.2

Conclusion..................................................................................................... 73 Future Enhancement ...................................................................................... 73 Appendix ................................................................................................ 75 89c51 Micro-controller ................................................................... 75

Chapter 9

Appendix A A.1

Pin Configuration 89c51 ............................................................................... 75 Accelerometer ................................................................................ 76

Appendix B B.1 B.2

Description of Input /Output Pins of Accelerometer ................................. 76 g-select Table for Accelerometer .................................................................. 76 ADC 0804 ...................................................................................... 77

Appendix C C.1

Pin Configuration ADC 0804 .................................................................... 77 LCD ............................................................................................... 77

Appendix D D.1 D.2

Pin Configuration LCD ............................................................................. 77 Pin Description LCD ................................................................................. 78 x

D.3

Instruction Table ........................................................................................ 78 Speech Processor (SP0256) ........................................................... 79

Appendix E E.1 E.2 E.3

Pin Configuration SP0256-AL2 ................................................................ 79 Dictionary of SP0256 Allophones ............................................................. 79 Allophones Address Table ............................................................................ 81 Audio Amplifier UTC TEA2025 ................................................... 82

Appendix F F.1

Pin Configuration UTC TEA 2025 ............................................................ 82 Voltage Regulator ........................................................................... 82

Appendix G G.1

Pin Configuration LF33cv ......................................................................... 82 Source Code .................................................................................... 83

Appendix H H.1 H.2 H.3

C Language Source Code for keypad and LCD ........................................ 83 C Language Source Code for Hand Sensing ........................................... 100 C Language Source Code for SP0256-AL2 ............................................ 123

Appendix I CD Contents ..................................................................................... 128 I.1 I.2 I.3 I.4 Chapter 10 Abstract of Virtual Speaker.doc .............................................................. 128 Project Report .doc.................................................................................. 128 Software code ......................................................................................... 128 Data sheets ............................................................................................... 128 References ............................................................................................ 129

xi

List of Figures
Figure 1 Block diagram............................................................................................ 18 Figure 2 American Manual Alphabets ........................................................................ 22 Figure 3 A baby signing .............................................................................................. 23 Figure 5 Victory Symbol ............................................................................................ 30 Figure 6 OK Symbol ................................................................................................... 30 Figure 7 Turn Left Symbol ......................................................................................... 30 Figure 8 Turn Right Symbol ....................................................................................... 30 Figure 9 Basic structure of cascade formant synthesizer ............................................ 32 Figure 10 Basic structure of a parallel formant synthesizer ....................................... 33 Figure 11 Speech Processor SP0256-AL2 .................................................................. 34 Figure 12 Sensors ........................................................................................................ 36 Figure 13 Construction of a Tilt Sensor ...................................................................... 38 Figure 14 Accelerometer............................................................................................. 39 Figure 16 Spinning Axis of Gyroscope ...................................................................... 40 Figure 17 Optical Method Bend Measurement ........................................................... 42 Figure 18 Flex Sensor ................................................................................................. 42 Figure 19 Working of Flex Sensors ............................................................................ 43 Figure 20 Flexible Stretch Sensors ............................................................................. 43 Figure 21 Accelerometer MMA 7261Q Evaluation Board......................................... 44 Figure 22 Accelerometer Evaluation Board Orientation ............................................. 45 Figure 24 Flex Sensor ................................................................................................. 46 Figure 26 Process Diagram ......................................................................................... 48 Figure 27 Block Diagram............................................................................................ 48 Figure 28 Keypad Functionality ................................................................................. 49 Figure 29 Schematic of Basic Hardware Including Keypad and GUI ........................ 50 Figure 30 Basic Hardware Including Keypad and GUI .............................................. 51 Figure 31 Flex Sensor Pins ......................................................................................... 52 Figure 32 Proteus Simulation Transistor in Cut-off mode.......................................... 53 xii

Figure 33 Proteus Simulation Transistor in saturation mode...................................... 53 Figure 34 Practically Implemented Bend Detection Circuit ........................................ 54 Figure 35 Schematic for Symbol Detection ................................................................ 54 Figure 36 Accelerometer MM7161Q Board ............................................................... 55 Figure 38 Schematic for Angle Measurement ............................................................ 57 Figure 39 Practically Implemented Angle Measurement Circuit ............................... 57 Figure 40 Schematic SP0256-AL2 ............................................................................. 58 Figure 41 Practically Implemented Circuit SP0256-AL2 ........................................... 59 Figure 42 DIP 16 UTC TEA 2025 ......................................................................... 59 Figure 43 Schematic UTC TEA 2025 ......................................................................... 60 Figure 44 Practically Implemented Circuit Audio Amplification .............................. 60 Figure 45 System Architecture ................................................................................... 61 Figure 46 Final Schematic .......................................................................................... 62 Figure 47 System Architecture Practically Implemented ........................................... 63 Figure 48 System Architecture Practically Implemented ........................................... 63 Figure 49 Final Outlook .............................................................................................. 64 Figure 50 Flow Chart for the Main Program Flow ..................................................... 67 Figure 51 Flow Chart for the Programming of ADC .................................................. 68 Figure 52 Flow Chart for Hand Sign Detection .......................................................... 69 Figure 53 Flow Chart for the Programming of Speech Processor .............................. 70 Figure 54 Flowchart for Programming of the LCD .................................................... 72

xiii

List of Tables
Table 1 Communication Table..................................................................................... 19 Table 2 Disability-wise breakup of the Pakistani population ...................................... 28 Table 3 Selected Hand Signs from International Sign Language ................................ 29

xiv

Abbreviations
VS GUI LCD ASL FSL PSL SDL ABSA NISE PAD FESF DGSE WFD FESF Virtual Speaker Graphical User Interface Liquid Crystal Display American Sign Language French Sign Language Pakistan Sign Language Sir Syed Deaf Association Anjuman-e-Behbood-e-Samat-e-Atfal) National Institute of Special Pakistan Association of the Deaf Family Educational Services Foundation Directorate General of Special Education World Federation of the Deaf Family Educational Services Foundation

xv

Chapter 1 Introduction, Objectives and Achievable Applications


1.1 Introduction
Communication is the process of sharing ideas, information, and messages with others in a particular time and place. Communication includes writing and talking, as well as nonverbal communication (such as facial expressions, body language, or gestures), visual communication (the use of images or pictures, such as painting, photography, video, or film), and electronic communication (telephone calls, electronic mail, cable television, or satellite broadcasts). Communication is a vital part of personal life and is also important in business, education, and any other situation where people come across each other. Keeping in view the importance of communication we decided to go for doing our final year project related to communication among the humans and in particular the communication of disabled persons with others like them and also with normal ones. So we aimed to design a device called Virtual Speaker (VS). The title of the project comprises of two words, Virtual means generated or simulated by the computer and Speaker is a transducer that converts electrical signals to sound energy providing the audible sound in device. This briefs us that VS is designed for computer generated voice. VS operates on two modes of inputs, it can be the text input or the hand movement. Several technologies can be used to take the text input like (keyboard, scanning a hand written text, multi-tapping of keypad etc). For the hand movement input mode number of hardware techniques can be used for gathering information about body orientation; image processing, data glove etc. The research report emphasis on input from data glove that updates data (including orientation of hand and figure position), algorithm for detection of few hand signs (part of an International Sign Language), and speech synthesis using a speech processor that gives an audible output to the outside world.

Introduction, Objectives and Achievable Applications The designed system may not be feasible for everyday use, however with the future advancements and more improved data gloves it can be made possible

1.2 Objectives
We aimed for following goals and objectives o Research on some international sign languages, select some signs and investigate the methods for detection of signs. o Research on sensors required detect the orientation of hand and bend of fingers and selecting the most feasible sensors that meets our requirement. o Mounting of sensors on a Glove for sensing hands movement. o Use of Keypad for controlling main program, and for entering words by multitapping keys in the text mode. o Software designing for the following purposes: Designing of GUI for showing outputs and also path of the main program. Algorithm for detection of hand signs. Designing software for taking the text input from keypad and also recognizing the words. Speech generation procedure by using speech processor.

17

Introduction, Objectives and Achievable Applications

1.3 Block Diagram


Block diagram includes the three main modules. o In the first module the main menu is displayed on the LCD and keypad gives input to control unit to select the mode i-e Hand mode or the Text mode. o Second module is the glove module that takes input from the various sensors mounted on the glove and decides the particular hand sign and updates the controlling unit with that input.

o Third module is the Speech synthesizer to generate the sound.

Figure 1

Block diagram

18

Introduction, Objectives and Achievable Applications

1.4 Achievable Applications


1.4.1 Communication with Disable persons
Virtual Speaker is a speaking aid for communication between blind, dumb, deaf and normal people. Two modes of both input and output make it feasible for communication between all the disabled persons and also with the normal person. Following table shows that at a time at least one mode of input and output is applicable to anyone.
Table 1 Communication Table

INPUT MODES

OUTPUT MODES Speaker No No Yes Yes

Disability Text Mode Hand Movement Mode GUI DUMB DEAF BLIND Normal Yes Yes No Yes Yes Yes Yes Yes Yes Yes No Yes

1.4.2 Benefit of speech synthesis


Hand sign made by dumb or deaf persons cannot be seen by the blind person nor can the normal person understand the signs. The communication can be made possible if input hand sign from the data glove after being recognized is synthesized to easily understandable language like English.

1.4.3 Voice announcement systems


Voice announcements made at busy places like Airport, Railways etc can be achieved by the speech synthesis module of VS

19

Introduction, Objectives and Achievable Applications

1.4.4 Message reader


A significant application for those who are not interested in reading the messages received on the mobile is the message reader so that the mobile reads the message for the user. This application is very helpful for blind people who see/ read the messages.

1.4.5 Computer Mouse movement


Data glove designed for VS can be helpful in many applications such a computer mouse movement control by taking the data from the glove and properly processing it to control the mouse movement on the computer screen.

1.4.6 Robot hand movement control


One of the remarkable possible applications in robotics is the robot arm movement control by calibrating the data for the application.

1.4.7 Speech controlled car/ robot


The voice produced from VS can be recognized by a smart system and used as commands to control different application like cars, robots etc.

20

Chapter 2 Sign Language


2.1 Introduction
Sign Language is a communication system using gestures that are interpreted visually. Many people in deaf communities around the world use sign languages as their primary means of communication. These communities include both deaf and hearing people who converse in sign language. But for many deaf people, sign language serves as their primary language. Sign languages exhibit variation in the same way as spoken languages do. For example, sign languages vary from region to region. In the United States, many Americans communicate through ASL. In Switzerland, there are five geographic dialects of Swiss German Sign Language with slight variations that derive from regional schools for the deaf. In Dublin, Ireland, where boys and girls attend different schools, the sign language used by deaf boys has a distinctly different vocabulary from that used by deaf girls.

2.2 Characteristics of Sign Language


Linguists have found that sign languages and spoken languages share many features. Like spoken languages, which use units of sounds to produce words, sign languages use units of form. These units are composed of four basic hand forms: hand shape, such as an open hand or closed fist; hand location, such as on the middle of the forehead or in front of the chest; hand movement, such as upward or downward; and hand orientation, such as the palm facing up or out. In spoken languages units of sound combine to make meaning. Separately, b, e, and t have no meaning. However, together they form the word bet. Sign languages contain units of form that by themselves hold no meaning, but when combined create a word. Spoken languages and sign languages differ in the way these units combine to make words, however. In spoken languages units of sound and meaning are combined

Sign Language sequentially. In sign languages, units of form and meaning are typically combined simultaneously.

2.3 American Sign Language


People who use sign language to communicate sometimes spell out words, signing letters of the alphabet with their fingers. The American Manual Alphabet is the finger spelling system most commonly used in the United States. In ASL signs follow a certain order, just as words do in spoken English. However, in ASL one sign can express meaning that would necessitate the use of several words in speech. For example, the words in the statement I stared at it for a long time each contain a unit of meaning. In ASL, this same sentence would be expressed as a single sign. The signer forms look at by making a V under the eyes with the first and middle fingers of the right hand.

Figure 2 American Manual Alphabets

22

Sign Language

2.4 Baby Sign Language


Sign language is primarily used as a means of communication with and between people who are hard of hearing or deaf, there are other uses as well. Recently, parents and teachers have used sign language as a tool to teach language skills to young, preverbal children. Some parents even begin teaching sign language while their children are still babies. Parents can start teaching sign language to their children when they are six months old, though it may take months before the child makes her first sign. Most children can handle a dozen or more vocabulary words at first. As the child learns the significance of signs, he/she will often want to learn signs for everything around her. Many parents note that at some point their child's desire to be taught more signs increase dramatically.

Figure 3 A baby signing

2.5 Other Signing Systems


People who sign sometimes use finger spelling to represent letters of the alphabet. In some sign languages, including ASL, finger spelling serves as a way to borrow words from spoken language. A deaf person might, for example, choose to fingerspell d-o-g for dog instead of using a sign. Several types of finger spelling systems exist. FSL and ASL use a one-handed system, whereas BSL has a two-handed system.

23

Sign Language

2.5.1 Signed Exact English (SEE)


Signed Exact English is a language that attempts to translate spoken English into a signed language. SEE includes prefixes, suffixes, tenses, words and sentence structures not found in ASL. SEE signers try to be very specific and literal, while ASL signers concern themselves with expressing concepts. An ASL signer can use the sign for "beautiful" to mean something is pretty, beautiful or lovely, but people signing in SEE will designate the specific meaning of the sign by signing the initial letter before moving on to the concept's sign. For example, a signer communicating the word "pretty" in SEE would first sign the letter "p" and then perform the ASL sign for "beautiful."

24

Chapter 3 Pakistan Sign Language & Proposed Hand Signs

3.1 Pakistan Sign Language


Pakistan Sign Language is a visual gestural language having its own vocabulary and syntax and like any other language, is subject to change, improvements and growth. It is important to note that sign language is influenced by spoken languages. When they interact with each other, variety of blends or combination of two languages occurs. Finger Spelling is a system of making expression visible with hand positions and configuration. Urdu language has 38 Urdu alphabets. There are 38 hand shapes to represent 38 Urdu alphabets. These hand shapes of alphabets are used for sending and receiving short messages. Hearing-impaired people in Pakistan use these hand shapes in Pakistan Sign Language vocabulary as a supplement to signing Urdu words, for example is expressed in finger spellings as .

Variations in spoken languages are natural which are originated from cultural and environmental background. Urdu is spoken in a different way in different regions of Pakistan. In the same way PSL has regional variations in number of items. One sign is acceptable in one region but not preferred in another region.

3.2 History and development of Pakistan Sign Language


The development of Pakistan Sign Language (PSL) has been a series of different initiatives by Pakistani scholars and sign language users over the course of time. Their pioneering works have been discussed below.

Pakistan Sign Language & Proposed Hand Signs

3.2.1 Sir Syed Deaf Association (SDA), Karachi


SDA has published dictionary of Pakistan Sign Language vocabulary, which was the result of efforts by Syed Iftikhar Ahmad. This dictionary contained 750 signs pertaining to different topics. The main problem of this effort was signs used in Rawalpindi region only. But this is an independent note worthy effort initiated the process in this area. One of the most important achievements of this project is to introduce single handed Urdu alphabetic finger spelling, which still has been used by deaf community without any controversy.

3.2.2 ABSA Research Project


ABSA (Anjuman-e-Behbood-e-Samat-e-Atfal) Research Group was established in 1986 with deaf and hearing adults as members. The aim of this group was to document and standardize the Pakistan Sign Language. In November 1986 with the support of the Norwegian Church Aid Organization and the Norwegian Association of the Deaf, ABSA group of deaf adults were given training by Odd-Inge Schroede, a research fellow in linguistic (sign language) at the Institute of Linguistic, University of Oslo and expert on the methodology of documenting sign language and sign language teaching. A one-month intensive training course was conducted at ABSA.

3.2.3 NISE Research Project


National Institute of Special Education (NISE), established in 1976, has the responsibility of manpower development for centers of special education throughout the country run by Federal Government, Provincial Governments, and Voluntary Welfare Organizations. In the earlier phase of the development of special education in Pakistan, attention was generally confined to the training of teachers. However, it was realized by NISE that the children in centers for hearing impaired were using all kinds of signs as means of communication. It was also realized that such the development of a unified sign language will have to be an integral part of a total communication approach, adopted by the Directorate General of Special Education (DGSE) as its official policy in 1990. 26

Pakistan Sign Language & Proposed Hand Signs

3.2.4 PAD Sign Language Research Group, Karachi


Pakistan Association of the Deaf (PAD), Karachi was established as a NGO through the efforts of a ten dynamic deaf youths as a club for deaf people who were through with their Matriculation and had nothing else to look forward to, in-terms of higher education or vocational training way back in 1987. PAD affiliated with the World Federation of the Deaf (WFD) in Pakistan.

3.2.5 Deaf Reach, FSF, Karachi


The head office of Family Educational Services Foundation (FESF) is based in Karachi. One of their most prominent programs in Karachi is Deaf Reach, a specialized training program for hearing-impaired youth and young adults which has been effectively operational since 1990. The Deaf Reach Training Center has successfully trained hundreds of deaf youth in English, communication skills, computer literacy and other vocational training.

27

Pakistan Sign Language & Proposed Hand Signs

3.3 Characteristics of the disabled Population of Pakistan


Table 2 Disability-wise breakup of the Pakistani population

The above statistics show that of the total 3.3 million disabled Pakistanis, 0.24 million suffer from hearing loss which is around 7.4% of the overall disabled population in the country. Also further analysis of figures reveals that 55% of the disabled are aged between age groups of 5 years to 29 years. This means that age structures among disabled persons are mainly either youthful or middle aged, just like the general population trends.

28

Pakistan Sign Language & Proposed Hand Signs

3.4 Proposed Hand Signs for our system


We decided to implement some hand sign from international sign language like American Sign Language (ASL), also included in Pakistani Sign language (PSL) and also some common gestures made by humans.

3.4.1 Proposed hand signs of ASL


Table 3 Selected Hand Signs from International Sign Language
Hand Sign One ASL

Two

Three

Four

Five

Six

Seven

Eight

Nine

Ten

29

Pakistan Sign Language & Proposed Hand Signs

3.4.2 Some common gestures selected are as follows

3.4.2.1 Victory

Figure 4 Victory Symbol

3.4.2.2 OK

Figure 5 OK Symbol

3.4.2.3 Turn left

Figure 6 Turn Left Symbol 3.4.2.4 Turn Right

Figure 7 Turn Right Symbol

30

Chapter 4 Speech Synthesis


4.1 Speech Synthesis
Speech Synthesis is the ability of a computer to produce spoken words. Computer speech can be produced either by splicing prerecorded words together or, with much more difficulty, by having the computer produce the sounds that make up spoken words. Speech synthesis is used today for interaction with the handicapped and for other special-purpose applications.

4.2 Methods of Speech Synthesis


Synthesized speech can be produced by several different methods. All of these have some benefits and deficiencies. The methods are usually classified into three groups: o Concatenative o Formant Synthesis o Articulatory Synthesis

4.2.1 Concatenative Synthesis


Connecting prerecorded natural utterances is probably the easiest way to produce intelligible and natural sounding synthetic speech. However, concatenative synthesizers are usually limited to one speaker and one voice and usually require more memory capacity than other methods. Building the unit inventory consists of three main phases. First, the natural speech must be recorded so that all used units (phonemes) within all possible contexts (allophones) are included. After this, the units must be labeled or segmented from spoken speech data, and finally, the most appropriate units must be chosen.

Speech Synthesis There are several problems in concatenative synthesis compared to other methods.
o

Distortion from discontinuities in concatenation points, which can be reduced using some special methods for smoothing signal.

Memory requirements are usually very high, especially when long concatenation units are used, such as syllables or words.

Data collecting and labeling of speech samples is usually time-consuming. In theory, all possible allophones should be included in the material, but tradeoffs between the quality and the number of samples must be made.

4.2.2 Formant Synthesis


It is based on the source-filter-model of speech. There are two basic structures in general, parallel and cascade, but for better performance some kind of combination of these is usually used. Formant synthesis also provides infinite number of sounds which makes it more flexible than for example concatenation methods. A cascade formant synthesizer consists of band-pass resonators connected in series and the output of each formant resonator is applied to the input of the following one. The cascade structure needs only formant frequencies as control information. The main advantage of the cascade structure is that the relative formant amplitudes for vowels do not need individual controls.

Figure 8 Basic structure of cascade formant synthesizer The cascade structure has been found better for non-nasal voiced sounds and because it needs less control information than parallel structure and it is then simpler to implement.

32

Speech Synthesis A parallel formant synthesizer consists of resonators connected in parallel. Sometimes extra resonators for nasals are used. The excitation signal is applied to all formants simultaneously and their outputs are summed. The parallel structures enable controlling of bandwidth and gain for each formant individually.

Figure 9 Basic structure of a parallel formant synthesizer The parallel structure has been found to be better for nasals, fricatives, and stopconsonants, but some vowels can not be modeled with parallel formant synthesizer as well as with the cascade one.

4.2.3 Articulatory synthesis


Articulatory synthesis tries to model the human vocal organs as perfectly as possible, so it is potentially the most satisfying method to produce high-quality synthetic speech. On the other hand, it is also one of the most difficult methods to implement. Advantages of articulatory synthesis are that the vocal tract models allow accurate modeling of transients due to abrupt area changes, whereas formant synthesis models only spectral behavior. The articulatory synthesis is quite rarely used in present systems, but since the analysis methods are developing fast and the computational resources are increasing rapidly, it might be a potential synthesis method in the future.

33

Speech Synthesis

4.3 Speech Processor (SP0256)


The SP0256-AL2 produces all 59 phonemes of the English language plus 5 pauses of different durations. Each of the phoneme's speech patterns are individually addressable, making the SP0256-AL2 capable of saying anything that can be said in the English language. This is the simplest approach to universal speech synthesis and the speech quality makes for a good robot voice.

Figure 10 Speech Processor SP0256-AL2

4.3.1 Features of SP0256-AL2


o Natural Speech o Stand Alone Operation with Inexpensive support Components o Wide Operating Voltage o Word, Phrase, or Sentence Library, ROM Expandable, Expandable to 491 K of ROM Directly o Simple Interface to Most Microcomputers or Microprocessors o Supports L.P.C. Synthesis: Formant Synthesis: Allophone Synthesis

4.3.2 The sp0256 Incorporates Four Basic Functions


o A software programmable digital filter that can be made to model a VOCAL TRACT. o A 16K ROM which stores both data and Instructions (THE PROGRAM). o A MICROCONTROLLER which controls the data flow from the ROM to the digital filter, the assembly of the word strings necessary for linking speech 34

Speech Synthesis elements together, and the amplitude and pitch information to excite the digital filter. o A PULSE WIDTH MODULATOR that creates A digital output which is converted to an analog signal when filtered by an external low pass filter.

4.3.3 Allophone Speech Synthesis


The allophone speech, synthesis technique provides the user with the ability to synthesize an unlimited vocabulary at a very low bit rate. Fifty-nine discrete speech sounds (called allophones) are five pauses are stored at different addresses in the SPO256 internal ROM. Each speech sound was excised from a word and analyzed using linear predictive coding (LPC). Any English word or phrase can be created by addressing the appropriate combination of allophones and pauses. Since there is a total of 64 address locations each require a 6 bit address. Assuming that speech contains 10 to 12 sounds per second, allophone synthesis requires addressing less than 100 bits per second.

4.3.4 How to use allophone set


For example, the word TWO can be implemented using the following allophones, TT2-W2-PA1. PA1 is actually not an allophone but a pause which is needed to end the word.

35

Chapter 5 Sensors
5.1 Sensors
Sensor is an electronic device used to measure a physical quantity such as temperature, pressure or loudness and convert it into an electronic signal of some kind (e.g. a voltage). Sensors are normally components of some larger electronic system such as a computer control or measurement system. Analog sensors most often produce a voltage proportional to the measured quantity. The signal must be converted to digital form with an ADC before the CPU can process it.

Figure 11 Sensors

Sensors

5.2 Application of Sensors


Sensors are used in everyday objects such as touch-sensitive elevator buttons and lamps which dim or brighten sensing the intensity of light. There are also innumerable applications for sensors of which most people are never aware. Applications include cars, machines, aerospace, medicine, manufacturing and robotics.

5.3 Properties of an Ideal Sensor


o An ideal sensor obeys the following rules: o Is sensitive to the measured property o Is insensitive to any other property o Does not influence the measured property

5.4 Need of Sensors in Our Design


We have to design a data glove that takes the input hand signs made by the user, to detect the hand signs we come across sensors to detect two types of hand motion (i-e Tilt measurement and bending of finger), we took a research on different sensors available.

5.5 Sensors Available


5.5.1 Tilt Measurement
A wide range of sensors are available for tilt measurement of the hand but we have to select the best suitable for our design. Some sensors for tilt measurement are listed below o Tilt Sensor o Accelerometer o Gyroscope

37

Sensors

5.5.2 Tilt Sensor


Tilt sensors are used in a variety of applications to detect the angular orientation of an object with respect to a reference, usually supplied by gravity. Many tilt sensors are of the electrolytic type. A tilt sensor is provided in survey instruments, aircraft, or automobiles, etc, to measure the tilt angle thereof. 5.5.2.1 Classification of Tilt Sensors In general, tilt sensors can be classified into two kinds. One is the single axis tilt sensor, and the other is the dual axis tilt sensor. The single axis tilt sensor measures the slant of one direction, whereas the dual one estimates the slant of a plane. 5.5.2.2 Construction of a Tilt Sensor The tilt sensor includes a sealed container which is comprised of, for example, a top cover plate in the form of a circular disc which is provided with a recessed surface, a circular bottom plate, and a cylindrical body.

Figure 12 Construction of a Tilt Sensor

5.5.3 Accelerometer
An accelerometer is an instrument for measuring acceleration, detecting and measuring vibrations, or for measuring acceleration due to gravity (inclination). Accelerometers can be used to measure vibration on vehicles, machines, buildings, process control systems and safety installations. They can also be used to measure seismic activity, inclination, machine vibration, dynamic distance and speed with or without the influence of gravity.

38

Sensors

Figure 13 Accelerometer 5.5.3.1 Kinds of Accelerometer The two kinds of basic accelerometers are: 5.5.3.2 Analog Accelerometer Analogue accelerometer outputs the analogue value as the change in acceleration. The main feature of this accelerometer is that the output tends to change when there is even a slight change in the input. 5.5.3.3 Digital Accelerometer The digital accelerometer is more sophisticated than the analog. Here the amount of high voltage time is proportional to the acceleration. One of its major advantages is that it is more stable and produces a direct output signal. 5.5.3.4 Piezoelectric Sensor These Accelerometers use piezoelectricity. In such accelerometers the acceleration is calculated based upon the charges derived from the microscopic crystalline structures when they are accelerated due to motion. 5.5.3.5 MEMS Accelerometer MEMS accelerometer works with capacitance and the changes initiated within it as a result of some accelerative force. This technology is used from automotive industry to agriculture industry and from NASA to military researches and operations.

39

Sensors 5.5.3.6 Uses of Accelerometer 5.5.3.7 Automotive Industry Due to high demand and wide spread use of accelerometers in the automotive industry and new hi-tech technology, these sensors are now light weight and are available at low cost and reduced prices. 5.5.3.8 Robotics The forces that can cause vibrations which are detected by the accelerometer can be static, dynamic or gravitational. Certain accelerometers are rated G. G stands for Gravity. Such accelerometers are used mostly in robotics. They are more sensitive to motion and can be triggered at the slightest changes in gravitational pulls.

5.5.4 Gyroscope
An instrument consisting of a heavy disk or wheel that spins rapidly about an axis. The angular momentum of the disk causes it to oppose change in the direction of its axis of rotation, due to the principle of conservation of angular momentum. Because of the gyroscope's tendency to remain oriented in one direction, it is used as a stabilizing device in missiles, as well as in the navigation and piloting systems of airplanes, ships, rockets, and other vehicles.

Figure 14 Spinning Axis of Gyroscope

40

Sensors 5.5.4.1 Applications


o o o o o o

Inertial Measurement Units (IMUs) Handheld GPS Navigation Devices Radio controlled helicopters Toys and game devices Robotic and power tools Antenna positioning

5.6 Bend Measurement


We have to measure the bend of finger that either finger is bend or straight, almost all the sensors available are the analogue, for this reason we have to convert the output to digital from ADC or by some other method before being sent to the processor. Some sensors for bend measurement are listed below o Optical Method o Flex Sensor o Flexible Stretch Sensors

5.6.1 Optical Method


It is based upon the process of Electrical Isolation 5.6.1.1 Basic Requirement o Dark tube mounted on the finger o Photo transistors, Light Source (e.g. LEDs) inside Dark tube 5.6.1.2 Working o If Photo transistor and light source in the line of sight (Finger normal position), maximum will be the output from photo transistor. o If finger is bending so variation caused , hence decrease in intensity of light over photo transistor so output goes low 41

Sensors

Figure 15 Optical Method Bend Measurement

5.6.2 Flex Sensors


Flex sensors are sensors that change in resistance depending on the amount of bend on the sensor. They convert the change in bend to electrical resistance. The more the bend, the more the resistance value. They are usually in the form of a thin strip from 1"-5" long that vary in resistance from approximately 10 to 50 k Ohms.

Figure 16 Flex Sensor

5.6.2.1 Working of Flex Sensors Flex sensors are analog resistors. They work as variable analog voltage dividers. Inside the flex sensor are carbon resistive elements within a thin flexible substrate. More carbon means less resistance. When the substrate is bent the sensor produces a resistance output relative to the bend radius. With a typical flex sensor, a flex of 0 degrees will give 10K resistance will a flex of 90 will give 30-40 K ohms. The Bend Sensor lists resistance of 30-250 K ohms.

42

Sensors

Figure 17 Working of Flex Sensors

5.6.2.2

Applications

Flex sensors are used in gaming gloves, auto controls, fitness products, measuring devices, assistive technology, musical instruments, joysticks, and more.

5.6.3 Flexible Stretch Sensors


The Stretch Sensor is a unique component that changes resistance when stretched. When relaxed the sensor material has a nominal resistance of 1000 ohms per linear inch.

Figure 18 Flexible Stretch Sensors

5.6.3.1 Working of Flexible Stretch Sensors As the stretch sensor is stretched the resistance gradually increases. When the sensor is stretched 50 % its resistance will approximately double to 2.0k Ohms per inch. The stretch sensor is a new way to measure stretch, displacement and force. The sensor is a flexible cylindrical cord .060-.070 in diameter, with electrical terminals at each end. 43

Sensors 5.6.3.2 Applications for the Stretch Sensors


o o o o o

Robotics Biometric displacement reading VR Gloves and VR suits Physics applications and experiments Feedback sensor for air muscles

5.7 5.8 Selected Sensors


Availability of sensors are limited in our country, almost all the sensors have to be imported for a particular application. Keeping in view our need and availability we selected accelerometer MMA7261Q for the tilt measurement and flex sensor (Jameco 150551) for the bend detection.

5.8.1 Accelerometer MMA7261Q


The MMA7261Q low cost capacitive micro machined accelerometer features signal conditioning, a 1-pole low pass filter, temperature compensation and g-Select which allows for the selection among 4 sensitivities. Zero-g offset full scale span and filter cut-off are factory set and require no external devices. Includes a Sleep Mode that makes it ideal for handheld battery powered electronics.

Figure 19 Accelerometer MMA 7261Q Evaluation Board

44

Sensors 5.8.1.1 Features


o o o o o o o o

Selectable Sensitivity (2.5g/3.3g/6.7g/10g) Low Current Consumption: 500 A Sleep Mode: 3 A Low Voltage Operation: 2.2 V 3.6 V Fast Turn On Time High Sensitivity (2.5 g) Integral Signal Conditioning with Low Pass Filter Robust Design, High Shocks Survivability

5.8.1.2 Typical Applications


o o o

HDD MP3 Player: Freefall Detection Laptop PC: Freefall Detection, Anti-Theft Cell Phone: Image Stability, Text Scroll, Motion Dialing, and ECompass

o o o o o

Pedometer: Motion Sensing PDA: Text Scroll Navigation and Dead Reckoning: E-Compass Tilt Compensation Gaming: Tilt and Motion Sensing, Event Recorder Robotics: Motion Sensing

Figure 20 Accelerometer Evaluation Board Orientation

45

Sensors

5.8.2 Flex Sensor


o Variable Resistance o Nominal resistance at rest o Resistance increases with bend o Voltage drop increases

Figure 21 Flex Sensor 5.8.2.1 Features


o o o o

Angle Displacement Measurement Bends and Flexes physically with motion device Simple Construction Low Profile

5.8.2.2 Possible Uses


o o o o

Robotics Gaming (Virtual Motion) Medical Devices Computer Peripherals

5.8.2.3 Electrical Specifications o Flat Resistance: 10K Ohms o Resistance Tolerance: 30% o Bend Resistance Range: 60K to 110K Ohms o Power Rating: 0.50 Watts continuous. 1 Watt Peak

46

Chapter 6 Hardware Designing


Hardware is the equipment involved in the function of a device. Hardware consists of the components that can be physically handled. Hardware basically includes three basic categories that are Input Hardware, Processing unit and the Output Hardware

6.1 Input Hardware


Input hardware consists of external devices that are responsible for providing information to the controlling unit from the outside world. Input Hardware of the Virtual Speaker includes the sensors hooked on the glove and the keypad. Further more there are two types of sensors, flex sensors and the accelerometer. Input hardware also includes the interfacing circuitry of sensors with the controlling unit.

6.2 Processing Unit


Processing unit takes the data from the input modules, processes it and sends the data to the output modules. The processing unit in the Virtual Speaker is the microcontroller 89c51.

6.3 Output Hardware


Output hardware consists of the devices that transfer information from the controlling unit to the outside world. The output hardware of the Virtual Speaker includes the Speech Processor, the voice amplification circuitry and the interfacing of the LCD.

Process diagram will briefly explain the process flow of the system and the hardware components involved in the design of Virtual Speaker.

Hardware Designing

INPUTS
GLOVE (Flex sensors, Accelerometer)
TEXT ENTRY

CONTROLLING UNIT
Hand Sign Detection Algorithm Word recognition Algorithm

OUTPUTS
VOICE GUI

Figure 22 Process Diagram

6.4 Block Diagram


Final block diagram includes three main modules as explained in detail in the first chapter.

Figure 23 Block Diagram 48

Hardware Designing

6.5 Hardware Implementation


This chapter will include all the details regarding the schematics, simulations, and practically implemented circuits. All the hardware implemented by us is followed by the simulation in the software (Proteus).

6.5.1 Basic Hardware


We started implementing the basic hardware of the Virtual Speaker that includes keypad, GUI and the controlling unit with starting software (main menu) embedded on it.

6.5.1.1 Keypad functionality: Keypad is used to control the program in an organized way since it is the input to the control unit also it is used to decide the mode which we want to choose. Additionally it is used to input the text in the Text Mode of the input.

Figure 24 Keypad Functionality

49

Hardware Designing 6.5.1.2 GUI LCD holds its importance in the output module from the beginning of the program, showing the main menu of the program. LCD also guides the user to interact with the system by properly displaying all the activities. It will be displaying the Hand signs and also the angle measured from an accelerometer.

6.5.1.3 Software Implementation of Basic Hardware Including Keypad and GUI When we started working on our hardware we simulated our hardware and controller program in software to get the assurance about the validation of our hardware. Snapshots of the schematic are given.

Figure 25 Schematic of Basic Hardware Including Keypad and GUI

50

Hardware Designing 6.5.1.4 Basic Hardware Including Keypad and GUI Snapshot of the practically implemented hardware is given below. This work is completed successfully in the first phase of the project.

Figure 26 Basic Hardware Including Keypad and GUI

6.5.2 Bend Detection


Bend detection is required to sense the position of the finger either it is bend or in normal position. We selected the Flex Sensor for this purpose that changes its resistance when bend this will appear as a potential drop when the supply and ground connections are properly applied.

51

Hardware Designing 6.5.2.1 Schematic of Flex Sensor

Figure 27 Flex Sensor Pins

Second task is to convert this analogue output to the digital, the use of transistor as a switch can a successful way of converting the output to any of the two binary states 0 or 1 (bend or stretch). To use the transistor as a switch the input analogue signal is applied at the base of transistor when the resistance is less the transistor will not switch ON or it will be in cut-off mode, output at the collector will be high. As we bend the finger the resistance of flex sensor increases and more current will flow to the base, transistor in saturation mode and the output at the collector will be low.

6.5.2.2 Software Implementation of Bend Detection We implemented the digital switch with the input signal from a variable resistor (same as the bend sensor) at it base and the output connected to the collector of the transistor. We get two modes of output each representing the position of the figure.

52

Hardware Designing 6.5.2.3 Finger Normal position

Figure 28 Proteus Simulation Transistor in Cut-off mode

6.5.2.4 Finger Bent

Figure 29 Proteus Simulation Transistor in saturation mode 53

Hardware Designing 6.5.2.5 Bend Detection Circuit Practically implemented circuit after is shown in the snapshot.

Figure 30 Practically Implemented Bend Detection Circuit

6.5.3 Symbol Detection


Software implementation of the symbol detection using the open/close switch in place for flex sensor bend detection circuit was implemented successfully with the symbol Done snapshot of the schematic of symbol detection circuit is given below.

Figure 31 Schematic for Symbol Detection

54

Hardware Designing

6.5.4 Tilt Measurement


Second motion we have to measure is the orientation of hand or the tilt of the hand. Sensor selected for this measurement is the accelerometer MMA7261Q. Tilt measurement started with the testing of accelerometer, implementing the tilt angle measurement with ADC in the software and at last finally implementing the final circuit.

6.5.4.1 Accelerometer MMA7261Q The evaluation board has pads for interfacing to a 3.3 V power source or battery. The pads on the side of the board also provide a means for connecting to the accelerometer analog output by soldering a wire from the evaluation board to another breadboard or system. The ON/OFF switch provides power to the accelerometer and helps preserve battery life if a battery is being used as the power source. S1 must be set towards the ON position for the accelerometer to function. The green LED labeled PWR is lit when power is supplied to the accelerometer.

Figure 32 Accelerometer MM7161Q Board 6.5.4.2 Testing of Accelerometer 1. Connect the external power source to the Evaluation board. The 3.3 V input is connected to the POWER (Vdd) and Ground (Vss) using the solder pads.

55

Hardware Designing 2. Note that the Main Power LED will turn on when the Main Board Switch is turn ON. 3. Next use a pointed object to turn the Sleep Mode Dipswitch to the ON position. You will notice that the Sleep Mode LED will light up once the Sleep Mode Dip Switch is turned to the ON position. This means that the device will have X, Y, and Z outputs on the output pads. Sleep mode will actually be disabled and the device is now active. When OFF, no output voltages should be seen, and the LED will be off. This will mean the board is in Sleep Mode, in low power consumption. 4. Start to measure the voltages on the X, Y, and Z axes. Solder these pads to your microcontroller A/D terminals or other measuring devices.

6.5.4.3 Angle Measurement 6.5.4.4 ADC 0804 The easiest way to do analog to digital conversion is to use an IC such as the ADC0804 that does the work for you. The analog voltage from the accelerometer zaxis output pad is applied to pin 6 and the result is available at pins 11 through 18. We will connect pin 1 (Chip Select) to ground so that the chip is always enabled. If you wanted to use more than one ADC you could use this pin to control which chip is currently enabled. Connect pin 7 (Vin -) to ground. The ADC0804 includes an internal oscillator which requires an external capacitor and resistor to operate. Connect the 150 pF capacitor from pin 4 (CLOCK IN) to ground and the 10k ohm resistor from pin 4 to pin 19 (CLOCK R). Strobing (low to high) to write (WR) signal low for ADC to take the input data and start conversion, Wait for INTR pin to go low (means conversion ends). Once the conversion in ADC is done, data can be made available at the output port by strobing (high to low) to read (RD) signal.

56

Hardware Designing 6.5.4.5 Software Implementation of Angle Measurement Snapshot of the schematic of the angle measurement is shown.

Figure 33 Schematic for Angle Measurement

6.5.4.6 Angle Measurement Successful software implementation leads us to the hardware implementation and testing of the above circuit. Practically implemented circuit is shown below.

Figure 34 Practically Implemented Angle Measurement Circuit 57

Hardware Designing

6.5.5 Speech Generation


The General Instruments SP0256 Speech Processor is an IC that can make any of the speech sounds in the English language. The allophone speech, synthesis technique provides the user with the ability to synthesize an unlimited vocabulary at a very low bit rate. Fifty-nine discrete speech sounds (called allophones) are five pauses are stored at different addresses in the SPO256 internal ROM. Any English word or phrase can be created by addressing the appropriate combination of allophones and pauses. Since there is a total of 64 address locations each require a 6 bit address. To make the speech processor work it is interfaced with the microcontroller that gives the address of allophones to be spoken on to the address lines of sp0256. A complete word will have allophones more than one. Speech Processor generates voice by concatenating the selected allophones and the addresses of allophones can be found from the data sheet of SP0256-AL2.

6.5.5.1 Schematic SP0256-AL2

Figure 35 Schematic SP0256-AL2 58

Hardware Designing

6.5.5.2 Practically Implemented Circuit SP0256-AL2

Figure 36 Practically Implemented Circuit SP0256-AL2

6.5.6 Amplification Circuitry


Amplification is very necessary for the voice to be heard in a noisy environment we selected the UTC TEA2025 for this purpose. It comes in 16-pin plastic dual in line package.

Figure 37 DIP 16 UTC TEA 2025

59

Hardware Designing 6.5.6.1 Main Features o Working Voltage down to 3V o Few External components o High Channel isolation o Voltage gain up to 45dB(Adjustable with external resistor) o Internal Thermal protection

6.5.6.2 Schematic of Amplification Circuit

Figure 38 Schematic UTC TEA 2025

6.5.6.3 Practically Implemented Amplification Circuit

Figure 39 Practically Implemented Circuit Audio Amplification 60

Hardware Designing

6.6 Designing the Architecture


Architecture is a general term referring to the structure of all or part of a system. The term also covers the design of system software, as well as referring to the combination of hardware. Architecture refers to an entire structure and to the details needed to make it functional. 3.3V Regulator Accelerometer ADC

Figure 40 System Architecture Flex Sensors Controlling Unit

Keypad

Controlling Unit

GUI

Input 5V

Controlling Unit, Flex Sensors, GUI

Controlling Unit

GUI

Speech Processor Amplifier Speaker

3.5 mm

61

Hardware Designing

6.6.1 Final Schematic

Figure 41 Final Schematic 62

Hardware Designing

6.6.2 Practically Implemented and Integrated Hardware

Figure 42 System Architecture Practically Implemented

Figure 43 System Architecture Practically Implemented 63

Hardware Designing

6.7 Final Outlook

Figure 44 Final Outlook

64

Chapter 7 Software Designing


Software is a computer programs or the set of instructions that cause the hardware to do work.

7.1 Software Development


A programmer uses program called a text editor to write the new program in a special notation called a programming language. With the text editor, the programmer creates a text file, which is an ordered list of instructions, also called the program source file. The individual instructions that make up the program source file are called source code. At this point, a special applications program translates the source code into machine language that the microcontroller will recognize as a proper program and be able to execute. Three types of applications programs translate from source code to object code: compilers, interpreters, and assemblers. The three operate differently and on different types of programming languages, but they serve the same purpose of translating from a programming language into machine language This whole program development procedure is embedded in single software (Keil), where the procedures are written in text editor directly in Assembly language or in C language and it automatically generates the .HEX file needed by the controlling unit to execute.

7.2 Programming the Controlling Unit


Programming the controlling unit is the set of instructions that directs a controlling unit to perform some processing function or combination of functions. For the instructions to be carried out, a controlling unit must execute a program, that is, the controlling unit reads the program, and then follows the steps encoded in the program in a precise order until completion. A program can be executed many different times,

Conclusion and Future Enhancement with each execution yielding a potentially different result depending upon the options and data that the user gives the controlling unit.

7.3 Main Program Flow


Our first task in designing the software is to design the flow of the main program. First of all the main menu is displayed and any of two modes can be selected by taping the keypad, there a decision is made on the key pressed by the user, if the pressed key is 1 Text Mode will be selected and if the pressed key is 2 Hand Movement Mode will be selected. In the Text mode user can enter a word or a sentence by multi-tapping the keypad, multi-tapping of the keypad is programmed to recognize the alphabets. For example if a key 1 is tapped once alphabet is taken as A, if tapped twice alphabet is taken as B, if tapped thrice alphabet is taken as C. Once a complete word or a sentence is written user will press the send key, to ask the controlling unit to start analyzing the string of alphabets and if word is not found in the dictionary display the proper message and if the string is recognized send the string of alphabets to the speech synthesis module for voice generation. In the hand movement mode the controlling unit will start receiving data of different sensors from the glove and compares the data with data of hand signs stored in the dictionary, if the hand sign is matched with the stored one it will be displayed on the GUI and also sent to the speech synthesis module for voice generation. Once a hand sign or a word/ sentence is recognized and matched by those stored in the dictionary speech synthesis module will generate the allophones and instructs the speech processor properly to produce the voice. The flow chart blew explain in a better way.

66

Conclusion and Future Enhancement

Start

Input Keypad

Key = 1 if key = ?

Key = 2

Analyzing Alphabets

Hand Movement Mode

Recognizing Words

GUI

Hand Sign Detection

Sending word to Speech Processor

Allophones Generation

Output Speech

No if clr

No

Yes

Figure 45 Flow Chart for the Main Program Flow 67

Conclusion and Future Enhancement

7.4 Programming the ADC


ADC is used to convert the analogue output of accelerometer to the digital for the angle measurement. Programming the ADC involves selecting the control pins and the proper calibration of the angle. You need a minimum of 11 pins to interface ADC0804, eight for data pins and 3 for control pins. As shown in the typical circuit the chip select pin can be made low if you are not using the microcontroller port for any other peripheral (multiplexing). First of all strobing (low to high) to write (WR) signal low for ADC to take the input data and start conversion, Wait for INTR pin to go low (means conversion ends). Once the conversion in ADC is done, the data is available in the output latch of the ADC. Data of the new conversion is only available for reading after ADC0804 made INTR pin low or say when the conversion is over. The data can be made available at the output port by strobing (high to low) to read (RD) signal. Read the data from port where ADC is connected. The flow chart blew explain in a better way.
Start

CS = 0 Low to High pulse to WR

Input INTR

No

if INTR == 0

Yes CS = 0 High to Low pulse to RD

Output Data

Figure 46 Flow Chart for the Programming of ADC 68

Conclusion and Future Enhancement

7.5 Hand Sign Detection


Once successfully measuring the tilt angle from the accelerometer, Third task is to design software for the complete detection of the hand sign from the input data from flex sensor and accelerometer. The flow chart blew explain in a better way.
Start

Input Keypad

if key = ? Key = 2 Hand Movement Mode

Input Flex Sensors

Input Accelerometer

Analogue to Digital Conversion

Angle Measurement No

if valid sign =? GUI Yes

Yes Speech Synthesis

Output Speech

No

if clr

Yes

Figure 47 Flow Chart for Hand Sign Detection 69

Conclusion and Future Enhancement

7.6 Speech Generation using Speech Processor


Speech processor generates a voice by concatenating the allophones, allophones are stored in the speech processor by default, and our task is to break the word into allophones furthermore decodes their addresses from data sheet placing its address on the SP0256-AL2 address bus and strobing (high to low) the ALD line. If the address buffer is full, the LRQ line will go high, so we should check it before loading another allophone address. The flow chart blew explain in a better way.
Start

Input Load Request

Yes

if LRQ == 1 No

Generates Allophones addresses

Low to High pulse to ALD

Output Speech

Figure 48 Flow Chart for the Programming of Speech Processor

70

Conclusion and Future Enhancement

7.7 Programming the LCD


LCD holds its importance in the output module from the beginning of the program, showing the main menu of the program. Steps in programming LCD involves initializing the LCD, selecting the control pins according to the mode of operation and finally sending the data on the data pins to be displayed. Standard LCD requires three control lines (EN, RS, and RW) and eight I/O lines for the data bus. The EN line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should make sure this line is low (0) and then set the other two control lines and put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for the minimum amount of time required by the LCD datasheet, and end by bringing it low (0) again. The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which should be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high. The RW line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write commands--so RW will almost always be low. Finally, the data bus consists of 8 lines. 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7. The flow chart blew explain in a better way.

71

Conclusion and Future Enhancement

Start

Initialize LCD

R/W = 1 RS = 0 Low to High pulse to Enable

Input D7

No

if D7 == 1 Yes

No

Output Data

GUI

Output Data

R/W = 0 RS = 1 High to Low pulse to Enable

R/W = 0 RS = 0 High to Low pulse to Enable

Figure 49 Flowchart for Programming of the LCD

72

Chapter 8 Conclusion and Future Enhancement


8.1 Conclusion
In our project we aim for designing a smart communication device to remove the communication gap between disables and normal person by designing data glove that senses the orientation of hand and bend of fingers to make decision about the hand sign and speech synthesis is obtained by interfacing the speech processor with the controlling unit to produce the voice, by the grace of ALLAH Almighty the aims and objectives we approaches at the start are completed successfully.

8.2 Future Enhancement


Any thing in the world is not perfect, so is our project. Future enhancements are possible that would better and accurately implement the same application and the data glove designed can be used for another application. Also the data glove can be redesigned to achieve the more accuracy in the output. o Flex sensors can be interfaced with ADC to get for accurate measurements from the glove. Multichannel ADC such as ADC0808 can be used for this purpose. o The all the three axis x, y, z of an accelerometer can be utilized for taking the precise measurements. o Dynamic acceleration of an accelerometer can be taken into account for showing the waving hand signs like bye- bye. o For the communication of blind with the deaf, the voice of blind person can be recognized by a smart system and displayed as a hand sign for a deaf person to understand. o A data glove used in communication can be used at a same time for another application such as computer mouse movement control, robotic arm control etc.

Conclusion and Future Enhancement o Instead of using a data glove image processing can be used to recognize the hand signs. o Voice can be generated by utilizing the Microsoft sound development kit included in windows; this requires the system to be dependant on pc. o A wireless interface between the sensor data glove and the controlling unit can be achieved. o The controlling unit can be replaced by FPGA or DSP to increase the memory instead of using multiple 89C51 microcontrollers.

74

Chapter 9 Appendix
Appendix A 89c51 Micro-controller A.1 Pin Configuration 89c51

Appendix

Appendix B
B.1

Accelerometer

Description of Input /Output Pins of Accelerometer

B.2 g-select Table for Accelerometer

76

Appendix

Appendix C
C.1

ADC 0804

Pin Configuration ADC 0804

Appendix D
D.1

LCD

Pin Configuration LCD

77

Appendix

D.2

Pin Description LCD

D.3

Instruction Table

78

Appendix

Appendix E
E.1

Speech Processor (SP0256)

Pin Configuration SP0256-AL2

E.2

Dictionary of SP0256 Allophones

79

Appendix

80

Appendix

E.3 Allophones Address Table

81

Appendix

Appendix F
F.1

Audio Amplifier UTC TEA2025

Pin Configuration UTC TEA 2025

Appendix G Voltage Regulator


G.1 Pin Configuration LF33cv

82

Appendix

Appendix H Source Code


H.1 C Language Source Code for keypad and LCD

#include < reg52.h > #include < stdlib.h> #include < stdio.h > void lcd_cmd_reg(unsigned char lcd_cmd); void lcd_out(unsigned char lcd_value); void lcd_ready(); void init_lcd(); void init_msg(); void control(unsigned char *kyy, unsigned char data_3); unsigned char correct_key(unsigned char txt_ky); void Spkr_main_menu(); void menu_dcde(unsigned char kpad_out); void hand_entrance(); void text_entrance(); void s_delay(); unsigned char lcd_value=0x80; unsigned char text_data=0x00; unsigned char text_data2=0x00; unsigned char value=0x00; unsigned char cntr_out_value=0x00; unsigned char cntr_out_value2=0x00; sfr key_in = 0x90; sfr lcddata_out=0xA0; sbit check_bit=P2^7; sbit rs=P3^5; sbit rwlcd=P3^6; sbit en=P3^7; void trnsmt(unsigned char x); sbit hand_on=P3^3; // Used for activating hand's motion on // Register Select for LCD // Read/Write select for LCD // Enable bit for LCD // Address for port 1, here defining hex values // For data sending to LCD, P2 // for command registers to LCD

Microcontroller 2, by pulling this pin low sbit hand_off=P3^4; unsigned int i; // Used to off, by pulling this low

83

Appendix
unsigned int j; unsigned int counter=0; // For counting digits to be entered, not more then 4 unsigned int cntr_out=0; unsigned int remaining=0; unsigned char ky_1[3]={'A','B','C',}; unsigned char ky_2[3]={'D','E','F'}; unsigned char ky_3[3]={'G','H','I'}; unsigned char ky_4[3]={'J','K','L'}; unsigned char ky_5[3]={'M','N','O'}; unsigned char ky_6[3]={'P','Q','R'}; unsigned char ky_7[3]={'S','T','U'}; unsigned char ky_8[3]={'V','W','X'}; unsigned char ky_9[3]={'Y','Z',0x20}; unsigned char out[11]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20}; unsigned char letter_1[4]={'A','B'}; unsigned int clr_ky_cntr=0; // For correct storage of value in output buffer

void main() { TMOD = 0x20; TH1 = -3; //0xFC;

SCON = 0x40; // setup serial port control, 8-bit UART TR1=1; init_lcd(); init_msg(); while ( 1 ) { Spkr_main_menu(); } } void init_lcd() { lcd_cmd_reg(0x38); lcd_cmd_reg(0x0C); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); } void init_msg() // Timer 1 Started

84

Appendix
{ unsigned char msg_init[]="VIRTUAL SPEAKER"; unsigned char msg_init2[]="(1)TEXT(2)HAND"; for (i=0; i<15; i++) { s_delay(); lcd_out(msg_init[i]); } lcd_cmd_reg(0xC0); for (j=0; j<14; j++) { s_delay(); lcd_out(msg_init2[j]); } } void Spkr_main_menu() { unsigned char key_data; // logic for detection of pressed key key_in=0xFE; key_data=key_in; if ( key_in == 0xFE ); // no key pressed else if ( key_in == 0xEE ) { text_entrance(); } else if ( key_in ==0xDE ) { hand_entrance(); } else; } // pulling high all columns for getting input

void text_entrance() { unsigned char msg_txt[]="TEXT MODE"; unsigned char msg_init[]="VIRTUAL SPEAKER";

85

Appendix
unsigned char msg_init2[]="(1)TEXT(2)HAND"; unsigned char msg_init3[]="SENDING..."; lcd_cmd_reg(0x01); lcd_cmd_reg(lcd_value); for (i=0; i<9; i++) { s_delay(); lcd_out(msg_txt[i]); } s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); lcd_cmd_reg(0x01); lcd_cmd_reg(0x0D); lcd_cmd_reg(lcd_value); text_data=0x00; while ( text_data != 0xAA ) { key_in = 0xFE; // taking input from row 1 text_data = key_in; text_data=correct_key(text_data); if ( text_data == 0xEE ) { control(ky_1,0xFE); } else if ( text_data == 0xDE ) { control(ky_2,0xFE); } else if ( text_data == 0xBE ) { control(ky_3,0xFE); } else; key_in = 0xFD; // taking input from row 2 // if exit pressed so back to main menu // for clearing LCD // for cursor on

86

Appendix
text_data = key_in; text_data=correct_key(text_data); if ( text_data == 0xED ) // if key 1 is pressed { control(ky_4,0xFD); } else if ( text_data == 0xDD ) { control(ky_5,0xFD); } else if ( text_data == 0xBD ) { control(ky_6,0xFD); } else key_in = 0xFB; text_data = key_in; text_data=correct_key(text_data); if ( text_data == 0xEB ) { control(ky_7,0xFB); } else if ( text_data == 0xDB ) { control(ky_8,0xFB); } else if ( text_data == 0xBB ) { control(ky_9,0xFB); } else key_in = 0xF7; text_data = key_in; text_data=correct_key(text_data); if ( text_data == 0xE7 ) { if (lcd_value == 0x80 ); // if at start then cant erase // just here for control not for data

87

Appendix
else { lcd_cmd_reg(0xC0); lcd_cmd_reg(0x0C); for (j=0; j<15; j++) { lcd_out(0x20); } lcd_cmd_reg(lcd_value); out[cntr_out]=0x20; cntr_out=(cntr_out) - 1; lcd_value--; lcd_cmd_reg(0x0D); lcd_cmd_reg(lcd_value); lcd_out(0x20); s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); } } else if ( text_data == 0xB7 ) { if (cntr_out << 11 ) { for ( j=cntr_out; j<11; j++) { out[j]=0x20; } } else { } if ( out[0] == ky_1[0] ) { lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<8; i++) // for clearing LCD // for clearing LCD

88

Appendix
{ s_delay(); lcd_out(msg_init3[i]); } for (j=0; j<=cntr_out; j++) { s_delay(); lcd_out(out[j]); } cntr_out=0; text_data = 0xAA ; lcd_value=0x80; } else if ( (out[0] == ky_2[1]) && (out[1] == ky_8[2]) && (out[2] == ky_3[2]) && (out[3] == ky_7[1])&& (out[4] == 0x20)&& (out[5] == 0x20)&& (out[6] == 0x20)&& (out[7] == 0x20)&& (out[8] == 0x20)&& (out[9] == 0x20) && (out[9] == 0x20)) // for EXIT { lcd_cmd_reg(0x01); lcd_cmd_reg(0x0C); lcd_cmd_reg(0x80); for (i=0; i<15; i++) { s_delay(); lcd_out(msg_init[i]); } lcd_cmd_reg(0xC0); for (j=0; j<14; j++) { s_delay(); lcd_out(msg_init2[j]); } cntr_out=0; text_data = 0xAA ; lcd_value=0x80; } // for clearing LCD // for clearing LCD

89

Appendix
else if ( (out[0] == ky_3[2]) && (out[1] == 0x20) && (out[2] == ky_1[2]) && (out[3] == ky_1[0]) && (out[4] == ky_5[1])&& (out[5] == 0x20)&& (out[6] == ky_7[0])&& (out[7] == ky_6[0])&& (out[8] == ky_2[1])&& (out[9] == ky_1[0])&& (out[10] == ky_4[1])) // for I CAN SPEAK { lcd_cmd_reg(0x0C); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<10; i++) { s_delay(); lcd_out(msg_init3[i]); } trnsmt(0x01); s_delay(); s_delay(); s_delay(); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<15; i++) { s_delay(); lcd_out(msg_init[i]); } lcd_cmd_reg(0xC0); for (j=0; j<14; j++) { s_delay(); lcd_out(msg_init2[j]); } cntr_out=0; text_data = 0xAA ; lcd_value=0x80; } else if ( (out[0] == ky_3[1]) && (out[1] == ky_3[2]) && (out[2] == 0X20) && (out[3] == 0X20) && (out[4] == 0X20)&& (out[5] == 0X20)&& (out[6] == 0X20)&& (out[7] == 0X20)&& (out[8] == 0X20)&& (out[9] == 0X20)&& (out[10] == 0X20)) // for HI // for clearing LCD // for clearing LCD // CURSOR off // for clearing LCD // for clearing LCD

90

Appendix
{ lcd_cmd_reg(0x0C); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<10; i++) { s_delay(); lcd_out(msg_init3[i]); } trnsmt(0x06); s_delay(); s_delay(); s_delay(); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<15; i++) { s_delay(); lcd_out(msg_init[i]); } lcd_cmd_reg(0xC0); for (j=0; j<14; j++) { s_delay(); lcd_out(msg_init2[j]); } cntr_out=0; text_data = 0xAA ; lcd_value=0x80; } else { lcd_cmd_reg(0x0C); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); // for CURSOR off // for clearing LCD // starting LCD from 1nd Line // for clearing LCD // for clearing LCD // CURSOR off // for clearing LCD // for clearing LCD

lcd_out(ky_8[1]); s_delay();

91

Appendix
lcd_out(ky_6[2]); s_delay(); lcd_out(ky_5[2]); s_delay(); lcd_out(ky_5[1]); s_delay(); lcd_out(ky_3[0]); s_delay(); lcd_out(0x20); s_delay(); lcd_out(ky_2[1]); s_delay(); lcd_out(ky_5[1]); s_delay(); lcd_out(ky_7[1]); s_delay(); lcd_out(ky_6[2]); s_delay(); lcd_out(ky_9[0]); s_delay(); lcd_cmd_reg(0xC0); // starting LCD from 2nd Line

lcd_out(ky_7[1]); s_delay(); lcd_out(ky_6[2]); s_delay(); lcd_out(ky_9[0]); s_delay(); lcd_out(0x20); s_delay(); lcd_out(ky_1[0]); s_delay(); lcd_out(ky_3[0]); s_delay(); lcd_out(ky_1[0]); s_delay(); lcd_out(ky_3[2]); s_delay();

92

Appendix
lcd_out(ky_5[1]); s_delay(); s_delay(); cntr_out=0; lcd_cmd_reg(0x01); text_data = 0x00 ; lcd_value=0x80; lcd_cmd_reg(0x0D); } } else; } } unsigned char correct_key(unsigned char txt_ky) nothing { if ( txt_ky == 0xFE ); else if ( txt_ky == 0xEE ) { return ( txt_ky ); } else if ( txt_ky == 0xDE ) { return ( txt_ky ); } else if ( txt_ky == 0xBE ) { return ( txt_ky ); } else if ( txt_ky == 0xED ) { // just for detection and doing // for clearing LCD

return ( txt_ky ); } else if ( txt_ky == 0xDD ) {

93

Appendix
return ( txt_ky ); } else if ( txt_ky == 0xBD ) { return ( txt_ky ); } else if ( txt_ky == 0xEB ) { return ( txt_ky ); } else if ( txt_ky == 0xDB ) // for key=8 that is for changing letters { return ( txt_ky ); } else if ( txt_ky == 0xBB ) { return ( txt_ky ); } else if ( txt_ky == 0xB7 ) { return ( txt_ky ); } else if ( txt_ky == 0xD7 ) { return ( txt_ky ); } else if ( txt_ky == 0xE7 ) { return ( txt_ky ); } else; } void control(unsigned char *kyy,unsigned char data_3 { if ( lcd_value <= 0x8A ) { lcd_cmd_reg(0xC0); // for exit key // for deleting key // for sending key // for key=9 pressed

94

Appendix
lcd_cmd_reg(0x0C); for (j=0; j<15; j++) { lcd_out(0x20); } lcd_cmd_reg(0x0D); lcd_cmd_reg(lcd_value); lcd_out(kyy[0]); counter=1; cntr_out_value=kyy[0]; s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); while ( text_data !=0xAB ) { key_in = data_3; text_data2 = key_in; text_data2 = correct_key(text_data2); if ( text_data2 == text_data ) { //when first time comes here so counter = 1 if ( counter == 0 ) { lcd_cmd_reg(lcd_value); lcd_out(kyy[0]); cntr_out_value=kyy[0]; counter++; s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); } else if ( counter == 1 ) { lcd_cmd_reg(lcd_value); lcd_out(kyy[1]);

95

Appendix
cntr_out_value=kyy[1]; counter++; s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); } else if ( counter == 2 ) { lcd_cmd_reg(lcd_value); lcd_out(kyy[2]); cntr_out_value=kyy[2]; counter=0; s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); } }

else; key_in = 0xF7; text_data2 = key_in; text_data2 = correct_key(text_data2); if ( text_data2 == 0xD7 ) { out[cntr_out]=cntr_out_value; lcd_value++; value = 0xAB; text_data = value ; s_delay(); s_delay(); s_delay(); s_delay(); s_delay();

96

Appendix
cntr_out++; } else; }

} else { for ( i=0; i<4; i++ ) { lcd_cmd_reg(0x0C); lcd_cmd_reg(0xC0); // for CURSOR off // starting LCD from 2nd Line

for (j=0; j<15; j++) { lcd_out(0x20); }

s_delay(); s_delay(); lcd_cmd_reg(0xC0); // starting LCD from 2nd Line

lcd_out(ky_6[2]); lcd_out(ky_1[0]); lcd_out(ky_5[1]); lcd_out(ky_3[0]); lcd_out(ky_2[1]); lcd_out(0x20); lcd_out(ky_5[2]); lcd_out(ky_7[2]); lcd_out(ky_7[1]); lcd_out(0x20); lcd_out(0X5B); lcd_out(ky_1[2]); lcd_out(ky_4[2]); lcd_out(ky_6[2]); lcd_out(0X5D); s_delay(); s_delay();

97

Appendix
} value = 0xAB; text_data = value ; } } void hand_entrance() { unsigned char msg_hand[]="HAND MOTION"; unsigned char msg_init[]="VIRTUAL SPEAKER"; unsigned char msg_init2[]="(1)TEXT(2)HAND"; unsigned char hand_exit_key; hand_on = 0 ; hand_off = 1 ; lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); for (i=0; i<11; i++) { s_delay(); lcd_out(msg_hand[i]); } s_delay(); s_delay(); s_delay(); key_in = 0xF7; hand_exit_key=key_in; while ( hand_exit_key != 0xE7 ) { key_in = 0xF7; hand_exit_key=key_in; } hand_on = 1 ; hand_off = 0 ; lcd_cmd_reg(0x01); lcd_cmd_reg(0x0C); lcd_cmd_reg(0x80); for (i=0; i<15; i++) { // for clearing LCD

98

Appendix
s_delay(); lcd_out(msg_init[i]); } lcd_cmd_reg(0xC0); for (j=0; j<14; j++) { s_delay(); lcd_out(msg_init2[j]); }

} void lcd_out(unsigned char lcd_value) { lcd_ready(); lcddata_out=lcd_value; rs=1; rwlcd=0; en=1; en=0; } void lcd_cmd_reg(unsigned char lcd_cmd) { lcd_ready(); lcddata_out=lcd_cmd; rs=0; rwlcd=0; en=1; en=0; } void lcd_ready() { check_bit=1; rs=0; rwlcd=1; en=0; en=1; while ( check_bit==1 ) {

99

Appendix
en=0; en=1; } } void trnsmt(unsigned char x) { SBUF = x; while ( TI == 0 ) ; TI = 0; } void s_delay() { unsigned int j; for (j=0; j<19000; j++); }

H.2

C Language Source Code for Hand Sensing

#include<reg52.h> #include <stdio.h> #include <string.h> #include <stdlib.h> void lcd_cmd_reg(unsigned char lcd_cmd); LCDvoid lcd_out(unsigned char lcd_value); void lcd_ready(); void delay(); void s_delay(); void init_lcd(); void init_msg(); sfr lcddata_out=0xA0; sbit check_bit=P2^7; sbit rs=P3^3; sbit rwlcd=P3^4; sbit en=P3^5; void getdata(); void outdata( unsigned char *output ); void sensing_on(); // Register Select for LCD // Read/Write select for LCD // Enable bit for LCD // For data sending to LCD, P2 // used for strings declaration, but not needed here

100

Appendix
sbit thumb=P0^0; sbit index=P0^1; sbit mid=P0^2; sbit mid_nxt=P0^3; sbit smal=P0^4; sbit chk_on= P3^7; sbit chk_off= P3^2; unsigned char adc_scan(); void adc_calc(unsigned char stored); sfr getadc=0x90; sbit rd=P0^5; sbit wr=P0^6; sbit intr=P0^7; unsigned int angle; void s_delay(); unsigned char datta[5]; unsigned int i; unsigned char message_1[]="SEARCHING"; unsigned char message_3[17]={'D','O','N','E','V','I','C','T','R','Y','U','L','F','G','H','A','K'}; unsigned char repeat=0; unsigned char cntr_sign=0; unsigned char cntr_sign1=0; unsigned char cntr_sign2=0; unsigned char cntr_sign3=0; unsigned char cntr_sign4=0; unsigned char cntr_sign5=0; unsigned char cntr_sign6=0; unsigned char cntr_sign7=0; unsigned char cntr_sign8=0; unsigned char cntr_sign9=0; unsigned char cntr_sign10=0; unsigned char cntr_sign11=0; unsigned char cntr_sign12=0; unsigned char storing; int compare_value; void main( ) { // Address for port 1, here defining hex values // Read pin from ADC // Write pin from ADC // INTR pin from ADC

101

Appendix
TMOD = 0x20; TH1 = -3; SCON = 0x40; TR1=1; init_lcd(); init_msg(); while (1) { sensing_on(); } } void sensing_on() { chk_on = 1; chk_off = 1;

if ( chk_on==0 && chk_off==1 ) { if ( repeat == 0 && cntr_sign == 0) { lcd_cmd_reg(0x01); // clear previous data lcd_cmd_reg(0xC0); lcd_out(message_3[15]); lcd_out(message_3[2]); lcd_out(message_3[13]); lcd_out(message_3[11]); lcd_out(message_3[3]); storing = adc_scan(); adc_calc(storing); getdata(); outdata(datta); repeat=1;

} else { getdata();

102

Appendix
outdata(datta); } } else if ( chk_on==1 && chk_off==0 ) { if ( repeat == 1 ) { lcd_cmd_reg(0x01); init_msg(); repeat=0; cntr_sign=0; cntr_sign1=0; // for reseting symbol VICTORY cntr_sign2=0; // for reseting symbol 1 cntr_sign3=0; // for reseting symbol 6 cntr_sign4=0; // for reseting symbol 10 cntr_sign5=0; // for reseting symbol 9 cntr_sign6=0; // for reseting symbol Turn Left cntr_sign7=0; // for reseting symbol Turn Right cntr_sign10=0; // for symbol 3 cntr_sign11=0; // for symbol 4 cntr_sign12=0; // for symbol 5 cntr_sign8=0; // for symbol 7 cntr_sign9=0; // for symbol 8 } else; } else; } void getdata() { datta[0]=thumb; datta[1]=index; datta[2]=mid; datta[3]=mid_nxt; datta[4]=smal; } void outdata(unsigned char *output)

103

Appendix
{ if ( angle >= 70 && angle <= 110 ) { if ( output[0]==0 && output[1]==1 && output[2]==1 && output[3]==1 && output[4]==1 ) { storing = adc_scan(); adc_calc(storing); if ( cntr_sign==0 ) { lcd_cmd_reg(0x80); lcd_out(message_3[1]); lcd_out(message_3[16]); for (i=0; i<11; i++) { lcd_out(0X20); trnsmt(0x20); s_delay(); }

cntr_sign=1 } else { storing = adc_scan(); adc_calc(storing); } cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0;

104

Appendix
} else if ( output[0]==1 && output[1]==0 && output[2]==1 && output[3]==1 && output[4]==1 ) { storing = adc_scan(); adc_calc(storing); if ( cntr_sign2==0 ) { lcd_cmd_reg(0x80); lcd_out(0x31); for (i=0; i<14; i++) { lcd_out(0X20); } trnsmt(0x23); s_delay(); cntr_sign2=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign1=0; cntr_sign=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } // output=1

105

Appendix
else if ( output[0]==1 && output[1]==0 && output[2]==0 && output[3]==1 && output[4]==1 )//x==0x19 { storing = adc_scan(); adc_calc(storing); if ( cntr_sign1==0 ) { lcd_cmd_reg(0x80); lcd_out(message_3[4]); lcd_out(message_3[5]); lcd_out(message_3[6]); lcd_out(message_3[7]); lcd_out(message_3[1]); lcd_out(message_3[8]); lcd_out(message_3[9]); VICTORY

for (i=0; i<8; i++) { lcd_out(0X20); } trnsmt(0x26); s_delay(); cntr_sign1=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0;

106

Appendix
cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } else if ( output[0]==1 && output[1]==0 && output[2]==0 && output[3]==0 && output[4]==1 )// { storing = adc_scan(); adc_calc(storing); Symbol = 6

if ( cntr_sign3==0 ) { lcd_cmd_reg(0x80); lcd_out(0x36); for (i=0; i<15; i++) { } trnsmt(0x29); s_delay(); cntr_sign3=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; lcd_out(0X20);

107

Appendix
cntr_sign8=0; cntr_sign9=0; } else if ( output[0]==1 && output[1]==1 && output[2]==1 && output[3]==1 && output[4]==1 )// { storing = adc_scan(); adc_calc(storing); Symbol = 10

if ( cntr_sign4==0 ) { lcd_cmd_reg(0x80); lcd_out(0x31); lcd_out(0x30); for (i=0; i<13; i++) { lcd_out(0X20); trnsmt(0x32); s_delay(); }

cntr_sign4=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0;

108

Appendix
cntr_sign8=0; cntr_sign9=0; } else if ( output[0]==1 && output[1]==1 && output[2]==0 && output[3]==0 && output[4]==0 )// { storing = adc_scan(); adc_calc(storing); if ( cntr_sign5==0 ) { lcd_cmd_reg(0x80); Symbol = 9

lcd_out(0x39);

for (i=0; i<14; i++) { lcd_out(0X20); } trnsmt(0x35); s_delay();

cntr_sign5=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0;

109

Appendix
cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } else if ( output[0]==1 && output[1]==0 && output[2]==0 && output[3]==0 && output[4]==0 ) { storing = adc_scan(); adc_calc(storing); if ( cntr_sign11==0 ) { lcd_cmd_reg(0x80); lcd_out(0x34); for (i=0; i<14; i++) { lcd_out(0X20); } trnsmt(0x43); s_delay(); cntr_sign11=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign5=0; cntr_sign10=0; cntr_sign12=0; cntr_sign8=0;

110

Appendix
cntr_sign9=0; } else if ( output[0]==0 && output[1]==0 && output[2]==0 && output[3]==1 && output[4]==1 ) { storing = adc_scan(); adc_calc(storing); if ( cntr_sign10==0 ) { lcd_cmd_reg(0x80); lcd_out(0x33); for (i=0; i<14; i++) { lcd_out(0X20); } trnsmt(0x46); s_delay(); cntr_sign10=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign5=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; }

111

Appendix
else if ( output[0]==0 && output[1]==0 && output[2]==0 && output[3]==0 && output[4]==0 )// Symbol = 5 { storing = adc_scan(); adc_calc(storing); if ( cntr_sign12==0 ) { lcd_cmd_reg(0x80); lcd_out(0x35); for (i=0; i<14; i++) { lcd_out(0X20); trnsmt(0x49); s_delay(); cntr_sign12=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign5=0; cntr_sign10=0; cntr_sign11=0; cntr_sign8=0; cntr_sign9=0; } else if ( output[0]==1 && output[1]==0 && output[2]==0 && output[3]==1 && output[4]==0 )// { Symbol = 7

112

Appendix
storing = adc_scan(); adc_calc(storing); if ( cntr_sign8==0 ) { lcd_cmd_reg(0x80); lcd_out(0x37); for (i=0; i<14; i++) { lcd_out(0X20); } trnsmt(0x51); s_delay(); cntr_sign8=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign5=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign9=0;

} else if ( output[0]==1 && output[1]==0 && output[2]==1 && output[3]==0 && output[4]==0 ) {

113

Appendix
storing = adc_scan(); adc_calc(storing); if ( cntr_sign9==0 ) { lcd_cmd_reg(0x80); lcd_out(0x38); for (i=0; i<14; i++) { lcd_out(0X20); trnsmt(0x54); s_delay(); cntr_sign9=1; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign6=0; cntr_sign7=0; cntr_sign5=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; } else { lcd_cmd_reg(0x80); for (i=0; i<9; i++) { lcd_out(message_1[i]); } }

114

Appendix
for (i=0; i<7; i++) { lcd_out(0X20); } storing = adc_scan(); adc_calc(storing); cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } } else if ( angle >= 0 && angle <= 25 ) { if ( output[0]==0 && output[1]==1 && output[2]==1 && output[3]==1 && output[4]==1 )//x==0x1E { storing = adc_scan(); adc_calc(storing); if ( cntr_sign6==0 ) { lcd_cmd_reg(0x80); lcd_out(message_3[11]); lcd_out(message_3[3]); lcd_out(message_3[12]); lcd_out(message_3[7]); for (i=0; i<7; i++) { Symbol for TURN LEFT

115

Appendix
lcd_out(0X20); trnsmt(0x38); s_delay(); cntr_sign6=1 ; } else { storing = adc_scan(); adc_calc(storing); } cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } else { lcd_cmd_reg(0x80); for (i=0; i<9; i++) { lcd_out(message_1[i]); } for (i=0; i<7; i++) { lcd_out(0X20); } storing = adc_scan(); adc_calc(storing); cntr_sign=0; cntr_sign1=0; }

116

Appendix
cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } } else if ( angle >= 155 && angle <= 180 ) { if ( output[0]==0 && output[1]==1 && output[2]==1 && output[3]==1 && output[4]==1 )//x==0x1E { storing = adc_scan(); adc_calc(storing); if ( cntr_sign7==0 ) { lcd_cmd_reg(0x80); lcd_out(message_3[8]); lcd_out(message_3[5]); lcd_out(message_3[13]); lcd_out(message_3[14]); lcd_out(message_3[7]); Symbol for TURN RIGHT

for (i=0; i<6; i++) { lcd_out(0X20); trnsmt(0x41); s_delay(); cntr_sign7=1 ; } else }

117

Appendix
{ storing = adc_scan(); adc_calc(storing); } cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } else { lcd_cmd_reg(0x80); for (i=0; i<9; i++) { lcd_out(message_1[i]); } for (i=0; i<7; i++) { lcd_out(0X20); } storing = adc_scan(); adc_calc(storing); cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0;

118

Appendix
cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } } else {

lcd_cmd_reg(0x80); for (i=0; i<9; i++) { lcd_out(message_1[i]); } for (i=0; i<7; i++) { lcd_out(0X20); } storing = adc_scan(); adc_calc(storing); cntr_sign=0; cntr_sign1=0; cntr_sign2=0; cntr_sign3=0; cntr_sign4=0; cntr_sign5=0; cntr_sign6=0; cntr_sign7=0; cntr_sign10=0; cntr_sign11=0; cntr_sign12=0; cntr_sign8=0; cntr_sign9=0; } } unsigned char adc_scan()

119

Appendix
{ unsigned char get_data; getadc=0xFF; rd=1; wr=0; wr=1; while ( intr==1 ); rd=0; get_data=getadc; return ( get_data ); } void adc_calc(unsigned char stored) { /* APPLYING FORMULA FOR ANGLE CALCULATIONS FROM ACCELEROMETER ----------------------------------------------------------------- ANGLE=( 180 ) x ( stored / 255 ) ----------------

total we get 0-255 from ADC, when we have to calibrate for our whole range of analog input. For our purpose we can tilt our hand in one axis from o to 180 degree. If no tilt then stored=0, ANGLE=0 Degree If max tilt then stored=255, ANGLE=180 Degree unsigned int val; unsigned char lcdstring[5]; val=(unsigned int)stored; angle = 180-((180*val)/255); sprintf(lcdstring,"%d",angle); if ( angle >= 100 ) { lcd_cmd_reg(0xC7); for ( i=0; i<3; i++) { lcd_out(lcdstring[i]); } } else if ( angle >= 10 && angle <100 ) { */

120

Appendix
lcd_cmd_reg(0xC7); for ( i=0; i<2; i++) { lcd_out(lcdstring[i]); } lcd_out(0x20); } else if ( angle >= 0 && angle <10 ) { lcd_cmd_reg(0xC7); lcd_out(lcdstring[0]); lcd_out(0x20); lcd_out(0x20); } else; compare_value=angle; s_delay(); s_delay(); s_delay(); s_delay(); } void init_lcd() { lcd_cmd_reg(0x38); lcd_cmd_reg(0x0C); lcd_cmd_reg(0x01); lcd_cmd_reg(0x80); } void init_msg() { unsigned char msg_init[]="HAND SENSING OFF"; for (i=0; i<16; i++) { s_delay(); lcd_out(msg_init[i]); } s_delay();

121

Appendix
} void lcd_out(unsigned char lcd_value) { lcd_ready(); lcddata_out=lcd_value; rs=1; rwlcd=0; en=1; en=0; } void lcd_cmd_reg(unsigned char lcd_cmd) { lcd_ready(); lcddata_out=lcd_cmd; rs=0; rwlcd=0; en=1; en=0; } void lcd_ready() { check_bit=1; rs=0; rwlcd=1; en=0; en=1; while ( check_bit==1 ) { en=0; en=1; } } void trnsmt(unsigned char x) { SBUF = x; while ( TI == 0 ) ; TI = 0;

122

Appendix
} void s_delay() { unsigned int j; for (j=0; j<19000; j++);

H.3

C Language Source Code for SP0256-AL2

#include <AT89X52.H> #include <stdio.h> #include <string.h> #include <stdlib.h> void s_delay(); void chck_symbol(); void out_speech(unsigned char *donee, unsigned int length ); void chck_ready(); unsigned char receiver(); unsigned char rec_data=0; sfr data_out = 0xA0; sbit LRQ = P1^3; sbit ALD = P1^4; sbit chck= P1^0; sbit chck1= P1^1; sbit chck2= P1^2; unsigned char done []={0x17, 0x06, 0x03, 0x02, 0x2A, 0x1A, 0x0B, 0x03, 0x02, 0x37, 0x09, 0x13, 0x29, 0x03, 0x02}; // Allophones Adress for Speaking i can speak // Address for port 2, here defining hex values // checking speech processor is ready or not!

unsigned char done1[]={0x35, 0x2A, 0x13, 0x03, 0x02 }; // Allophones Adress for Speaking ok unsigned char done2[]={0x23, 0x0C, 0x2A, 0x0D, 0x17, 0x17, 0x33, 0x13, 0x03, 0x02 }; // Allophones Adress for Speaking victory unsigned char done3[]={0x0D, 0x1A, 0x33, 0x0B, 0x03, 0x02, 0x2D, 0x1A, 0x28, 0x0D, 0x03, 0x02 }; // Allophones Adress for Speaking tarn laft //unsigned char done4[]={0x1B, 0x20, 0x03, 0x02, 0x18, 0x34, 0x03, 0x02, 0x19, 0x1F, 0x03, 0x02 };// Allophones Adress for Speaking How are you

123

Appendix
unsigned char done5[]={0x1B, 0x18, 0x06, 0x03, 0x02 }; // Allophones Adress for Speaking HI unsigned char done6[]={0x2E, 0x0F, 0x0B, 0x03, 0x02 }; // Allophones Adress for Speaking one unsigned char done7[]={0x37, 0x0C, 0x2A, 0x37, 0x03, 0x02 }; // Allophones Adress for Speaking six unsigned char done8[]={0x0D, 0x07, 0x0B, 0x03, 0x02 }; // Allophones Adress for Speaking ten unsigned char done9[]={0x0B, 0x06, 0x0B, 0x03, 0x02 }; // Allophones Adress for Speaking nine unsigned char done10[]={0x0D, 0x1A, 0x33, 0x0B, 0x03, 0x02, 0x33, 0x06, 0x0D, 0x03, 0x02 }; // Allophones Adress for Speaking tarn right unsigned char done11[]={0x1D, 0x27, 0x13, 0x03, 0x02 }; // Allophones Adress for Speaking three unsigned char done12[]={0x28, 0x35, 0x33, 0x03, 0x02 }; // Allophones Adress for Speaking four unsigned char done13[]={0x28, 0x17, 0x06, 0x23, 0x03, 0x02 }; // Allophones Adress for Speaking five unsigned char done14[]={0x37, 0x1A, 0x23, 0x0B, 0x03, 0x02 }; // Allophones Adress for Speaking savn unsigned char done15[]={0x14, 0x36, 0x0D , 0x02}; // Allophones Adress for Speaking eight void main() { TMOD = 0x20; /* TMOD */ TH1 = -3; SCON = 0x50; /* SCON */ TR1=1; while ( 1 ) { rec_data = receiver(); if ( rec_data == 0x01 ) // GENERATE ALLOPHONES FOR SYMBOL 'I CAN SPEAK' { chck1=0; out_speech(done, 15); //0xFC; /* TH1 */ /* setup serial port control, 8-bit UART */ /* Timer 1 Starts */

124

Appendix
} else if ( rec_data == 0x03 ) // GENERATE ALLOPHONES FOR SYMBOL 'HOW ARE YOU' { chck=0; out_speech(done4, 12); } else if ( rec_data == 0x06 ) // GENERATE ALLOPHONES FOR SYMBOL 'HI' { chck1=0; out_speech(done5, 5); } else if ( rec_data == 0x20 ) // GENERATE ALLOPHONES FOR SYMBOL 'OK' { out_speech(done1, 5); } else if ( rec_data == 0x23 ) // GENERATE ALLOPHONES FOR SYMBOL '1' { out_speech(done6, 5); } else if ( rec_data == 0x26 ) // GENERATE ALLOPHONES FOR SYMBOL 'VICTORY' { out_speech(done2, 10); } else if ( rec_data == 0x29 ) // GENERATE ALLOPHONES FOR SYMBOL '6' { out_speech(done7, 6); } else if ( rec_data == 0x32 ) // GENERATE ALLOPHONES FOR SYMBOL '10' { out_speech(done8, 5);

125

Appendix
} else if ( rec_data == 0x35 ) // GENERATE ALLOPHONES FOR SYMBOL '9' { out_speech(done9, 5); } else if ( rec_data == 0x38 ) // GENERATE ALLOPHONES FOR SYMBOL 'TURN LEFT' { out_speech(done3, 12); } else if ( rec_data == 0x41 ) // GENERATE ALLOPHONES FOR SYMBOL 'TURN RIGHT' { out_speech(done10, 11); } else if ( rec_data == 0x43 ) // GENERATE ALLOPHONES FOR SYMBOL '4' { out_speech(done12, 5); } else if ( rec_data == 0x46 ) // GENERATE ALLOPHONES FOR SYMBOL '3' { out_speech(done11, 5); } else if ( rec_data == 0x49 ) // GENERATE ALLOPHONES FOR SYMBOL '5' { out_speech(done13, 6); } else if ( rec_data == 0x51 ) // GENERATE ALLOPHONES FOR SYMBOL '7' { out_speech(done14, 6); } else if ( rec_data == 0x54 )

126

Appendix
// GENERATE ALLOPHONES FOR SYMBOL '8' { out_speech(done15, 4); } else; } } unsigned char receiver() { unsigned char x; while ( RI == 0 ) ; x = SBUF;

RI = 0; return ( x ); } void out_speech(unsigned char *donee, unsigned int length) { int i=0; for (i=0; i<length; i++) { chck_ready(); data_out = donee[i]; } s_delay(); s_delay(); s_delay(); s_delay(); s_delay(); } void chck_ready() { LRQ = 1; while ( LRQ == 1 ); ALD = 0; ALD = 1; } void s_delay() { // LOW to HIGH pulse for latching data into speech processor // pulling high for taking input from this pin // if still 1 then wait here

127

Appendix
unsigned int j; for (j=0; j<19000; j++);

Appendix I
I.1 I.2 I.3

CD Contents

Abstract of Virtual Speaker.doc Project Report .doc Software code


o Code 1 .doc o Code 2.doc o Code 3.doc

I.4

Data sheets
o Microcontroller 89C51 o Flex Sensor o Accelerometer o ADC 0804 o LF 33cv o SP0256 AL-2

128

Chapter 10

References

[ 1 ] Baron, Naomi S. Alphabet to Email: How Written English Evolved and Where It's Heading. Routledge, 2000, 2001. Explores how communication technologies, from early writing to present-day electronics, influence the way we speak and write. [ 2 ] Starr, Paul. The Creation of the Media: Political Origins of Modern Communications. Basic, 2004. Explores the influence of political forces in shaping the mass media in the United States. [ 3 ] Microsoft Encarta 2009 [ 4 ] Charlip, Remy; Mary Beth; and George Ancona. Handtalk: An ABC of Finger Spelling and Sign Language. Simon & Schuster, 1974, 1987. A classic work designed for ages 9 to 12. [ 5 ] Sternberg, Martin L. A. American Sign Language Dictionary. Rev. ed. HarperReference, 1998. A classic reference work. [ 6 ] http://www.amic.org.sg/ict/external/awards/0202a2_l59attachment2.pdf [ 7 ] www.geocities.com/musuf/bh/docs/.../Chapter3-BoltayHaath-PSL.pdf [ 8 ] http://www.amic.org.sg/ict/external/awards/0202a2_l59attachment3.pdf [ 9 ] http://www.lefande.com/hands.html [ 1 0 ] www.societyofrobots.com [ 1 1 ] http://ezinearticles.com/?How-does-an-Accelerometer-work?&id=28560

129