Gps based vehicle monitoring system copy


Published on

Published in: Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Gps based vehicle monitoring system copy

  1. 1. A PROJECT REPORT ON GPS BASED VEHICLE MONITORING SYSTEM Submitted By: SUMIT VARSHNEY Submitted to the Department of Electronics & Communication in the partial fulfillment of the requirements for the degree of Bachelor of Technology in Electronics & Communication GAUTAM BUDDHA TECHNICAL UNIVERSITY, LUCKNOW JUNE, 2011
  4. 4. CERTIFICATE This is to certify that Project Report entitled “GPS Based Vehicle Monitoring System” which is submitted by Sumit Varshney in partial fulfillment of the requirement for the award of degree B. Tech. in Department of Electronics & Communication from JSS ACADEMY OF TECHNICAL EDUCATION of Engineering & Technology, Muzaffarnagar of U.P. Technical University, is a record of the candidate own work carried out by him under my supervision. The matter embodied in this thesis is original and has not been submitted for the award of any other degree. Er. Amit Kumar Chauhan Prof. N.K. Sharma (Project Guide) (H.O.D., Deptt. Of ECE) External Examiner Dr. S. N. Chauhan (Director) 4
  5. 5. DECLARATION We hereby declare that this submission is our own work and that, to the best of our knowledge and belief, it contains no material previously published or written by another person nor material which to a substantial extent has been accepted for the award of any other degree or diploma of the university or other institute of higher learning, except where due acknowledgment has been made in the text. Signature : Name Date : : Sumit Varshney 5
  6. 6. ACKNOWLEDGEMENT It gives us a great sense of pleasure to present the report of the B. Tech Project “GPS Based Vehicle Monitoring System” undertaken during B. Tech. Final Year. We owe special debt of gratitude to Mr. Amit Kumar Chauhan (A.P., Department of Electronics & Communication Engineering, JSS Academy of Technical Education NOIDA) 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 Prof. N. K. Sharma (Head, Department of Electronics & Communication, JSS Academy of Technical Education NOIDA) for their full support and assistance during the development of the project. From the core of my heart, I would also like to express my profound gratitude to reverend Dr. S.N. Chauhan (Executive Director, S.D.C.E.T.) and respected Dr. A.K. Gautam (Principal, S.D.C.E.T.) for providing us the necessary facilities and such a blooming environment to work upon this project. We also do not like to miss the opportunity to acknowledge the contribution of all faculty members of the department 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 Date : : : Sumit Varshney 6
  8. 8. ABSTRACT This project present an automotive localization system using GPS. The system permits localization of robot and display of the position on the LCD in the form of latitude and longitude. Vehicle can be operated in both autonomous and manual mode. We can store the position of vehicle by using remote control. Later this stored information can be viewed by connecting it to PC. For collision avoidance it uses IR sensors to detect obstacles and make a decision to avoid them. The conventional mobile robot have used front-steering and rear- wheel driving mechanism to response all needed robot obvious motions, but the motion restriction is a major problem in the use of such mechanism. The omnidirectional configuration is a most suggested mechanism for mobile robot, which to have the capability of changing directions within the limited space in the indoor environment. 8
  9. 9. LIST OF FIGURES Page No. 17 Fig.1 Block Diagram of GPS based vehicle monitoring system Fig.2 Block Diagram of collision avoidance system Fig.3 Circuit Diagram of interfacing with AT89C51 Fig.4 Circuit Diagram of receiver for collision avoidance Fig.5 Circuit Diagram of transmitter for collision avoidance Fig.6 Pin diagram of AT89C51 Fig.7 Program Memory of AT89C5 Fig.8 Program Memory of AT89C52 Fig.9A Data Memory of AT89C51 Fig.9B Data Memory of AT89C52 Fig.10 128 Bytes of Directly and Indirectly Addressable RAM Fig.11 Pin Diagram of MAX232 DIP Package Fig.12 Pin Diagram of HT12D Fig.13 Pin Diagram of HT12E Fig.14 Pin Diagram of IC7805 Fig.15 BC547 Transistor Fig.16 Internal Block diagram of LCD Display Fig.17 Pin Configuration of LCD Display Fig.18 Pin Configuration of RF Transmitter/Receiver Fig.19 Different components of GPS Fig.20 GPS Receiver communication with satellite and sending information through the wireless mobile phone Fig.21 GPS modem device Fig.22 Pin Diagram of L293D Fig.23 Pin Diagram of TSOP Fig.24 Working of LED Fig.25 Soldering Procedure 9 18 23 24 24 30 34 35 35 36 38 44 46 47 49 50 53 53 54 58 60 61 63 64 66 70
  10. 10. LIST OF TABLES Page No. 31 39 41 45 46 48 49 53 54 55 Table1. PIN Description of AT89C51 Table2. SFRs of AT89C51 Table3. SFRs of AT89C51 Table4. PIN Description of IC MAX232 Table5. PIN Description of IC HT12D Table6. PIN Description of IC HT12E Table7. PIN Description of IC 7805 Table8. Ratings of LCD Display Table9. PIN Description of RF Transmitter Table10. PIN Description of RF Receiver 10
  11. 11. INTRODUCTION 11
  12. 12. 1. INTRODUCTION In general, we have no correct mechanism to know the parameters like the route in which a vehicle has travelled, where was it at a particular instant of time, with what speed did it travel at that place and time and did it go to the desired place or not, we don’t have a option rather than to believe the driver. The problem arises when the driver doesn’t give us the exact authentic information. If we want vehicle to go to certain place, via certain route later when we access the information about the journey, we have to simply depend up on the driver for the information of the vehicle and the driver may not give us the exact information about the journey and could use the (vehicle) for his personal use. The GPS BASED VEHICLE MONITORING SYSTEM answers to all the problems raised above. We can know the parameters like latitude and longitude; route adopted by the driver without being dependent on him. We make use of a GPS modem, Micro controller and a wireless network (RF transceiver) and PC. Data from GPS receiver is sent to the LCD. We can store the position of vehicle by using remote control. Later this stored information can be viewed by connecting it to PC. 12
  14. 14. 2. PRINCIPLE OF OPERATION The vehicle monitoring system deals with the latitude and longitude of vehicle which is obtained from GPS receiver and display the data on the LCD. As it involves the identification of the vehicle it requires a Global Processing System (GPS) to know the position of the vehicle. There are 24 satellites revolving around the earth’s orbit, at least 3 satellites are required for the GPS receiver. When the GPS receiver is exposed to at least 3 satellites it receives the data from the satellites i.e. latitude, longitude, distance, speed, time, altitude. The receiver continuously gives the data until it is switched off. A 5V external power supply is given to the GPS receiver. The baud rate of the GPS receiver is 4800 bits/sec. The GPS receiver is interfaced with a Microcontroller (AT 89C51). The 5V power supply is needed for the micro controller. The GPS receiver is interfaced with the Microcontroller using a RS-232 protocol. The data from the GPS RECEIVER is transferred to the PC using a wireless network i.e. RF transceiver. There are two RF transceivers, one is connected to PC and other is connected to Microcontroller. The data is presented in the Google Earth map graphically. For collision avoidance it uses IR sensor to sense the obstacle and send signal to embedded controller. The embedded controller receives these obstacle detecting signals and then send signal to motors for taking direction to avoid obstacle. The project uses µc 80C51 as the controlling element. It uses 3 IR (Infra Red) sensors and 3 IR transmitting circuitry. When the obstacle comes in path of robot IR beam is reflected from the obstacle then sensor gives +5V voltage to µc. This +5V voltage is detected then µc decides to avoid the obstacle by taking left or right turn. If the sensor 14
  15. 15. gives zero to µc that means there is no obstacle present in its path so it goes straight until any obstacle is detected. The three IR transmitter circuits are fitted on front, right and left side of robot. The three IR sensors are placed near to transmitters’ IR LEDs. The connections can be given from main circuit to sensors using simple twisted pair cables. Two motors namely right motor and left motor are connected to driver IC (L293D). L293D is interface with µc. Micro-controller sends logic 0 & logic 1 as per the programming to driver IC which moves motors forward or reverse direction 15
  16. 16. BLOCk DIAgRAm 16
  17. 17. 3. Block Diagram: 3.1 GPS Section: 17
  18. 18. Fig 1: G.P.S Based Vehicle Monitoring System 3.2 Collision Avoidance Section: Fig 2: Collision Avoidance System 18
  19. 19. The Major Building blocks of this Project 1. Microcontroller (AT89C51) 2. Motor driver IC (L293D) 3. DC Motors 4. GPS Receiver 5. RF Transceiver 6. Power supply 7. R.S 232 8. LCD 9. IR Sensors BLOCK DIAGRAM EXPLANATION: Overview of each block is given below: 1. Microcontroller This is the most important block of the system. Microcontroller is the decision making logical device which has its own memory, I/O ports, CPU and Clock circuit embedded on a single chip. 2. Driver L293D is used as driver IC. Motors are connected to this IC. According to program in µc it drives the left and right motor. 3. Motor 19
  20. 20. We have used two D.C motors to give motion to the ROBOT. Motors are connected to L293D IC. According to the program in microcontroller, the left and right motor drives. 4. GPS GPS is the only fully functional GNSS in the world. GPS uses the constellation of between 24 and 32 Medium Earth Orbit satellites that transmit precise microwave signals, which enable GPS receivers to determine their current location, the time, and their velocity. Its official name is NAVSTAR GPS. 5. RF Transceiver: 5.1 Transmitter in RF Transceiver: The base stations and subscriber units include radio frequency transmitters and RF receivers; together they're called "RF transceivers." RF transceivers service the wireless links between the base stations and subscriber units. The RF transmitter receives a base band signal from a base band processor, converts the base band signal to an RF signal, and couples the RF signal to an antenna for transmission. 5.2 Receiver in RF Transceiver: The function of the receiver is to detect signals in the presence of noise and interference, and provide amplification, down conversion and demodulation of the detected the signal such that it can be displayed or used in a data processor. 6. Power Supply: 20
  21. 21. The power supply unit is used to provide a constant 5V supply to different IC’s. This is a circuit in which external 12VDC Battery is connected to fixed 3-pin voltage regulator. Diode is added in series to avoid Reverse voltage. 7. RS 232: Two allow compatibility among the data communication equipment made by various manufacturers; an interfacing standard called RS232, was set by the electronics industries association (EIA) in 1960. RS 232 is the standard defined for the connection of "Data Terminal Equipment" (DTE) to "Data Communications Equipment" (DCE). 8. LCD: A liquid crystal display (LCD) is a flat panel display, electronic visual display, or video display that uses the light modulating properties of liquid crystals (LCs). LCs does not emit light directly. 9. IR Transmitter & Receiver The IR Transmitter block mainly used to generate IR signal. It uses timer IC555 in astable multivibrator mode to generate square wave which have continuous pulses of 50% duty cycle of frequency 38 KHz. This transmitter is so arranged that the IR rays are focused on the sensor. IR sensor (TSOP 1738) which gives normally zero volt at output of it. After receiving infrared light at output of sensor we get +5V 21
  22. 22. CIRCUIT DIAgRAm 22
  23. 23. CIRCUIT DIAGRAM: 4.1 Interfacing With Microcontroller: Fig3: Interfacing with 89C51 23
  24. 24. 4.2 Collision Avoidance Section: Fig 4: Receiver Circuit 24
  25. 25. Fig 5: Transmitter Circuit COmPONENTS LIST 25
  26. 26. COMPONENTS LIST S. No. 1 2 3 4 5 6 7 8 1 2 COMPONENTS QUANTITY Semiconductors IC-AT89C51 Microcontroller 1 IC-HT12D Decoder 1 IC-HT12E Encoder 1 IC-MAX232 Driver/Receiver 1 IC-7805, 5V Regulator 2 NPN Transistor 3 IC- L293D 1 TSOP 1738 1 Resistors R1, R2- 4.7 kΩ 3 R3- 1 kΩ 6 26
  27. 27. 3 1 2 3 4 5 6 7 8 1 2 3 4 VR1- 10 kΩ preset Miscellaneous XTAL- 12MHz Crystal S1- Push-to-On Switch TX1- 38 kHz IR Transmitter RX1- 38 kHz IR Receiver RF Module GPS Module LCD Display DC Motors Capacitors C1, C2- 3.3 nF Ceramic Disk C4-10μF, 16V Electrolytic C- 1μF, Electrolytic 0.01μF, Polyster 27 7 1 1 3 3 1 1 1 2 2 1 4 6
  28. 28. DETAILS OF COmPONENTS 6.1 POWER SUPPLY Power supply is the major concern for every electronic device. The power supply unit is used to provide a constant 5V supply to different IC’s. This is a circuit in which external 12VDC Battery is connected to fixed 3-pin voltage regulator. Diode is added in series to avoid Reverse voltage. Since the controller and other devices used are low power devices there is a need to regulate the output to convert the output to a +5V constant dc. It is accomplished by using following components. 28
  29. 29. Voltage Regulator: The voltage regulator is used for the voltage regulation purpose. We use IC 7805 voltage regulator. The IC number has a specific significance. The number 78 represents the series while 05 represents the output voltage generated by the IC Light Emitting Diode: We employ a light emitting diode for testing the functionality of the power supply circuit. LED’s are also employed in other areas for many purposes. The following are the advantages of using LED’s. • It helps us while troubleshooting the device i.e. when the device is malfunctioning it would be easy to detect where the actual problem arised. • LED employed with microcontroller verifies whether data is being transmitted 29
  30. 30. 6.2 MICROCONTROLLER (AT89C51) The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinot. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. Features: • Compatible with MCS-51™ Products • 4K Bytes of In-System Reprogrammable Flash Memory – Endurance: 1,000 Write/Erase Cycles • Fully Static Operation: 0 Hz to 24 MHz • Three-level Program Memory Lock • 128 x 8-bit Internal RAM • 32 Programmable I/O Lines • Two 16-bit Timer/Counters • Six Interrupt Sources • Programmable Serial Channel • Low-power Idle and Power-down Modes 30
  31. 31. Description of Microcontroller (AT89C51): Fig 6: Pin Diagram of Microcontroller AT89C51 31
  32. 32. Pin Description Pin Description Pin Number Description 1-8 P1.0 - P1.7 - Port 1 9 RST - Reset 10 - 17 P3.0 - P3.7 - Port 3 18 XTAL2 - Crystal 19 XTAL1 - Crystal 20 GND - Ground 21 - 28 P2.0 - P2.7 - Port 2 29 PSEN - Program Store Enable 30 ALE - Address Latch Enable 31 EA - External Access Enable 32 - 39 P0.7 - P0.1 - Port 0 40 Vic - Positive Power Supply TABLE 1 Pin Description: VCC: Supply voltage. GND: Ground. Port 0: Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification. 32
  33. 33. Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C51 as listed below: P3.0 -RXD (serial input port) P3.1- TXD (serial output port) P3.2 -INT0 (external interrupt 0) 33
  34. 34. P3.3 -INT1 (external interrupt 1) P3.4 -T0 (timer 0 external input) P3.5 -T1 (timer 1 external input) P3.6- WR (external data memory write strobe) P3.7 -RD (external data memory read strobe). Port 3 also receives some control signals for Flash programming and verification. RST: Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN: Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP: External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. However, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require12-volt VPP. 34
  35. 35. XTAL1: input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: Output from the inverting oscillator amplifier. Memory Organization: Memory Organization Program Memory The AT89C Microcontroller has separate address spaces for program memory and data memory. The program memory can be up to 64K bytes long. The lower addresses may reside on-chip. Figure 8 shows a map of the AT89C51 program memory, and Figure 9 shows a map of the AT89C52 program memory. The AT89C1051/2051 does not have off-board memory expansion. Figure 7. AT89C51 Program Memory 35
  36. 36. Figure 8. AT89C52 Program Memory B) Data Memory: The AT89C can directly address up to 64K bytes of data memory external to the chip. The MOVX instruction accesses the external data memory. (Refer to the Instruction Set section in this chapter for a detailed description of instructions). The AT89C51 has 128 bytes of on-chip RAM (256 bytes in the AT89C52) plus a number of Special Function Registers (SFRs). The lower 128 bytes of RAM can be accessed either by direct addressing (MOV data addr) or by indirect addressing (MOV @Ri). Figure 10 shows the AT89C51 and the AT89C52 data memory organization. 36
  37. 37. Figure 9A: The AT89C51 Data Memory Figure 9B: The AT89C52 Data Memory Indirect Address Area In Figure 3b, the SFRs and the indirect address RAM have the same addresses (80H through 0FFH). Nevertheless, they are two separate areas and are accessed in two different ways. For example, the following instruction writes 0AAH to Port0, which is one of the SFRs. MOV 80H, # 0AAH The following instruction writes 0BBH in location 80H of the data RAM. MOVR0, # 80H MOV@ R0, # 0BBH 37
  38. 38. Thus, after executing both of these instructions, Port 0 contains 0AAH, and location 80H of the RAM contains 0BBH.The stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space in devices that implement 256 bytes of internal RAM. Direct and Indirect Address Area The 128 bytes of RAM that can be accessed by both direct and indirect addressing can be divided into 3 segments as described in this section and as shown in Figure11. 1. Register Banks 0-3: Locations 0 through 1FH (32bytes). Reset default is to register bank 0. To use the other register banks, the user must select them in the software. Each register bank contains eight 1-byte registers, 0 through 7. Reset initializes the Stack Pointer to location 07H. The Stack Pointer is then incremented once to start from location 08H, which is the first register (R0) of the second register bank. Thus, in order to use more than one register bank, the SP should be initialized to a different location of the RAM that is not used for data storage (that is, a higher part of the RAM). 2. Bit Addressable Area: 16 bytes have been assigned for this segment, 20H through 2FH. Each of the 128 bits of this segment can be directly addressed (0 through 7FH). These bits can be referred to in two ways. One way is to refer to their addresses, that is, 0 to 7FH. The other way is with reference to bytes 20H to 2FH. Thus, bits 0 through 7 can also be referred to as bits 20.0 through 20.7 and bits 8 through FH are the same as 21.0 through 21.7, and so on. Each of the 16 bytes in this segment can also be addressed as a byte. 38
  39. 39. 39
  40. 40. 3. Scratch Pad Area: Bytes 30H through 7FH are available to the user as data RAM. However, if the stack pointer has been initialized to this area, enough bytes should be left aside to prevent SP data destruction. Special Function Registers Table 2 contains a list of all the SFRs and their addresses. 40
  41. 41. TABLE 2 PSW: Program Status Word (Bit Addressable) CY AC F0 RS1 RS1 RS0 OV − P CY PSW.7 Carry flag. AC PSW.6 Auxiliary carry flag. F0 PSW.5 Flag 0 available to the user for general purpose. RS1 PSW.4 Register Bank selector bit 1.(1) RS0 PSW.3 Register Bank selector bit 0. (1) OV PSW.2 Overflow flag. — PSW.1 User definable flag. P PSW.0 Parity flag. Set/cleared by hardware each instruction cycle to indicate an odd/even number of 1’s bit in the accumulator. RS1 RS0 Register Bank 0 0 0 0 1 1 1 0 2 1 1 3 Address 00H-07H 08H-0FH 10H-17H 18H-1FH PCON: Power Control Register (Not Bit Addressable) SMOD − − − GF1 GF0 PD IDL SMOD Double baud rate bi t. If Timer 1 is used to generate baud rate and SMOD = 1, the baud rate is doubled when the Serial Port is used in modes 1, 2, or 3. 41
  42. 42. — Not implemented, reserved for future use.(1) — Not implemented, reserved for future use.(1) — Not implemented, reserved for future use. (1) GF1 General purpose flag bit. GF0 General purpose flag bit. PD Power Down bit. Setting this bit activates Power Down operation in the AT89C51. IDL Idle Mode bit. Setting this bit activates Idle Mode operation in the AT89C51. If 1s are written to PD and IDL at the same time, PD takes precedence. Interrupts In order to use any of the interrupts in the Flash microcontroller, take the following three steps. 1. Set the EA (enable all) bit in the IE register to 1. 2. Set the corresponding individual interrupt enable bit in the IE register to 1. 3. Begin the interrupt service routine at the corresponding Vector Address of that interrupt. See the following table 3. Interrupt Source Vector Address IE0 0003H TF0 000BH IE1 0013H TF1 001BH R1 and T1 0023H (1) TF2 and EXF2 002BH TABLE 3 IE: Interrupt Enable Register (Bit Addressable) If the bit is 0, the corresponding interrupt is disabled. If the bit is 1, the corresponding interrupt is enabled. EA − ET2 ES ET1 42 EX1 ET0 EX0
  43. 43. EA IE.7 Disables all interrupts. If EA = 0, no interrupt is acknowledged. If EA = 1, each interrupt source is individually enabled or disabled by setting or clearing its enable bit. — IE.6 Not implemented, reserved for future use.(1) ET2 IE.5 Enables or disables the Timer 2 overflow or capture interrupt (AT89C52 only). ES IE.4 Enables or disables the serial port interrupt. ET1 IE.3 Enables or disables the Timer 1 overflow interrupt. EX1 IE.2 Enables or disables External Interrupt 1. ET0 IE. 1 Enables or disables the Timer 0 overflow interrupt. EX0 IE.0 Enables or disables External Interrupt 0. Assigning Higher Priority to One or More Interrupts In order to assign higher priority to an interrupt the corresponding bit in the IP register must be set to 1.While an interrupt service is in progress, it cannot be interrupted by an interrupt of the same or lower priority. Priority Within Level The only purpose of priority within a level is to resolve simultaneous requests of the same priority level. From high to low, interrupt sources are listed below. IE0 TF0 IE1 TF1 RI or TI TF2 or EXF2 IP: Interrupt Priority Register (Bit Addressable) If the bit is 0, the corresponding interrupt has a lower priority. If the bit is 1, the corresponding interrupt has a higher priority. 43
  44. 44. − − PT2 PS PT1 PX1 — IP. 7 PX0 Not implemented, reserved for future use.(1) — PT0 Not implemented, reserved for future use.(1) IP. 6 PT2 IP. 5 Defines the Timer 2 interrupt priority level (AT89C52 only). PS Defines the Serial Port interrupt priority level. IP. 4 PT1 IP. 3 Defines the Timer 1 interrupt priority level. PX1 IP. 2 Defines External Interrupt 1 priority level. PT0 IP. 1 Defines the Timer 0 interrupt priority level. PX0 IP. 0 Defines the External Interrupt 0 priority level. TCON: Timer/Counter Control Register (Bit Addressable) TF1 TF1 TCON. 7 TR1 TF0 TR0 IE1 IT1 IE0 IT0 Timer 1 overflow flag. Set by hardware when the Timer/Counter 1 overflows. Cleared by hardware as the processor vectors to the interrupt service routine. TR1 TCON. 6 Timer 1 run control bit. Set/cleared by software to turn Timer/Counter 1 ON/OFF. TF0 TCON. 5 Timer 0 overflow flag. Set by hardware when the Timer/Counter 0 overflows. Cleared by hardware as the processor vectors to the service routine. TR0 TCON. 4 Timer 0 run control bit. Set/cleared by software to turn Timer/Counter 0 ON/OFF. IE1 TCON. 3 External Interrupt 1 edge flag. Set by hardware when the External Interrupt edge is detected. Cleared by hardware when the interrupt is processed. 44
  45. 45. IT1 TCON. 2 Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low level triggered. External Interrupt. IE0 TCON. 1 External Interrupt 0 edge flag. Set by hardware when External Interrupt edge detected. Cleared by hardware when interrupt is processed. IT0 TCON. 0 Interrupt 0 type control bit. Set/cleared by software to specify falling edge/low level triggered. 6.3 IC MAX 232 The MAX232 from Maxim was the first IC which in one package contains the necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. Fig12: MAX232 DIP Package 45
  46. 46. MAX232 DIP PACKAGE LAYOUT Nbr 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Name C1+ V+ C1C2+ C2VT2out R2in R2out T2in T1in R1out R1in T1out GND VCC Purpose +Connector for Capacitor C1 Output of Voltage Pump -Connector for Capacitor C1 +Connector for Capacitor C2 -Connector for Capacitor C2 Output of Voltage Pump/Inverter Driver 2 Output Receiver 2 Input Receiver 2 Output Driver 2 Input Driver 1 Input Receiver 1 Output Receiver 1 Intput Driver 1 Output Ground Power Supply TABLE 4 6.4 IC HT12D 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 46
  47. 47. Fig12: PIN Assignment of HT12D PIN DESCRIPTION Pin Name A0~A11 I/O D8 ~D11 DIN VT OSC1 OSC2 VSS VDD O I O I O I I I Internal connection NMOS TRANSMISSION GATE CMOS OUT CMOS IN CMOS OUT OSCILLATOR OSCILLATOR − − Description Input pins for address A0 ~ A11 setting They can be externally set to VDD or VSS. Output Data Pins Serial Data Input Pin Valid Transmission ON, Active High Oscillator Input Pin Oscillator Output Pin Negative Power Supply Positive Power Supply TABLE 5 47
  48. 48. 6.5 IC HT12E Features • Operating voltage • 2.4V~5V for the HT12A • 2.4V~12V for the HT12E • Low power and high noise immunity CMOS technology • Low standby current: 0.1_A (typ.) at VDD=5V • HT12A with a 38kHz carrier for infrared Fig13: PIN Assignment of HT12E 48
  49. 49. PIN Description Pin Name A0 ~ A7 I/O I AD8 ~ AD11 I D8 – D11 I DOUT L/MB Internal Connection CMOS-IN Pull-High (HT12A) NMOS TRANSMISSION GATE PROTECTION DIODE (HT12E) NMOS TRANSMISSION GATE PROTECTION DIODE (HT12E) CMOS IN Pull High O I CMOS OUT CMOS IN Pull High Description Input pins for address A0 ~ A7 setting These pins can be externally set to V or left open. Input pins for address/data AD8 ~ AD11 setting These pins can be externally set to V or left open. Input pins for data D8 ~ D11 setting and transmission enable, active low These pins should be externally set to V or left open. Encoder data serial transmission output Latch/Momentary transmission format selection pin: Latch: Floating or VDD Momentary: VSS TABLE 6 6.6 IC 7805 Features • Output Current up to 1A • Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V • Thermal Overload Protection • Short Circuit Protection • Output Transistor Safe Operating Area Protection 49
  50. 50. Fig 14: PIN Description Pin No. Function 1 Input Voltage (5V-18V) 2 Ground (0V) 3 Regulated Output; 5V (4.8V-5.2V) 50 Name Input Ground Output
  51. 51. TABLE 7 6.7 BC 547 TRANSISTOR BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is commonly used to amplify current. A small current at its base controls a larger current at collector & emitter terminals. BC547 is mainly used for amplification and switching purposes. It has a maximum current gain of 800. Its equivalent transistors are BC548 and BC549. For amplification applications, the transistor is biased such that it is partly on for all input conditions. The input signal at base is amplified and taken at the emitter. BC547 is used in common emitter configuration for amplifiers. Fig15: BC 547 Transistor 6.8 RESISTOR 6.8.1 RESISTOR: 51
  52. 52. A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. The current through a resistor is in direct proportion to the voltage across the resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the intensity of current through the circuit is called resistance. This relation is represented by Ohm's law : where I is the current through the conductor in units of amperes, V is the potential difference measured across the conductor in units of volts, and R is the resistance of the conductor in units of ohms. Practical resistors have a series inductance and a small parallel capacitance; these specifications can be important in high-frequency applications. The ohm (symbol: Ω) is the SI unit of electrical resistance, named after Georg Simon Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured over a very large range of values, the derived units of milliohm (1 mΩ = 10−3 Ω), kilohm (1 kΩ = 103Ω), and megaohm (1 MΩ = 106 Ω) are also in common usage. The symbol used for a resistor in a circuit diagram varies from standard to standard and country to country. 6.8.2 POTENTIOMETER: A common element in electronic devices is a threeterminal resistor with a continuously adjustable tapping point controlled by rotation of a shaft or knob. These variable resistors are known as potentiometers when all three terminals are present, since they act as a continuously adjustable voltage divider. A common example is a volume control for a radio receiver. Accurate, high-resolution panel-mounted potentiometers (or "pots") have resistance elements typically wirewound on a helical mandrel, although some include a conductive-plastic resistance coating over the wire to improve resolution. These 52
  53. 53. typically offer ten turns of their shafts to cover their full range. They are usually set with dials that include a simple turns counter and a graduated dial. Electronic analog computers used them in quantity for setting coefficients, and delayed-sweep oscilloscopes of recent decades included one on their panels. 6.9 CAPACITOR The function of the capacitor is to store electric charge or in effect electrical energy. It is very useful as a filter, and for passing AC and blocking DC. It consists of two metal plates separated by a dielectric in between. The symbol is- 1 ELECTROLYTIC CAPACITORS The important characteristic of electrolytic capacitors is that they have polarity. They have a positive and a negative electrode. Aluminum is used for the electrodes by using thin oxidization membrane. Electrolytic capacitors range in value from about 1μF to thousands of μF. Mainly this type of capacitor is used as a ripple filter in a power supply circuit, or as a filter to bypass low frequency signals, etc. POLYESTER FILM CAPACITORS 53
  54. 54. This capacitor uses thin polyester film as the dielectric. They are not high in tolerance, but they are cheap and handy. Their tolerance is about ±5% to ±10%. 6.10 LCD JHD 162A A liquid crystal display (LCD) is a flat panel display, electronic visual display, or video display that uses the light modulating properties of liquid crystals (LCs). LCs do not emit light directly. Fig 16: Internal Block Diagram RATINGS: Parameter Symbol Testing Criteria Supply Voltage Input High Voltage Input Low Voltage Output High Voltage Output Low Voltage Operating Voltage VD0 –VSS VIH VIL VOH VOL IDD − − − -IOH=0.2mA IOL =1.2 mA VDD =5.0V Standard Values Min. Typ. Max. 4.5 5.0 5.5 2.2 − VDD -0.3 − 0.6 2.4 − − − − 0.4 − 1.5 3.0 Unit V V V V V mA TABLE 8 1 2 VSS VCC 3 VEE 4 5 RS R/W 6 E 7 DB0 8 DB1 54 9 DB2 10 DB3 11 DB4 12 DB5 13 14 15 DB6 DB7 LED+ 16 LED-
  55. 55. Fig 17: Pin Configuration 6.11 RF TRANSECEIVER The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation is known as Amplitude Shift Keying (ASK). Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources. This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter. The RF module is often used alongwith a pair of encoder/decoder. The encoder is used for encoding parallel data for transmission feed while reception is decoded by a decoder. 55
  56. 56. Fig 18 : Pin Configuration Pin Description Pin No 1 2 3 4 Function Name Ground (0V) Serial data input pin Supply voltage; 5V Antenna output pin Ground Data Vcc ANT TABLE 9 : RF Transmitter Pin No 1 2 3 4 5 6 7 8 Function Name Ground (0V) Serial data output pin Linear output pin; not connected Supply voltage; 5V Supply voltage; 5V Ground (0V) Ground (0V) Antenna input pin Ground Data NC Vcc Vcc Ground Ground ANT TABLE 10 : RF Receiver 6.12 GPS MODULE 6.12.1 Global Positioning System (GPS): The Global Positioning System (GPS) is a burgeoning technology, which provides unequalled accuracy and flexibility of positioning for navigation, surveying and GIS data capture. The GPS NAVSTAR (Navigation Satellite timing and Ranging Global Positioning System) is a satellite-based navigation, timing and positioning system. The GPS provides continuous three-dimensional positioning 24 hrs a day throughout the 56
  57. 57. world. The technology seems to be beneficiary to the GPS user community in terms of obtaining accurate data up to about100 meters for navigation, meter-level for mapping, and down to millimeter level for geodetic positioning. The GPS technology has tremendous amount of applications in GIS data collection, surveying, and mapping. The Global Positioning System (GPS) is a U.S. space-based radio navigation system that provides reliable positioning, navigation, and timing services to civilian users on a continuous worldwide basis -- freely available to all. For anyone with a GPS receiver, the system will provide location with time. GPS provides accurate location and time information for an unlimited number of people in all weather, day and night, anywhere in the world. The Global Positioning System (GPS) is a satellite-based navigation system made up of a network of 24 satellites placed into orbit by the U.S. Department of Defense. GPS was originally intended for military applications, but in the 1980s, the government made the system available for civilian use. GPS works in any weather conditions, anywhere in the world, 24 hours a day. There are no subscription fees or setup charges to use GPS. The GPS is made up of three parts: satellites orbiting the Earth; control and monitoring stations on Earth; and the GPS receivers owned by users. GPS satellites broadcast signals from space that are picked up and identified by GPS receivers. Each GPS receiver then provides three-dimensional location (latitude, longitude, and altitude) plus the time. 6.12.2 Geo positioning -- Basic Concepts: By positioning we can understand the determination of stationary or moving objects. These can be determined as follows: 1. In relation to a well-defined coordinate system, usually by three coordinate values and 2. In relation to other point, taking one point as the origin of a local coordinate system. 57
  58. 58. The first mode of positioning is known as point positioning, the second as relative positioning. If the object to be positioned is stationary, we can term it as static positioning. When the object is moving, we call it kinematics positioning. Usually, the static positioning is used in surveying and the kinematics position in navigation. GPS Basic Facts: The GPS uses satellites and computers to compute positions anywhere on earth. The GPS is based on satellite ranging. That means the position on the earth is determined by measuring the distance from a group of satellites in space. The basic principles behind GPS are really simple, even though the system employs some of the high-tech equipment ever developed. In order to understand GPS basics, the system can be categorized into 5 Logical steps . They are listed below: 1. Triangulation from the satellite is the basis of the system. 2. To triangulate, the GPS measures the distance using the travel time of the radio message. 3. To measure travel time, the GPS need a very accurate clock. 4. Once the distance to a satellite is known, then we need to know where the satellite is in space. 5. As the GPS signal travels through the ionosphere and the earth's atmosphere, the signal is delayed. 6. To compute a position in the three dimensions, we need to have four satellite measurements. The GPS uses a trigonometric approach to calculate the positions, The GPS satellites are so high up that their orbits are very predictable and each of the satellites is equipped with a very accurate atomic clock. 58
  59. 59. 6.12.3 Components of a GPS: The GPS is divided into three major components: Fig 19 : Different Components Of GPS A) The Control Segment: 59
  60. 60. The DOD monitoring stations track all GPS signals for use in controlling the satellites and predicting their orbits. Meteorological data also are collected at the monitoring stations, permitting the most accurate evaluation of tropospheric delays of GPS signals. Satellite tracking data from the monitoring stations are transmitted to the master control station for processing. This processing involves the computation of satellite ephemerides and satellite clock corrections. The master station controls orbital corrections, when any satellite strays too far from its assigned position, and necessary repositioning to compensate for unhealthy (not fully functioning) satellites. B) The Space Segment: The Space Segment consists of the Constellation of NAVASTAR earth orbiting satellites. The current Defense Department plan calls for a full constellation of 24 Block II satellites (21 operational and 3 in-orbit spares). The satellites are arrayed in 6 orbital planes, inclined 55 degrees to the equator. They orbit at altitudes of about 12000, miles each, with orbital periods of 12 sidereal hours (i.e., determined by or from the stars), or approximately one half of the earth's periods, approximately 12 hours of 3-D position fixes. The next block of satellites is called Block IIR, and they will provide improved reliability and have a capacity of ranging between satellites, which will increase the orbital accuracy. Each satellite contains four precise atomic clocks (Rubidium and Cesium standards) and has a microprocessor on board for limited self-monitoring and data processing. The satellites are equipped with thrusters which can be used to maintain or modify their orbits. C) The User Segment: The user segment is a total user and supplier community, both civilian and military. It consists of all earth-based GPS receivers. Receivers vary greatly in size and complexity, though the basic design is rather simple. The typical receiver is composed of an antenna and preamplifier, radio signal microprocessor, control and display device, data recording unit, and power supply. The GPS receiver decodes the timing signals from the 'visible' satellites (four or more) and, having calculated their distances, 60
  61. 61. computes its own latitude, longitude, elevation, and time. This is a continuous process and generally the position is updated on a second-by-second basis, output to the receiver display device and, if the receiver display device and, if the receiver provides data capture capabilities, stored by the receiver-logging unit. 6.12.4 How it works: GPS satellites circle the earth twice a day in a very precise orbit and transmit signal information to earth. GPS receivers take this information and use triangulation to calculate the user's exact location. Essentially, the GPS receiver compares the time a signal was transmitted by a satellite with the time it was received. The time difference tells the GPS receiver how far away the satellite is. Now, with distance measurements from a few more satellites, the receiver can determine the user's position and display it on the unit's electronic map. GPS receiver must be locked on to the signal of at least three satellites to calculate a 2D position (latitude and longitude) and track movement. With four or more satellites in view, the receiver can determine the user's 3D position (latitude, longitude and altitude). Once the user's position has been determined, the GPS unit can calculate other information, such as speed, bearing, track, trip distance, distance to destination, sunrise and sunset time and more. 61
  62. 62. Fig 20: G.P.S receiver communicating with the satellite and sending information through the wireless mobile phone 6.12.5 G.P.S receiver Fig 21 : GPS Modem Device(MR-87) 62
  63. 63. Features: • Low cost • Compact (25. 4 x 25. 4 x 7 mm) • 32 Channel Receiver • Low Power Consumption • Built-in Antenna • Standard NMEA protocol USB or Serial • Available baud rate :4800/9600/14400/19200/38400/57600/115200 • Frequency :1575. 42 MHz • Power Supply :3. 3 ~ 5Vdc • Maximum Altitude :18,000 meter • Maximum Velocity :515 meter/second 6.12.6 GPS Applications: There are countless GPS applications, a few important ones are covered in the following passage. Science: • Archaeology • Environmental Transportation: • Aviation • Space Military: 63
  64. 64. • Intelligence and Target Location • Navigation • Weapon aiming and Guidance Industry: • Mapping • Public safety • Surveying • Telecommunications 6.13 IC L293D Features: • 600mA OUTPUT CURRENT CAPABILITY • 1.2A PEAK OUTPUT CURRENT • ENABLE FACILITY • OVER TEMPERATURE PROTECTION • LOGICAL ”0” INPUT VOLTAGE UP TO 1.5 V (HIGH NOISE IMMUNITY) • INTERNAL CLAMP DIODES 64
  65. 65. Fig 22 : Pin Diagram 6.14 TSOP 1738 The TSOP 1738 is a member of IR remote control receiver series. This IR sensor module consists of a PIN diode and a pre amplifier which are embedded into a single package. The output of TSOP is active low and it gives +5V in off state. When IR waves, from a source, with a centre frequency of 38 kHz incident on it, its output goes low. Features: • Photo detector and preamplifier in one package • Internal filter for PCM frequency • Improved shielding against electrical field disturbance • TTL and CMOS compatibility 65
  66. 66. • Output active low • Low power consumption • High immunity against ambient light • Continuous data transmission possible (up to 2400 bps) Fig 23: Pin Diagram 6.15 IR Transmitter/Receiver It consists of 5mm 940 nanometer wave length high power IR LED and photodiode having peak sensitivity at 940 nanometer wavelength. Specifications: • IR TX RX size: 5mm diameter package • IR LED current rating: 30mA nominal, 600mA pulse loading at 1% duty cycle • IR LED wavelength: 940Nm 66
  67. 67. • Photodiode peak response wavelength: 940nMAn IR LED, also known as IR transmitter, is a special purpose LED that transmits infrared rays in the range of 760 nm wavelength. Such LEDs are usually made of gallium arsenide or aluminium gallium arsenide. They, along with IR receivers, are commonly used as sensors. 6.16 DC Motor A DC motor is an electric motor that runs on direct current (DC) electricity. DC motors were used to run machinery, often eliminating the need for a local steam engine or internal combustion engine. DC motors can operate directly from rechargeable batteries, providing the motive power for the first electric vehicles. Today DC motors are still found in applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and paper machines. Modern DC motors are nearly always operated in conjunction with power electronic devices. Two important performance parameters of DC motors are the motor constants Kv and Km. 6.17 LED A light-emitting diode (LED) is a semiconductor light source. When a light emitting diode is forward-biased on), electrons are (switched 67 able to
  68. 68. recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. The LED consists of a chip of semiconducting material doped with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—electrons and holes—flow into the junction from electrodes with different voltages. When an electron meets a hole, it falls into a lower energy level, and releases energy in the form of a photon. The wavelength of the light emitted, and thus its color depends on the band gap energy of the materials forming the p-n junction. In silicon or germanium diodes, the electrons and holes recombine by a non-radioactive transition, which produces no optical emission, because these are indirect band gap materials. The materials used for the LED have a direct band gap with energies corresponding to near-infrared, visible, or near-ultraviolet light. LED development began with infrared and red devices made with gallium arsenide. Advances in materials science have enabled making devices with ever-shorter wavelengths, emitting light in a variety of colors. Fig 24: Working of LED The symbol of LED is: 68
  69. 69. 69
  70. 70. HARDWARE DESIGN 70
  71. 71. HARDWARE DESIGN: Firstly, circuit is drawn on multipurpose pub then at appropriate place components are soldered by following process. Soldering is a process in which two or more metal items are joined together by melting and flowing a filler metal (solder) into the joint, the filler metal having a lower melting point than the work piece. Step 1 SOLDERING PROCEDURE Check that your soldering iron tip is suitable for the Project. (No larger than the diameter of the pad). Check the tip is clean and shiny. If not, tin it by adding a small amount of Step 2 solder to the tip. Adjust the temperature of the soldering station to 3500 C (degrees Celsius ) Step 3 Ensure the solder sponge is damp. A dry sponge will not clean the tip effectively, and one that is too wet will lower the temperature of the tip making for an ineffective solder joint. Step 4 Carefully wipe the tip on the damp sponge until clean. Continually wipe the tip while soldering a circuit board. Step 5 Bend the lead of the component using fine pliers so that it easily slides into the holes of the printed circuit pad. Step 5 Insert the component to be soldered into the circuit board and bend the leads Step 6 Step 7 protruding from the bottom of the circuit board at an angle of approx 450. Cut the leads of the component close to the outer edge of the solder pad. When ready, hold the soldering iron at a 45° angle, and heat both the lead and the pad simultaneously. Touch the solder wire in the space between the iron tip and the lead. 71
  72. 72. Fig 25: Soldering Procedure Step 8 Keep the soldering iron tip still while moving the solder around the joint as it melts. Step 9 Remove the solder tip first and the solder wire next, (prevents spiking). Step 10 Allow to the joint to cool naturally and undisturbed, do not blow on the solder joint to cool it. Step 11 When you have completed all solder joints thoroughly clean your board, using Isopropyl Alcohol, and a bristle brush, to remove the flux residue and other contaminants. Step 12 Wipe or pat dry with a lint free tissue to remove traces of residue. Step 13 Inspect for a good solder connection. The solder joint should be clean, smooth and shiny. Figure a) the amount of solder applied is minimal and may result in a poor electrical connection over time. Figure b) is the ideal solder joint. Figure c) indicates an excessive amount of solder has been applied to the connection. This may damage the solder pad due to excessive heat applied. 72
  73. 73. Step 13 Leave a large blob of solder on the tip when switching the iron off as this will protect the tip from oxidation and contamination. 73
  74. 74. SOFTWARE DESIGN 2 3 74
  75. 75. 8.1 PROGRAMMING GPS SECTION * Basic program to show latitude and longitude on LCD extracted from GPGGA statement */ #include<reg51.h> #define port2 P2 sbit rs = P1^0; sbit rw = P1^1; sbit e = P1^2; char info[70]; char test[6]={"$GPGGA"}; char comma_position[15]; unsigned int check=0,i; unsigned char a; void receive_data(); void lcd_latitude(); void lcd_longitude(); //DELAY FUNCTION void delay(unsigned int msec) { int i,j for(i=0;i<msec;i++) for(j=0;j<1275;j++); 75
  76. 76. } // LCD COMMAND SENDING FUNCTION void lcd_cmd(unsigned char item) { port2 = item; rs= 0; rw=0; e=1; delay(1); e=0; return; } // LCD DATA SENDING FUNCTION void lcd_data(unsigned char item) { port2 = item; rs= 1; rw=0; e=1; delay(1); e=0; return; } 76
  77. 77. // LCD STRING SENDING FUNCTION void lcd_string(unsigned char *str) { int i=0; while(str[i]!='0') { lcd_data(str[i]); i++; delay(10); } return; } // SERIAL PORT SETTING void serial() { TMOD=0x20; TH1=0xfa; SCON=0x50 ; BIT , RECEIVING ON TR1=1; //MODE=2 // 4800 BAUD // SERIAL MODE 1 ,8- BIT DATA ,1 STOP BIT ,1 START //TIMER START } void find_comma() { 77
  78. 78. unsigned int i,count=0; for(i=0;i<70;i++) { if(info[i]==',') { comma_position[count++]=i; } } } void compare() { IE=0x00; //Interrupt disable find_comma(); lcd_latitude(); //Function to detect position of comma in the string //Function to show Latitude lcd_longitude(); //Function to show Longitude check=0; IE=0x90; //Interrupt enable } void receive_data() interrupt 4 { info[check++]=SBUF; if(check<7) //Read SBUF //Condition to check the required data 78
  79. 79. { if(info[check-1]!=test[check-1]) check=0; } RI=0; } void lcd_shape() //Function to create shape of degree { lcd_cmd(64); lcd_data(10); lcd_data(17); lcd_data(17); lcd_data(10); lcd_data(0); lcd_data(0); lcd_data(0); lcd_data(0); } void lcd_latitude() //Function to display Latitude { unsigned int c2=comma_position[1]; //Position of second comma lcd_shape(); lcd_cmd(0x01); // Clear LCD display 79
  80. 80. lcd_cmd(0x84); //Move cursor to position 6 of line 1 lcd_string("LATITUDE"); //Showing Latitude lcd_cmd(0xC0); //Beginning of second line lcd_data(info[c2+1]); lcd_data(info[c2+2]); lcd_data(0); //Degree symbol lcd_data(info[c2+3]); lcd_data(info[c2+4]); lcd_data(info[c2+5]); lcd_data(info[c2+6]); lcd_data(info[c2+7]); lcd_data(info[c2+8]); lcd_data(info[c2+9]); lcd_data(0x27); //ASCII of minute sign(') lcd_data(info[c2+10]); lcd_data(info[c2+11]); delay(250); } void lcd_longitude() { unsigned int c4=comma_position[3]; lcd_cmd(0x01); //Clear LCD display 80
  81. 81. lcd_cmd(0x84); //Move cursor to position 4 of line 1 lcd_string("LONGITUDE"); //Showing Longitude lcd_cmd(0xC0); //Begining of second line lcd_data(info[c4+1]); lcd_data(info[c4+2]); lcd_data(info[c4+3]); lcd_data(0); lcd_data(info[c4+4]); lcd_data(info[c4+5]); lcd_data(info[c4+6]); lcd_data(info[c4+7]); lcd_data(info[c4+8]); lcd_data(info[c4+9]); lcd_data(info[c4+10]); lcd_data(0x27); //ASCII of minute sign(') lcd_data(info[c4+11]); lcd_data(info[c4+12]); delay(250); } void main() { serial(); lcd_cmd(0x38); //2 LINE, 5X7 MATRIX 81
  82. 82. lcd_cmd(0x0e); //DISPLAY ON, CURSOR BLINKING IE=0x90; while(1) { if(check==69) compare(); } } COLLISION AVOIDANCE SECTION: ALGORITHM-: 1) Start 2) Initialize the input port & output port. 3) Read data from pin 2.0,pin 2.1,pin 2.2. 4) If pin2.0=1, turn right. Else goto step 5. 5) If pin2.1=1, turn right. Else goto step 6. 6) If pin2.2=1, turn left. Else goto step 7. 7) If pin2.0&pin2.1=1, turn right Else goto step 8. 8) If pin2.2&pin2.1=1, turn left Else goto step 9. 9) If pin2.0&pin2.2=1,move forward Else goto step 10. 10) If pin2.0&pin2.1&pin2.2=1, move backward Else goto step 11. 11) Again go to step 3. 82
  83. 83. 12) Stop. PROGRAMMING #$mod51 org 00h mov p2,#0ffh ag: mov a,p2 anl a,#07h cjne a,#01h,la1 mov p1,#02h sjmp ag la1: mov a,p2 anl a,#07h cjne a,#02h,la2 mov p1,#02h sjmp ag la2: mov a,p2 anl a,#07h cjne a,#04h,la3 mov p1,#02h sjmp ag la3: mov a,p2 anl a,#07h cjne a,#00h,la4 mov p1,#00010100b sjmp ag la4: mov a,p2 anl a,#07h 83
  84. 84. cjne a,#07h,la5 mov p1,#0ah sjmp ag la5: mov a,p2 anl a,#07h cjne a,#03h,la6 mov p1,#00001100b sjmp ag la6: mov a,p2 anl a,#07h cjne a,#06h,ag mov p1,#00010010b sjmp ag end 84
  85. 85. 8.2 SOFTWARE DESCRIPTION µVision Keil: µVision Keil provides IDE for 8051 programming & is very easy to use. When starting a new project, simply select the microcontroller you use from the Device Database and the µVision IDE sets all Compiler, Assembler, Linker, and Memory options. It’s device database is large which supports many ICs of the 8051 family. A HEX file can be created with the help of Keil which is required for burning onto chip. It has a powerful debugging tool which detects most of the errors in the program. Working with µVision Keil : To open keil software click on start menu then program and then select keil2. Following window will appear on your screen. You can see three different windows in this screen. 1) Project work space window 2) Editing window 85
  86. 86. 3) Output window Project workspace window is for showing all the related files connected with your project. Editing window is the place where you will edit the code. Output window will show the output when you compile or build or run your project. Creating new project in d:keil2myprojectsfirst as shown in figure. • Give the name of project as "test". By default it will be saved as *.v2 extension. • Now you will be asked to choose your target device for which you want to write the program. Scroll down the cursor and select generic from list. Expand the list and select 8051 (all variants). 86
  87. 87. • When you click OK, you will be asked to add startup code and file to your project folder. Click yes. Now on your screen expand target1 list fully. You will see following window: • Now click on file menu and select new file. Editor window will open. Now you can start writing your code. • As you start writing program in C, same way here also you have to first include the header file. Because our target is 8051 our header file will be "reg51.h". • After including this file. Just right click on the file and select open document <reg51.h>. The following window will appear: 87
  88. 88. • If you scroll down cursor you will see that all the SFRs like P0-P3, TCON, TMOD, ACC, bit registers and byte registers are already defined in this header file. So one can directly use these register names in coding. • Now you can write your program same as c language starting with void main(). • After completing the code save the file in project folder with ".c" extension. • Now right click on "source group 1" in project workspace window. Select "add files to source gorup 1". • Select the C file you have created and click add button. 88
  89. 89. • You will see that the c file has been added in source group. • Now to compile the program from project menu select "build target". In the output window you will see the progress. • If there is any compilation error then target will not be created. Remove all the errors and again build the target till you find "0 Error(s)". • Now you are ready to run your program. From debug menu select "start/stop debug session". • You will see your project workspace window now shows most of the SFRs as well as GPRs r0-r7. Also one more window is now opened named "watches". In this window you can see different variable values. • To add variable in watch window goto "watch#1" tab. Then type F2 to edit and type the name of your variable. • If you want to see the output on ports go to peripheral menu and select I/O ports. Select the desire port. You can give input to port pins by checking or unchecking any check box. Here the check mark means digit 1 and no check mark means 0. The output on the pin will be shown in same manner. • To run the program you can use any of the option provided "go", "step by step", "step forward", "step ove" etc. 89
  90. 90. • Now after testing your program you need to down load this program on your target board that is 8051. For this you have to create hex file. • To create hex file first stop debug session. Again you will be diverted to project workspace window. • Right click on "target 1" and select "option for target 1". Following window will appear. • • Select output tag and check "create hex file" box. Now when you again build your program, you will see the message in output window "hex file is created". • In your project folder you can see the hex file with same name of your project as "test.hex". • This file you can directly load in 8051 target board and run the application on actual environment. 90
  91. 91. TESTING 91
  92. 92. TESTING:1.Continuity test:First of all we checked the PCB that all the tracks are as per the design of PCB and showing continuity with the help of multimeter and PCB layout. 2. Short circuit test:Then we checked the PCB for any unwanted short circuits with the help of multimeter and PCB layout. 3. Soldering:In the next step, we soldered the required components. And then checked that there are no any unwanted shorts occurred due to soldering without putting IC's and keeping power supply off. 4. Power supply test:In the next step, we put power supply on and checked whether required voltage is appearing at the required voltage is appearing at the required points i.e. +Vcc and GND at the respective points. We took care of not connecting IC's in the circuit while performing this test. 5. Microcontroller test:For testing the microcontroller, we wrote the square wave generation program for generating square wave on each port pin. Then we fed the program in microcontroller and checked the output with the help of CRO by connecting the microcontroller in the circuit. We took care of not connecting any other IC in the circuit. 92
  93. 93. PROblEmS FAcED 93
  94. 94. PROBLEMS FACED: Although the concept & design of the project seemed perfect, there were some problems faced while actual implementation: 1) Generation of exact 38 KHz Frequency from IC 555 at Transmitter circuit. Solution: Use variable resistor pot in astable multivibrator. Connect IC 555’s output pin to C.R.O. & measure frequency pulses generated by IC 555. By varying the resistor pot we can adjust the frequency of output. 2) Propagation Effects Solution: The working area for the project should be open and wide so that the signals can propagate smoothly with least interference. 94
  95. 95. advantages Advantages: 95
  96. 96. • • Low cost. Since there is no requirement for a GSM modem it does not involve any data transfer charges. • Finds applications in different areas like Tourism, Navigation etc. • It does not contain, or need, a qualified operator on board. • It can enter environments that are dangerous to human life. • Chances of collisions are minimized. 96
  97. 97. limitations Limitations: 97
  98. 98. 1) It is not powered by battery which can be discharged in short duration of operation. 2) Low speed. 3) Software flexibilities difficult to achieve. 4) Incapable of handling user’s command. Many new applications can be added to it in the future to make it more advance and accurate. 98
  99. 99. applications 99
  100. 100. Applications: • Latitude and longitude displayed can be used for location identification. • Vehicle travel record management. • Wild life researches. • In every field to monitoring easily. • Collision Avoidance logic has been specially designed for vaccum-cleaner. By using heavy rating motors , strong mechanical structure and using highly sensitive obstacle sensors, it efficiently work as vaccum-cleaner. 100
  101. 101. Future scope 101
  102. 102. Future Scope: 1. With the use of high end micro controllers and graphical LCD displays we can expect the data of the micro controller to be used dynamically during the journey itself to find our position instead of positioning in the Google earths map. 2. Camera can be added to aid the purpose of surveillance. 102
  103. 103. conclusion 103
  104. 104. CONCULSION: Thus vehicle position logging system using GPS is constructed. Firstly, integrating features of all the hardware components used. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using advanced components such as GPS and wireless network with the help of the growing technology, the project has been successfully implemented. In this project an effort has been made to study monitoring of the vehicle and to implement it. 104
  105. 105. reFerences 105
  106. 106. REFERENCES: 1. Global positioning systems inertial navigation, and integration Mohinders, Grewal, Lawrence, R Weil, Angus p Andrews 2. GPS for DUMMIES BY Joel Mc Namara 3. Torsten Baumbach's web site: 4. 8051 Microcontroller and Embedded Systems by M. A. Mazidi, Janice Gillispie Mazidi and Rolin D. McKinlay Web References: *64   dDocName=en01026     106
  107. 107. appendiX 107
  108. 108. 17.1 ESTIMATED COST S. No. 1 2 3 4 5 6 7 8 1 2 3 1 2 3 4 5 6 7 8 1 2 3 4 COMPONENTS Semiconductors IC-AT89C51 Microcontroller IC-HT12D Decoder IC-HT12E Encoder IC-MAX232 Driver/Receiver IC-7805, 5V Regulator NPN Transistor IC- L293D TSOP 1738 Resistors R1, R2- 4.7 kΩ R3- 1 kΩ VR1- 10 kΩ preset Miscellaneous XTAL- 12MHz Crystal S1- Push-to-On Switch TX1- 38 kHz IR Transmitter RX1- 38 kHz IR Receiver RF Module GPS Module LCD Display DC Motors Capacitors C1, C2- 3.3 nF Ceramic Disk C4-10μF, 16V Electrolytic C- 1μF, Electrolytic 0.01μF, Polyster TOTAL COST 108 COST (Rs.) 65 70 70 25 8 for each 2 for each 95 20 1 for each 1 for each 2 for each 10 15 6 for each 6 for each 140 2250 150 175 for each 1 for each 1 for each 2 for each 2 for each 3388
  109. 109. 17.2 DATA SHEETS 1. HT12D 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 only5% resistor • Valid transmission indicator • Easy interface with an RF or an infrared transmission medium • Minimal external components Applications • Burglar alarm system • Smoke and fire alarm system • Garage door controllers • Car door controllers • Car alarm system • Security system 109
  110. 110. • Cordless telephones • Other remote control systems General Description For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. 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. 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. SELECTION TABLE Address No. 8 Data VT No. Type 4 L √ Oscillator Trigger Package RC Oscillator DIN Active ″Hi″ 18DIP/20SOP Data type: L stands for latch type data output. VT can be used as a momentary data output. 110
  111. 111. 111
  112. 112. Note: The address/data pins are available in various combinations (see the address/data table). PIN DESCRIPTION Pin Name A0~A11 I/O D8 ~D11 DIN VT OSC1 OSC2 VSS VDD O I O I O I I I Internal connection NMOS TRANSMISSION GATE CMOS OUT CMOS IN CMOS OUT OSCILLATOR OSCILLATOR − − Description Input Pins for address A0 ~ A11 setting They can be externally set to VDD or VSS. Output Data Pins Serial Data Input Pin Valid Transmission ON, Active High Oscillator Input Pin Oscillator Output Pin Negative Power Supply Positive Power Supply ELECTRICAL CHARACTERISTICS Symbol Parameter VDD ISTB Operating Voltage Standby Current IDD Operating Current I0 Data Output Source Current (D8-D11) VT Output Source Current VT Output Sink Current ″H″ Input Voltage ″L″ Input Voltage Oscillator Frequency IVT V1H V1L fOSC Test Conditions VDD Conditions − − 5V Oscillator 12V stops 5V No Load F=150 kHz 5V VOH=4.5V 2.4 − − − 5 0.1 2 200 12 1 4 400 V µA µA µA -1 -1.6 − mA 5V 5V 5V 5V 5V -1 1 3.5 0 − -1.6 1.6 − − 150 − − mA mA V V kHz Functional Description Operation 112 VOH=4.5V VOL=4.5V − − ROSC=51kΩ Min Typ Max Unit 5 1 −
  113. 113. The series of 212 decoders provides various combinations of addresses and data pins in different packages so as to pair with the same series of encoders. The decoders receive data that are transmitted by an encoder and interpret the first N bits of code period as addresses and the last 12-N bits as data, where N is the address code number. A signal on the DIN pin activates the oscillator which in turn decodes the incoming address and data. The decoders will then check the received address three times continuously. If the received address codes all match the contents of the decoder’s local address, the 12-N bits o f data are decoded to activate the output pins and the VT pin is set high to indicate a valid transmission. This will last unless the address is incorrect or no signal is received. The output of the VT pin is high only when the transmission is valid. Otherwise it is always low. Output type Of the 212 series of decoders, the HT12F has no data output pin but its VT pin can be used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins whose data remain unchanged until new data are received. Part No. Data Pins Address Pins Output Type Operating Voltage HT12D 4 8 Latch 2.4V~12V HT12F 0 12 − 2.4V~12V Flowchart 113
  114. 114. The oscillator is disabled in the standby state and activated when a logic “high” signal applies to the DIN pin. That is to say, the D IN should be kept low if there is no signal input. 114
  115. 115. 115
  116. 116. 2. L293D Features • 600mA OUTPUT CURRENT CAPABILITY PER CHANNEL • 1.2A PEAK OUTPUT CURRENT (non repetitive) PER CHANNEL • OVERTEMPERATURE PROTECTION • ENABLE FACILITY • LOGICAL ”0” INPUT VOLTAGE UP TO 1.5 V (HIGH NOISE IMMUNITY) • INTERNAL CLAMP DIODES Description The Device is a monolithic integrated high voltage, high current four channel driver designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays solenoides, DC and stepping motors) and switching power transistors. To simplify use as two bridges each pair of channels is equipped with an enable input. A separate supply input is provided for the logic, allowing operation at a lower voltage and internal clamp diodes are included. This device is suitable for use in switching applications at frequencies up to 5 kHz. The L293D is assembled in a 16 lead plastic package which has 4 center pins connected together and used for heat sinking. 116
  117. 117. ABSOLUTE M AXIMUM RATINGS Symbol VS VSS Vi Ven I0 Ptot Tstg, Tj Parameter Supply Voltage Logic Supply Voltage Input Voltage Enable Voltage Peak Output Current (100 μs non repeatitive) Total Power Dissipation at T=90 oC Storage and Junction Temperature 117 Value 36 36 7 7 1.2 4 -40 to 150 Unit V V V V A W o C
  118. 118. ELECTRICAL CHARACTERISTICS: (for each channel, VS =24V, VSS =5V, T amb=25 oC, unless otherwise specified) Symbol Parameter VS Supply Voltage VSS Logic Supply Voltage IS Total Quiscent Supply Current (PIN 10) ISS VIL VIH IL IH Ven L Ven H Ien L Ien H VCE(Sat)H VCE(sat)L VF tr tf ton toff Total Quiscent Logic Supply Current (PIN 20) Input Low Voltage (PIN 2,9,12,19) Input High Voltage (PIN 2,9,12,19) Low Voltage Input Current (PIN 2,9,12,19) High Voltage Input Current (PIN 2,9,12,19) Enable Low Voltage (PIN 1,11) Enable High Voltage (PIN 1,11) Low Voltage Enable Current (PIN 1,11) High Voltage Enable Current (PIN 1,11) Source Output Saturation Voltage (PINS 3,8,13,18) Source Output Saturation Voltage (PINS 3,8,13,18) Clamp Diode Forward Voltage Rise-time Fall-time Turn-on Delay Turn-off Delay Test Conditions V1=L:I0=0:Ven=H V1=H:I0=0:Ven=H Ven=L V1=L:I0=0:Ven=H Min. Typ. Max. VSS 36 4.5 36 2 6 16 24 4 44 60 V1=H:I0=0:Ven=H Ven=L 16 16 Unit V V mA mA mA mA 22 24 1.5 mA mA V VSS 7 -10 V V μA 100 μA -0.3 1.5 V 2.3 2.3 VSS 7 -100 V V μA  10 μA -0.3 VSS≤7V VSS>7V V1L=1.5V 2.3 2.3 2.3V≤V1H≤VSS0.6V VSS≤7V VSS>7V VenL=1.5V 30 -30 2.3V≤VenH≤V0.6V I=-0.6A 1.4 1.8 V I=+0.6A 1.2 1.8 V I=600 μA 1.3 V 0.1 to 0.9V0 0.9 to 0.1V0 0.5V1 to 0.5V0 0.5V1 to 0.5V0 250 250 750 200 ns ns ns ns 118
  119. 119. 3. MAX232 The MAX232 from Maxim was the first IC which in one package contains the necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry. Circuitry designers no longer need to design and build a power supply with three voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a simple 78x05 voltage regulator. The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the MAX232A is much more often used (and easier to get) than the original MAX232, and the MAX232A only needs external capacitors 1/10th the capacity of what the original MAX232 needs. It should be noted that the MAX232(A) is just a driver/receiver. All it does is to convert signal voltage levels. Generating serial data with the right timing and decoding serial data has to be done by additional circuitry, e.g. by a 16550 UART or one of these small micro controllers (e.g. Atmel AVR, Microchip PIC) getting more and more popular. The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap. 119
  120. 120. MAX232 DIP Package PIN Layout Nbr Name 1 C1+ 2 V+ 3 C1- 4 C2+ 5 C2- 6. V- 7 8 9 10 11 12 13 14 15 T2out R2in R2out T2in T1in R1out R1in T1out GND 16 VCC Purpose Signal Voltage +Connector for Capacitor C1 Output of Voltage Pump Driver 2 Output Receiver 2 Input Receiver 2 Output Driver 2 Input Driver 1 Input Receiver 1 Output Receiver 1 Intput Driver 1 Output Ground Capacitor should stand atleast 16V +10V, Capacitor should stand atleast 16V Capacitor should stand atleast 16V Capacitor should stand atleast 16V Capacitor should stand atleast 16V -10V, Capacitor should stand atleast 16V RS-232 RS-232 TTL TTL TTL TTL RS-232 RS-232 0V Power Supply Capacitor Value MAX232 +5V -Connector for Capacitor C1 +Connector for Capacitor C2 -Connector for Capacitor C2 Output of Voltage Pump/Inverter 1μF 1 μF to Vcc 1 μF 1 μF 1 μF 1 μF to GND 1 μF to Vcc V+(2) is also connected to VCC via a capacitor (C3). V-(6) is connected to GND via a capacitor (C4). And GND(15) and VCC(16) are also connected by a capacitor (C5), as close as possible to the pins. 120
  121. 121. Application The MAX232(A) has two receivers (converts from RS-232 to TTL voltage levels) and two drivers (converts from TTL logic to RS-232 voltage levels). This means only two of the RS-232 signals can be converted in each direction. The old MC1488/1498 combo provided four drivers and receivers. Typically a pair of a driver/receiver of the MAX232 is used for  TX and RX and the second one for  CTS and RTS. There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR, and DCD signals. Usually these signals can be omitted when e.g. communicating with a PC's serial interface. If the DTE really requires these signals either a second MAX232 is needed, or some other IC from the MAX232 family can be used (if it can be found in consumer electronic shops at all). MAX232 DIP Package 121
  122. 122. 122