Sunteți pe pagina 1din 62

1

PROJECT REPORT ON VOICE CONTROLLED ROBOT

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING NOIDA INSTITUTE OF ENGINEERING AND TECHNOLGY

GREATER NOIDA MAY(2011)

SUBMITTED BY:SUBMITTED TO:PUSHPENDRA AGRAWAL SP SINGH SUSHEEL CHANDRA YADAV Prof. VK PANDEY RAJAN JAIN ROOPAK GARG Mr.

CERTIFICATE:-

This is to certify that Project Report entitled Voice Recognition Robot which is submitted by Mr. Susheel Chandra Yadav, Mr. Rajan Jain, Mr. Roopak Garg, Mr. Pushpendra Agarwal in partial fulfillment of the requirement for the award of degree B.Tech. in Department Electronics & Communication of U.P. Technical University, is a record of the candidate own work carried out by him under my/our supervision. The matter embodied in this thesis is original and has not been submitted for the award of any other degree.

Project Guide Mr. SP Singh

H.O.D Prof. VK Pandey

ABSTRACT
Introduction:As our final year project we are going to present an innovative project having lots of feature. Our project is voice controlled robot, controlled by microphone connected to PC. Program of the project whose program is written Visual basic language for controlling robot motor from the PCs parallel port termed as printer port (LPT). The special feature of our project is that our visual basic program control window based voice recognizing software. So for controlling any moment of robot we have to just speak name of moment. The voice recognizing software compare our voice with already stored voice, If match found robot start executing command according to voice command, otherwise it give error massage.

Problem Statement:How to implement the motion of robot by voice command. Mainly FSK technique is used for Data transmission.

limitations:1. It is limited to just five commands i.e. Left, Right, Stop, Forward, Reverse. 2.It is working on PC based software. So we need a PC at every place where we are implementing it.

Proposed Solution:- To implement voice controlled robot, we have made a PC based voice recognition software which recognizes the voice of the operator and sends the signal to the transmitter section which transmits the signal to the receiver section with the help of FSK( Frequency Shift Keying) technique. At the receiver section, we have programmed the microcontroller in BASCOM and commands are given in Visual Basic language. Result & Conclusion:- We have developed a robot with can move on the basis of voice commands. There is 4-bit transmission. Various codes for voice commands are:-

For the right command, computer will decode it as 0001 and robot will move in right direction. For the left command, computer will decode it as 0010 and robot will move in left direction. For stop command, computer will decode it as 0011 and robot will go in standby mode. For forward command, computer will decode it as 0101 and robot will move in forward direction. For reverse command, computer will decode it as 1010 and robot will move in reverse direction.

Advantage:This will be beneficial for security purpose, spying purpose for national security and also in medical applications.

Disadvantage:For much higher degree of implementation, we need more commands to be implemented which is quite a costly affair.

ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B. Tech Project undertaken during B. Tech. Final Year. We owe special debt of gratitude to Lecturer Mr. SP Singh, for his constant support and guidance throughout the course of our work. His sincerity, thoroughness and perseverance have been a constant source of inspiration for us. It is only his cognizant efforts that our endeavors have seen light of the day. We also take the opportunity to acknowledge the contribution of Mr.VK Pandey ,Head of Department , Electronics & Communication, for his full support and assistance during the development of the project. We also do not like to miss the opportunity to acknowledge the contribution of all faculty members of the department especially Mrs. Vandana Singh, for their kind assistance and cooperation during the development of our project. Last but not the least, we acknowledge our friends for their contribution in the completion of the project.

Signature: Name: Susheel Chandra Yadav Roll No.: 0713331105 Date : 11th May 2011

Signature: Name: Pushpendra Agarwal Roll No.: 0609732024 Date: 11th May 2011

Signature: Name: Rajan Jain Roll No.: 0713331073 Date: 11 th May 2011

Signature: Name: Roopak Garg Roll No.: 0713331085 Date: 11 th May 2011

TABLE OF CONTENTS

page no.

Certificate..2 Abstract.3 Acknowledgement5 Declaration8 LISTOFABBREVIATIONS...12 LIST OF DIAGRAMS.........13 CHAPTER 1:(INTRODUCTION).14 1. problem statement 2. how to overcome these problems CHAPTER 2:VOICE CONTROLLED ROBOT15 1. Basic concepts of working..........................15 2. Components & techniques used..................16 3. Details of Components........17 a. Optocoupler.................................................17 b. HT12E Encoder...........................................20 c. HT12D Decoder..24 d. Microcontroller 89C5127 e. Input/Output ports...30 f. Obstacle Sensor35 g. Seven Segment Display.......37 h. Power Supply...39 i. Light Dependent Resistor41 j. H-Bridge motor driver circuit..42 k. DC motors44 l. Electrolyte Capacitors..46 m. Ceramic Capacitors..47

n. Parallel port..48 CHAPTER 3:-..51 WORKING51 1. Transmitter Section..................................53 2. Receiver Section..54 3. Microcontroller logic...............................57

CHAPTER 4:-58 Software Part.58 CHAPTER 5:-....66 RESULT & CONCLUSION........66 REFERENCES..68

LIST OF ABBREVIATIONS:LPT: - line print terminal. BASCOM: - Basic communication. LDR:- Light dependent resistor. FSK:- Frequency shift keying. HT12D:- Holtek decoder HT12E:- Holtek encoder LED:- Light emitting diode.

LIST OF DIAGRAMS:1. Optocoupler 2. HT12E Encoder 3. HT12D Decoder 4. Microcontroller 89C51 5. Input/ Output ports 6. Obstacle Sensor 7. Seven Segment Display 8. Power Supply 9. Light Dependent Resistor 10. H-Bridge Motor driver circuit 11. DC Motors 12. Electrolyte Capacitors 13. Ceramic Capacitors 14. Parallel Port 15. Transmitter Section 16. Receiver Section 17. Microcontroller Logic

10

CHAPTER 1 :INTRODUCTION

As our final year project we are going to present an innovative project having lots of feature. Our project is voice controlled robot, controlled by microphone connected to PC. Program of the project whose program is written Visual basic language for controlling robot motor from the PCs parallel port termed as printer port (LPT).

1.1 Problem Statement:-

How to implement the motion of robot by voice command. Mainly FSK technique is limitations:used for Data transmission. But, there are two important

1. It is limited to just five commands i.e. Left, Right, Stop, Forward, Reverse. 2.It is working on PC based software. So we need a PC at every place where we are implementing it. 1.2 how to overcome these problems To implement voice controlled robot, we have made a PC based voice recognition software which recognizes the voice of the operator and sends the signal to the transmitter section which transmits the signal to the receiver section with the help of FSK( Frequency Shift Keying) technique. At the receiver section, we have programmed the microcontroller in BASCOM and commands are given in Visual Basic language.

11

CHAPTER 2:VOICE CONTROLLED ROBOT

2.1 BASIC CONCEPT OF WORKING:-

Our project is voice controlled robot, controlled by microphone connected to PC. Program of the project whose program is written Visual basic language for controlling robot motor from the PCs parallel port termed as printer port (LPT). The Program accepts the input in decimal numbers and outputs at the data output pins of the PCs parallel port for controlling the connected devices. Our project controls left, right, Forward and backward moment of robot wirelessly within 500m range using 433 MHz Rf frequency. The special feature of our project is that our visual basic program control window based voice recognizing software. So for controlling any moment of robot we have to just speak name of moment. The voice recognizing software compare our voice with already stored voice, If match found robot start executing command according to voice command, otherwise it give error massage. At the receiver side of robot 89C51 microcontroller is also used. The microcontroller takes command wirelessly transmitted by PC. The role of microcontroller is to drive 7 segments, drive DC motor, take input from temperature sensor and night light sensor and drive relays.

2.2 COMPONENTS & TECHNIQUES USED

Visual basic Speech recognizing software PC parallel port

12

Optocoupler Encoder and decoder Frequency modulation Temperature sensor and LDR Operational amplifier and timer H-Bridge DC motor driver 7 segment display Obstacle sensor Day night sensor

2.3 DETAILS OF COMPONENTS

OPTOCOUPLER There are many situations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without making a direct ohmic.electrical connection. Often this is because the sourceand destination are (or may be at times) at very different voltage levels, like a microprocessor which is operating from 5V DC but being used to control a triac which is switching 240V AC. In such situations the link between the two must be an isolated one, to protect the

13

microprocessor from overvoltage damage. Relays can of course provide this kind of isolation, but even small relays tend to be fairly bulky compared with ICs and many of today.s other miniature circuit components. Because they.re electro-mechanical, relays are also not as reliable . and only capable of relatively low speed operation. Where small size, higher speed and greater reliability are important, a much better alternative is to use an optocoupler. These use a beam of light to transmit the signals or data across an electrical barrier, and achieve excellent isolation. Optocouplers typically come in a small 6-pin or 8-pin IC package, but are essentially a combination of two distinct devices: an optical transmitter, typically a gallium arsenide LED (light-emitting diode) and an optical receiver such as a phototransistor or light-triggered diac. The two areseparated by a transparent barrier which blocks any electrical current flow between the two, but does allow the passage of light. Usually the electrical connections to the LED section are brought out to the pins on one side of the package and those for the phototransistor or diac to the other side, to physically separate them as much as possible. This usually allows optocouplers to withstand voltages of anywhere between 500V and 7500V between input and output.

HOW IT IS USED:-

Basically the simplest way to visualise an optocoupler is in terms of its two main components: the input LED and the output transistor or diac. As the two are electrically

14

isolated, this gives a fair amount of flexibility when it comes to connecting them into circuit. All we really have to do is work out a convenient way of turning the input LED on and off, and using the resulting switching of the phototransistor/diac to generate an output waveform or logic signal that is compatible with our output circuitry.

15

Optocouplers are essentially digital or switching devices, so they.re best for transferring either on-off control signals or digital data. Analog signals can be transferred by means of frequency or pulse-width modulation.

16

HT12E ENCODER General Description: The 212 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E enhances the application flexibility of the 212 series of encoders. Features 1-Operating voltage: 2.4V~12V for the HT12E 2- Low power and high noise immunity CMOS technology 3- Low standby current: 0.1_A (typ.) at Vdd=5V 4- HT12E with a 38kHz carrier for infrared transmission medium. 5- Minimum transmission word _ Four words for the HT12E 6-Built-in oscillator needs only 5% resistor 7- Data code has positive polarity 8- Minimal external components 9- HT12E: 18-pin DIP/20-pin SOP package

17

18

Each Optocoupler consists of an infrared light-emitting diode (LED) and an npn phototransistor. When a high going pulse is available on the data pin, the internal LED drives the phototransistor of Optocoupler MCT2E and it provides an enable pulse to HT12E encoder. All address pins of HT12E is grounded. Thus the data encoded by HT12E will be 0111. This encoded data is available at pin 17 of HT12E. The RF transmitter frequency modulate data signal and transmits using antenna.

For RF transmission purposed it is needed to encode the signal generated at computer parallel port with the help visual basic code. For signal encoding purpose we have used HT 12E encoder. HT^12 E is 2^12 encoders are a series of CMOS LSIs for remote control system

19

applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E enhances the application Flexibility of the 2^12 series of encoders.

HT12D DECODER General Description

The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 212 series of encoders (refer to the encoder/decoder cross reference table). For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or

20

unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 212 series of decoders are capable of decoding informations that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode 12 bits of address information.

Features:1- Operating voltage: 2.4V~12V 2- Low power and high noise immunity CMOS Technology 3- Low standby current 4- Capable of decoding 12 bits of information 5- Binary address setting 6- Received codes are checked 3 times 7- Address/Data number combination 8- HT12D: 8 address bits and 4 data bits 9- Built-in oscillator needs only 5% resistor 10- Valid transmission indicator 11-Easy interface with an RF or an infrared transmission medium. 12- Minimal external components 13-Pair with Holtek_s 212 series of encoders 14- 18-pin DIP, 20-pin SOP package

21

HT 12D Receive and decode 12 bit encoded data transmitted by HT12E, for further processing. The HT12D is 12 bit decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 2^12 series of encoders. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 2^12 series of encoders that are transmitted by a carrier using an RF transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 2^12 series of decoders are capable of decoding informations that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits.

22

MICROCONTROLLER 89C51

PIN DIAGRAM :-

23

PIN DESCRIPTION :1: Pins 1-8: Port 1 Each one these pins can be configured as an input or an output.

2: Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning.

24

3: Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions: Pin Pin 10: RXD Serial 11: TXD Serial asynchronous asynchronous communication communication input output or or Serial Serial synchronous synchronous communication output. communication clock output. Pin 12: INT0 Interrupt 0 input. Pin 13: INT1 Interrupt 1 input. Pin 14: T0 Counter 0 clock input. Pin 15: T1 Counter 1 clock input. Pin 16: WR Write to external (additional) RAM. Pin 17: RD Read from external RAM. 4: Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz. 5: Pin 20: GND Ground

6: Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs. 7: Pin 29: PSEN If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory. 8: Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the

25

ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state circuit. In other and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated words, this port is used for both data and address transmission. 9: Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists). 10: Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0). 11: Pin 40: VCC +5V power supply

INPUT/OUTPUT PORTS (I/O PORTS)

All 89C51 microcontrollers have 4 I/O ports each comprising 8 bits which can be configured as inputs or outputs. Accordingly, in total of 32 input/output pins enabling the microcontroller to be connected to peripheral devices are available for use. Pin configuration, i.e. whether it is to be configured as an input (1) or an output (0), depends on its logic state. In order to configure a microcontroller pin as an input, it is necessary to apply a logic zero (0) to appropriate I/O port bit. In this case, voltage level on appropriate pin will be 0. Similarly, in order to configure a microcontroller pin as an input, it is necessary to apply a logic one (1) to appropriate port. In this case, voltage level on appropriate pin will be 5V (as is the case with any TTL input).

26

Port 0 : The P0 port is characterized by two functions. If external memory is used then the lower address byte (addresses A0-A7) is applied on it. Otherwise, all bits of this port are configured as inputs/outputs.The other function is expressed when it is configured as an output. Unlike other ports consisting of pins with built-in pull-up resistor connected by its end to 5 V power supply, pins of this port have this resistor left out. This apparently small difference has its consequences: 1: If any pin of this port is configured as an input then it acts as if it floats. Such an input has unlimited input resistance an indetermined potential. 2: When the pin is configured as an output, it acts as an open drain. By applying logic 0 to a port bit, the appropriate pin will be connected to ground (0V). By applying logic 1, the external output will keep on floating. In order to apply logic 1 (5V) on this output pin, it is necessary to built in an external pull-up resistor. Port 1 : P1 is a true I/O port, because it doesn't have any alternative functions as is the case with P0, but can be cofigured as general I/O only. It has a pull-up resistor built-in and is completely compatible with TTL circuits. Port 2 : P2 acts similarly to P0 when external memory is used. Pins of this port occupy addresses intended for external memory chip. This time it is about the higher address byte with addresses A8-A15. When no memory is added, this port can be used as a general input/output port showing features similar to P1. Port 3 : All port pins can be used as general I/O, but they also have an alternative function. In order to use these alternative functions, a logic one (1) must be applied to appropriate bit of the P3 register. In tems of hardware, this port is similar to P0, with the difference that its pins have a pull-up resistor built-in.

27

Program Memory :The first models of the 89C51 microcontroller family did not have internal program memory. It was added as an external separate chip. These models are recognizable by their label beginning with 803 (for example 8031 or 8032). All later models have a few Kbyte ROM embedded. Even though such an amount of memory is sufficient for writing most of the programs, there are situations when it is necessary to use additional memory as well. A typical example are so called lookup tables. They are used in cases when equations describing some processes are too complicated or when there is no time for solving them. In such cases all necessary estimates and approximates are executed in advance and the final results are put in the tables (similar to logarithmic tables)

EA=0 In this case, the microcontroller completely ignores internal program memory and executes only the program stored in external memory. EA=1 In this case, the microcontroller executes first the program from built-in ROM, then the program stored in external memory.

28

In both cases, P0 and P2 are not available for use since being used for data and address transmission. Besides, the ALE and PSEN pins are also used. Data Memory : Data Memory is used for temporarily storing data and intermediate results created and used during the operation of the microcontroller. Besides, RAM memory built in the 89C51 family includes many registers such as hardware counters and timers, input/output ports, serial data buffers etc. The previous models had 256 RAM locations, while for the later models this number was incremented by additional 128 registers. However, the first 256 memory locations (addresses 0-FFh) are the heart of memory common to all the models belonging to the 89C51 family. Locations available to the user occupy memory space with addresses 07Fh, i.e. first 128 registers. This part of RAM is divided in several blocks. The first block consists of 4 banks each including 8 registers denoted by R0-R7. Prior to accessing any of these registers, it is necessary to select the bank containing it. The next memory block (address 20h-2Fh) is bit- addressable, which means that each bit has its own address (0-7Fh). Since there are 16 such registers, this block contains in total of 128 bits with separate addresses (address of bit 0 of the 20h byte is 0, while address of bit 7 of the 2Fh byte is 7Fh). The third group of registers occupy addresses 2Fh-7Fh, i.e. 80 locations, and does not have any special functions or features. Additional RAM In order to satisfy the programmers constant hunger for Data Memory, the manufacturers decided to embed an additional memory block of 128 locations into the latest versions of the 89C51 microcontrollers. However, its not as simple as it seems to be The problem is that electronics performing addressing has 1 byte (8 bits) on disposal and is capable of reaching only the first 256 locations, therefore. In order to keep already existing 8-bit architecture and compatibility with other existing models a small trick was done. Memory expansion

29

In case memory (RAM or ROM) built in the microcontroller is not sufficient, it is possible to add two external memory chips with capacity of 64Kb each. P2 and P3 I/O ports are used for their addressing and data transmission.

30

OBSTACLE SENSOR The infrared intruder sensor is used to sense some unknown person like thief entering in your house without your permission. In the infrared sensor we use IC 555 as a main component. Pin no 4 and pin no 8 is connected to the positive supply. Pin no 1 is connected to the negative voltage. One capacitor is grounded from the pin no 5 for noise cancellation. Output is available on the pin no 3. Sensor is connected to the pin no 2. In the case of infra red sensor Pin no 2 is negative bias through the 33k ohm resistor and pin no is positively biased through the photodiode. One infrared transmitter led is focused to the photodiode. Infra red led is directly connected to the positive and negative supply through the 330ohm resistor.

31

In normal stage when light is focusing on the photodiode then pin no 2 is positively biased photodiode. If pin no 2 is positive then negative output is available on the pin no 3. Now when any body interrupts the light then there is no light on the photodiode and pin no 2 is now gets its voltage from only 33 k ohm resistor. If pin no 2 is become negative then output is shifted to the pin no 3. When positive output is available on the pin no 3 and with the help of this voltage NPN transistor is on and npn transistor provide a negative voltage as a pulse to the microcontroller (pin No 33, 34, 35, 36) . A VIEW OF OBSTACLE SENSOR

SEVEN-SEGMENT DISPLAY

32

The DM74LS47 accepts four lines of BCD (8421) input data, generates their complements internally and decodes the data with seven AND/OR gates having open-collector outputs to drive indicator segments directly. Each segment output is guaranteed to sink 24mA in the ON (LOW) state and withstand 15V in the OFF (HIGH) state with a maximum leakage current of 250 mA. Auxiliary inputs provided blanking, lamp test and cascadable zero-suppression functions. The illustration below shows the basic layout of the segments in a seven-segment display. The segments themselves are identified with lower-case letters "a" through "g," with segment "a" at the top and then counting clockwise. Segment "g" is the center bar.

33

In early days to drive the seven segment decoder was used with it and the BCD was send to the decoder IC. But the microcontroller has eliminated the use of decoder as already decoded data is sent to the seven segment display.Common anode display are most suitable for interfacing with 89C51 since 89C51 port pins can sink current better than sourcing it.Connect the a to g pins and dot pin of seven segment display to the 8-bit port of microcontroller Now send the respective hex data to display specific number on seven segment display on that port.Give some delay and repeat the process if you want to display another digit.

POWER SUPPLY

34

Most digital logic circuits and processors need a 5 volt power supply. To use these parts we need to build a regulated 5 volt source. Usually you start with an unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power supply is included with the Beginner Kit and the Microcontroller Beginner Kit.). To make a 5 volt power supply, we use a LM7805 voltage regulator IC (Integrated Circuit). The IC is shown below.

The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the Output pin. The circuit is shown below.

35

The 5 Volt output is connected to the red power supply line of the breadboard. The ground from the input is connected to the blue ground line of the breadboard and a jumper wire is used to connect ground from there to the common (ground) pin of the 7805. Sometimes the input supply line may be noisy. To help smooth out this noise and get a better 5 volt output, a capacitor is usually added to the circuit, going between the 5 volt output and ground (GND). We use a 220 uF capacitor.

LIGHT DEPENDENT RESISTOR

This is an example of a light sensor circuit :

36

When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the LED does not light. However, when light shines onto the LDR its resistance falls and current flows into the base of the first transistor and then the second transistor. The LED lights. The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive. An LDR is used to sense light. The output voltage of a LRD is amplified by an operational amplifier, and is inputted into the base of transistor .The temperature sensitivity adjusting the gain of an operational amplifier by VR. So in the normal mode when temperature is below 60C the output or LM358 is not sufficient to drive transistor BC 548. When temperature raises above 60C the output of LM358 is about 3V which is sufficient to drive transistor thus microcontroller get positive voltage. H-BRIDGE MOTOR DRIVER CIRCUIT

A simple schematic for interfacing a DC motor using L293D is shown below.

37

L293D is a dual H-Bridge motor driver, So with one IC we can interface two DC motors which can be controlled in both clockwise and counter clockwise direction and if you have motor with fix direction of motion the you can make use of all the four I/Os to connect up to four DC motors. L293D has output current of 600mA and peak output current of 1.2A per channel. Moreover for protection of circuit from back EMF ouput diodes are included within the IC. The output supply (VCC2) has a wide range from 4.5V to 36V, which has made L293D a best choice for DC motor driver. As we can see in the circuit, three pins are needed for interfacing a DC motor (A, B, Enable). If we want the o/p to be enabled completely then we can connect Enable to Vcc and only 2 pins needed from controller to make the motor work. As per the truth mentioned in the image above its fairly simple to program the

38

microcontroller. Its also clear from the truth table of BJT circuit and L293D the programming will be same for both of them, just keeping in mind the allowed combinations of A and B.

39

DC MOTORS

Specification of the DC motor is 20 V, 2 A, and 200 rpm. Maximum linear speed of the robo is about 0.461m/s or about 1.66 km/hr.

40

ELECTROLYTE CAPACITORS

Aluminum is used for the electrodes by using a thin oxidization membrane. Large values of capacitance can be obtained in comparison with the size of the capacitor, because the dielectric used is very thin. Electrolytic capacitors represent the special type of capacitors with fixed capacity value. Thanks to special construction, they can have exceptionally high capacity, ranging from one to several thousand F. They are most frequently used in circuits for filtering; however they also have other purposes. Electrolytic capacitors are polarized components, meaning they have positive and negative leads, which is very important when connecting it to a circuit. The positive lead or pin has to be connected to the point with a higher positive voltage than the negative lead. If it is connected in reverse the insulating layer inside the capacitor will be "dissolved" and the capacitor will be permanently damaged.

41

Explosion may also occur if capacitor is connected to voltage that exceeds its working voltage. In order to prevent such instances, one of the capacitor's connectors is very clearly marked with a + or -, while the working voltage is printed on the case. Several models of electrolytic capacitors, as well as their symbols, are shown on the picture below.

47F mm, 100F mm, 220F 1000F

(25V) (50V)

high [diameter [diameter

11 8 18 mm, mm, high high

(16V) [diameter 6 high 5 mm] (25V) [diameter 5 mm] 12 mm] 40 mm]

The size of the capacitor sometimes depends on the manufacturer. So the sizes shown here on this page are just examples.

42

43

CERAMIC CAPACITORS

Ceramic capacitors are constructed with materials such as titanium acid barium used as the dielectric. Internally, these capacitors are not constructed as a coil, so they can be used in high frequency applications. Typically, they are used in circuits which bypass high frequency signals to ground. These capacitors have the shape of a disk. Their capacitance is comparatively small. The capacitor on the left is a 100pF capacitor with a diameter of about 3 mm. The capacitor on the right side is printed with 103, so 10 x 103pF becomes 0.01 F. The diameter of the disk is about 6 mm. Ceramic capacitors have no polarity. Ceramic capacitors should not be used for analog circuits, because they can distort the signal.

44

Parallel Port

The parallel port is made up of three ports , namely, data port, status port and control port. It is found on the back of the PC as a D-type, 25-pin female connector. Here, we are concerned only with data lines Do through D7 terminated at pins 2 through 9.

The data port is a writ-only port, which means it can be used only to output data. Pins 18 through 25 of the connector are grounded. Control port is read/write capable, which means it can be used both for outputting and inputting some data to/from the external hardware. Status port is a read only port, which means it can be used only to read data from the external hardware

45

Table above shows pin details of the standard parallel port (SPP) and their traditional usage. The base address of the first parallel port (LPT1) is 378 (hex) or 888 (decimal). The data port of the parallel port can be accessed at its base address. The status port can be accessed at base address+ 1, i.e., 0379 hex (or 889 decimal). The control port can be

46

accessed at base address+ 2, i.e., 037A hex (or 890 decimal). In case you are using LPT2 port, then substitute the base address of LPT2 as 0278 (hex) in place of 0378 (hex).

The circuit for interfacing the PCs parallel port to the devices to be controlled. The parallel port outputs the control signals generated by the software. The control signals are not continuous but a single clock pulse. For every on or off control, only a single clock pulse is sent from the parallel port to the circuit. The pins D0 through D7 of the parallel port are connected to pin 1 of Optocoupler IC5 through IC12 via resistors R1 through R8, respectively. Optocoupler ensure complete isolation of the parallel ports data pins from the relay driver circuit.

47

CHAPTER 3:WORKING We have connected a microphone to the PC for giving the instructions to robot for the control of motion and direction. We have made a program in Visual Basic Language which will receive voice command and convert that command in binary signal. This binary signal will be sent to the transmitter section of the robot through D25 Female Connector.

Transmitter Section The Block diagram for transmitter section is given below:-

Each Optocoupler consists of an infrared light-emitting diode (LED) and an npn phototransistor. When a high going pulse is available on the data pin, the internal LED drives

48

the phototransistor of Optocoupler MCT2E and it provides an enable pulse to HT12E encoder. All address pins of HT12E is grounded. Thus the data encoded by HT12E will be 0111. This encoded data is available at pin 17 of HT12E. The RF transmitter frequency modulate data signal and transmits using antenna.

For RF transmission purposed it is needed to encode the signal generated at computer parallel port with the help visual basic code. For signal encoding purpose we have used HT 12E encoder. HT^12 E is 2^12 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E enhances the application Flexibility of the 2^12 series of encoders.

Pin Diagram:-

49

RECEIVER SECTION The Block diagram of receiver section is given below:-

50

HT 12D Receive and decode 12 bit encoded data transmitted by HT12E, for further processing. The HT12D is 12 bit decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 2^12 series of encoders. For proper

51

operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 2^12 series of encoders that are transmitted by a carrier using an RF transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 2^12 series of decoders are capable of decoding informations that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits. Features: Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology Low standby current Capable of decoding 12 bits of information Binary address setting Received codes are checked 3 times Address/Data number combination HT12D: 8 address bits and 4 data bits Built-in oscillator needs only 5% resistor Valid transmission indicator Easy interface with an RF or an infrared transmission medium Minimal external components

PIN DIAGRAM

52

MICROCONTROLLER LOGIC

53

The function of microcontroller is to control input output based on the programmed embedded hex logic. The microcontroller continuously scans input logic. The input logic is 4BCD data from HT12D one from fire sensor and one from light sensor. If any one of them changes their logic level microcontroller goes to particular subroutine and perform particular task. Let us consider a case at the transmitter PC I have pressed number 2 (vice command), thus at receiver side HT12D generate corresponding BCD logic 0010. The microcontroller receive 0010 at pin no 1,2,3,4. The microcontroller is programmed if input is 0010, move to robot left. The robot will moves left if left DC motor rotate slow and right DC motor rotate fast. This slow and fast moment is dine by microcontroller using pulse width modulation. Thus when we press 2 key microcontroller provide different pulse to left right motor. If microcontroller sense 0001 input then it goes to right subroutine and moves robot right. If microcontroller sense 0010 inputs then it goes to left subroutine and moves robot left. If microcontroller sense 0011 input then it goes to stop subroutine and goes to standby mode. If microcontroller sense 0101 input then it goes to forward subroutine and moves robot forward. If microcontroller sense 1010 input then it goes to backward subroutine and moves robot backward.

CHAPTER 4:SOFTWARE PART Voice control commands are programmed in visual basic.window is looking as below:-

54

55

Robotic controller window is also programmed in visual basic.code for robotic movement controller window are as below:VERSION 5.00 Begin VB.Form Form1 Caption = "ROBOTIC MOVEMENT CONTROLLER" ClientHeight = 7905 ClientLeft = 60 ClientTop = 345 ClientWidth = 5580 BeginProperty Font Name = "Arial" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "robotics.frx":0000 LinkTopic = "Form1" ScaleHeight = 7905 ScaleWidth = 5580 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdexit Caption = "EXIT" Height = 495 Left = 1080 TabIndex = 5 Top = 6000 Width = 3495 End Begin VB.CommandButton cmdforward Caption = "FORWARD" Height = 825 Left = 1560 TabIndex = 4 Top = 840 Width = 2535 End Begin VB.CommandButton cmdleft Caption = "LEFT" Height = 1920 Left = 480 TabIndex = 3 Top = 1800 Width = 975 End

56

Begin VB.CommandButton cmdright Caption = "RIGHT" Height = 1920 Left = 4200 TabIndex = 2 Top = 1800 Width = 975 End Begin VB.CommandButton cmdstopdriving Caption = "STOP DRIVING" Height = 1920 Left = 1560 TabIndex = 1 Top = 1800 Width = 2535 End Begin VB.CommandButton cmdreverse Caption = "REVERSE" Height = 840 Left = 1560 TabIndex = 0 Top = 3840 Width = 2535 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cmdexit_Click() End End Sub Private Sub cmdforward_Click() PortOut &H378, &H1

End Sub Private Sub cmdleft_Click() PortOut &H378, &H2

End Sub Private Sub cmdreverse_Click()

57

PortOut &H378, &H4

End Sub Private Sub cmdright_Click() PortOut &H378, &H8

End Sub Private Sub cmdstopdriving_Click() PortOut &H378, &H0

End Sub Window will look like as below:-

58

59

Source code for the microcontroller AT89C51 to control the robo are as below :Attribute VB_Name = "VoiceCommands" Option Explicit

Function LoadVoiceCommands(lstBox As Control) As Boolean On Local Error GoTo LoadVoiceCommandsError Dim sNam As String Dim FileFree As Integer FileFree = FreeFile 'Check for voice commands text file... If Dir$(App.Path & "\Commands.Txt") = "" Then Exit Function End If 'Open the commands.txt file... Open App.Path & "\Commands.Txt" For Input As #FileFree Do Line Input #FileFree, sNam If InStr(LCase$(sNam), "<start>") > 0 And InStr(sNam, "[") = 0 Then lstBox.AddItem Mid$(sNam, InStr(LCase$(sNam), "=") + 1) End If Loop Until EOF(FileFree) Close #FileFree LoadVoiceCommands = True Exit Function

LoadVoiceCommandsError: Exit Function End Function Function ExecuteVoiceCommand(Who As Form, sPhrase As String) As Boolean On Local Error GoTo ExecuteVoiceCommandError Dim x 'Carry out command... Select Case LCase$(sPhrase)

60

Case "forward" PortOut &H378, &H68

Case "left" PortOut &H378, &H58 Case "backward" PortOut &H378, &H54 Case "right" PortOut &H378, &H64

Case "stop driving" PortOut &H378, &H7C Case "" End Select

ExecuteVoiceCommand = True Exit Function

ExecuteVoiceCommandError: Exit Function End Function

61

RESULT & CONCLUSION As we are giving voice command via microphone the motion & direction control of the robot have been achieved. Thus, we believe that our project will be beneficial for various purposes & hence our efforts will be fruitful.

APPLICATIONS

1. For spying purposes in national defence and security services. 2. In medical field it can serve many purpose for monitoring the condition of patient while carrying to any place. 3. As a voice controlled wheelchair for physically handicapped people.

62

S-ar putea să vă placă și