You are on page 1of 73

CHAPTER-1

INTRODUCTION

1.1 PROJECT OVERVIEW


This project aims to track the vehicle with the help of the GPS and GSM technology. GPS (Global Positioning System) module gives the location of the vehicle. Communication link is established through a GPS transceiver. GPS will give the information of latitude and longitude that can be sent towards the viewing system. With this system, we can easily identify vehicle thefts. GSM is used for receiving and sending messages according to the software program written to perform the task. Global system for mobile communication (GSM) is a globally accepted standard for digital cellular communication. The Global Positioning System (GPS) is a satellite-based navigation system that sends and receives radio signals. A GPS receiver acquires these signals and provides you with the information. Using GPS technology, you can determine location, velocity, and time, 24 hours a day, in any weather conditions anywhere in the worldfree.

Fig1: Vehicle Tracking System


2

1.2 BLOCK DIAGRAM DESCRIPTION

Fig 2: Block Diagram of Vehicle Tracking System

The Block diagram consists of a GPS modem, a GSM modem, a Micro controller with interfacing devices, a LCD Display and power supply. components used in our project. As soon as the engine starts, both the modems are ON. Then, GPS modem sends the vehicle location to the microcontroller. The signals in form of the latitudes and longitudes are obtained. To display the status of the GSM and GPS, a LCD display is used at the output section. Simultaneously, the GSM modem sends this information to the user mobile. In GSM modem initially, we have to insert the SIM card, then this number sends all messages. The microcontroller controls the entire process. The maximum power supply required to operate the hardware circuitry is +5V DC voltage. These are the main hardware

1.3 PICTORIAL REPRESENTATION

Fig3: Pictorial Representation

CHAPTER-2

SYSTEM OVERVIEW

2.1 DEVELOPMENT STAGES AND PROCESS


The complete development of this system can be divided into the following stages Problem Definition Stage Designing block diagram Implementing circuits and components Developing flowchart for software Writing actual code for Microcontroller Compiling the code Burning the hex file into Microcontroller with programmer Testing Running Documentation

2.1.1 Problem Definition Stage This is the very first stage to develop any project. It actually defines the concept of the project. In this section, the purpose i.e. why this particular project is required is explained. 2.1.2 Designing block diagram At this stage, we have categorized the whole system with different individual modules. These modules will be helpful in understanding the concept and working of the integrated system. 2.1.3 Implementing circuits and components This is the actual implementation of circuit of each block. At this stage, we have actually designed each block separately and finally integrated them into the complete working system. 2.1.4 Developing flowchart for software To get the logical flow of the software, the development of flowchart is having a prominent role. Therefore, we have to analyze the complete system and organize the flowchart in such a manner that one can understand the complete working of the software.

2.1.5 Writing actual code for Microcontroller After the development of the algorithm and flowchart, we have actually translated them in C language for AT89S52 Microcontroller so that it can understand the instructions and run as per our requirement. The instructions are in ANSII C language. 2.1.6 Compiling the code The hand written code on the paper was then transferred into the computer. For that, we have used Keil pre-install on PC. We simulated and compiled our program for error checking. After removing several compiling errors the program was converted into machine language i.e. Intel hex format. 2.1.7 Burning the hex file into Microcontroller with programmer In this stage, the compiled hex format file was downloaded or burned into AT89S52 Microcontroller. This was done by using in-system programming software provided by the manufacturer itself. 2.1.8 Testing This time we tested our project for actual working, after loading the software into the microcontroller. Any errors found were removed successfully. 2.1.9 Running This is the last and final stage of development of our project. In this stage, a user flowchart was made so that anyone can use this system without any difficulty.

CHAPTER-3

POWER SUPPLY

The project modules work mainly on 5V DC power supply. The following block diagram shows AC to DC conversion:

Fig4: Block diagram of AC to DC conversion

Following is the description of all the components used: A) TRANSFORMER: A transformer is a static electrical device that transfers energy by inductive

coupling between its winding circuits. A varying current in the primary winding creates a varying magnetic flux in the transformer's core and thus a varying magnetic flux through the secondary winding. This varying magnetic flux induces a varying electromotive force (emf) or voltage in the secondary winding.

The ideal transformer induces secondary voltage ES =VS as a proportion of the primary voltage VP = EP and respective winding turns as given by the equation

where
9

VP/VS = EP/ES = a is the voltage ratio and NP/NS = a is the winding turns ratio, the value of these ratios being respectively higher and lower than unity for step-down and step-up transformers B) BRIDGE RECTIFIER: A diode bridge is an arrangement of four diodes in bridge circuit configuration that provides the same polarity of output for either polarity of input. When used in its most common application, for conversion of an alternating current (AC) input into a direct current (DC) output, it is known as a bridge rectifier. A bridge rectifier provides full-wave rectification from a two-wire AC input, resulting in lower cost and weight as compared to a rectifier with a 3-wire input from a transformer with a center-tapped secondary winding. The essential feature of a diode bridge is that the polarity of the output is the same regardless of the polarity at the input.

Fig5: Bridge rectifier B) FILTER:

The raw DC supplied by a rectifier on its own would consist of a series of half sine waves with the voltage varying between zero and 2 times the RMS voltage .A supply of this nature would not be of any use for powering circuits. To smooth the output of the rectifier a reservoir capacitor is used - placed across the output of the rectifier and in parallel with the load.

10

Fig6: Reduction of ripple voltage by filter

C) VOLTAGE REGULATOR: A voltage regulator is designed to automatically maintain a constant voltage level. A voltage regulator may be a simple "feed forward" design or may include negative feedback control loops. A most common voltage regulator is IC 7805. It provides +5V regulated power supply

Fig7: IC 7805 Pin No 1 2 3 Input voltage (5V-18V) Ground (0V) Regulated output; 5V (4.8V-5.2V) Input Ground Output Function Name

Fig8.: PIN DESCRIPTION Of 7805


11

CHAPTER-4

MICROCONTROLLER

12

4.1 INTRODUCTION TO AT89S52 MICROCONTROLLER

The AT89S52 is a low power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels highdensity non-volatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out.

The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with insystem programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller, which provides a highly flexible and cost-effective solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a sixvector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.

The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

13

4.2 PIN DIAGRAM

Fig 9: Pin diagram of AT89S52

14

4.3 PIN DESCRIPTION


VCC: Supply voltage +5V regulated power supply for the proper working of the IC.

GND: Reference Ground potential.

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 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.

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 memories that use 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external

15

data memory that use 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: Port 3 also receives some control signals for Flash programming and verification.

Table1: Pin Description of AT89S52

Pin No 1 2 3 4

Function

Name

P1.0 P1.1 P1.2 P1.3 8 bit input/output port (P1) pins P1.4 P1.5 P1.6 P1.7 Reset pin; Active high Reset

5 6 7 8 9

16

10

Input

(receiver)

for

serial

communication Output (transmitter) for serial

RxD

P3.0

11

communication External interrupt 1 External interrupt 2 Timer1 external input Timer2 external input Write to external data memory Read from external data memory

TxD

P3.1

12 13 14 15 16 17 18

Int0 Int1 T0 T1 Write Read

8 input/output

bit

P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 Crystal 2

port (P3) pins

Quartz crystal oscillator (up to 24 MHz) 19 20 21 22 23 24 25 26 27 28 29 Program store enable; Read from external program memory 8 bit input/output port (P2) pins / High-order address bits when interfacing with external memory Ground (0V) Crystal 1 Ground P2.0/ A8 P2.1/ A9 P2.2/ A10 P2.3/ A11 P2.4/ A12 P2.5/ A13 P2.6/ A14 P2.7/ A15 PSEN

17

Address Latch Enable 30 Program pulse input during Flash programming External Access Enable; Vcc for internal program executions 31 Programming enable voltage; 12V (during Flash programming) 32 33 34 35 36 37 38 39 40 Supply voltage; 5V (up to 6.6V) Low-order address bits when interfacing with external memory 8 bit input/output port (P0) pins

ALE Prog EA Vpp P0.7/ AD7 P0.6/ AD6 P0.5/ AD5 P0.4/ AD4 P0.3/ AD3 P0.2/ AD2 P0.1/ AD1 P0.0/ AD0 Vcc

18

4.4 FEATURES
Compatible with MCS-51 Products 8K Bytes of In-System Reprogrammable Flash Memory Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Programmable Serial Channel Low-power Idle and Power-down Modes 4.0V to 5.5V Operating Range Full Duplex UART Serial Channel Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag Fast Programming Time Flexible ISP Programming (Byte and Page Mode)

19

CHAPTER-5

GSM MODULE

20

5.1 SIM300 OVERVIEW


Designed for global market, SIM300 is a Tri-band GSM/GPRS engine that works on frequencies EGSM 900 MHz, DCS 1800 MHz and PCS 1900 MHz SIM300 features GPRS multi-slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 40mm x 33mm x 2.85mm, SIM300 can fit almost all the space. The physical interface to the mobile application is made through a 60-pin board-to-board connector, which provides all hardware interfaces between the module and customers boards except the RF antenna interface.

Fig10: SIM300 GSM module

The SIM300 provides RF antenna interface with two alternatives: antenna connector and antenna pad. The antenna connector is MURATA MM9329-2700 and customers antenna can be soldered to the antenna pad. The SIM300 is designed with power saving technique; the current consumption is as low as 2.5mA in SLEEP mode. The SIM300 is integrated with the TCP/IP protocol; extended TCP/IP AT commands are developed for customers to use the TCP/IP protocol easily, which is very useful for those data transfer applications.

21

22

23

CHAPTER-6

GPS MODULE

24

6.1 INTRODUCTION LS20030 is a complete GPS smart antenna receiver, including an embedded antenna and GPS receiver circuits, designed for a broad spectrum of OEM system applications. The product is based on the proven technology found in LOCOSYS 32 channel GPS SMD type receivers MC-1513 that use MediaTek chip solution. The GPS smart antenna will track up to 32 satellites at a time while providing fast time-to-first-fix, one-second navigation update and low power consumption.

Fig11:GPS Module It can provide you with superior sensitivity and performance even in urban canyon and dense foliage environment. Its far-reaching capability meets the sensitivity requirements of car navigation as well as other location-based applications. 6.2 FEATURES MediaTek MT3318 solution Support 32-channel GPS Fast TTFF at low signal level Up to 5 Hz update rate Capable of SBAS (WAAS, EGNOS, MSAS) Build-in micro battery to reserve system data for rapid satellite (not in LS20033) LED indicator for GPS fix or not fix (not in LS20033)
25

acquisition

6.3 APPLICATION o Personal positioning and navigation o Automotive navigation o Marine navigation

6.4 BLOCK DIAGRAM OF LS20030

Fig12:LS20030 Block Diagram

26

CHAPTER-7

RS232

27

7.1 INTRODUCTION RS232 is the most known serial port used in transmitting the data in communication and interface. Even though serial port is harder to program than the parallel port, this is the most effective method in which the data transmission requires less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission by only using three wire links. The three links provides transmit, receive and common ground.

7.2 SERIAL COMMUNICATION VIA RS232 PORT The transmit and receive line on this connecter send and receive data between the computers. As the name indicates, the data is transmitted serially. The two pins are TXD & RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI. The 1 and 0 are the data which defines a voltage level of 3V to 25V and -3V to -25V respectively. The electrical characteristics of the serial port as per the EIA (Electronics Industry Association) RS232C Standard specifies a maximum baud rate of 20,000bps, which is slow compared to todays standard speed. For this reason, we have chosen the new RS -232D Standard, which was recently released.

The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and D-TYPE 9 pin connector, which are male connectors on the back of the PC. You need a female connector on your communication from Host to Guest computer. The pin outs of both D-9 & D-25 are show below.

Fig13 Connections of the Null modem using RS-232D connecter

28

7.3 RS-232 LEVEL CONVERTERS Almost all digital devices which we use require either TTL or CMOS logic levels. Therefore the first step to connecting a device to the RS-232 port is to transform the RS-232 levels back into 0 and 5 Volts. Two common RS-232 Level Converters are the 1488 RS-232 Driver and the 1489 RS-232 Receiver. Each package contains 4 inverters of the one type, either Drivers or Receivers. The driver requires two supply rails, +7.5 to +15v and -7.5 to -15v.

TTL RS232 Line Type & Logic Level RS232 Voltage to/from

Voltage

MAX232

Data Transmission (Rx/Tx) Logic 0 +3 V to +15 V

0V

Data Transmission (Rx/Tx) Logic 1 -3 V to -15 V

5V

Control

Signals

(RTS/CTS/DTR/DSR) Logic 0

-3 V to -15 V

5V

Control

Signals

(RTS/CTS/DTR/DSR) Logic 1

+3 V to +15 V

0V

Table2:RS232 Voltage Levels 7.4 MAX232 The MAX232 is an integrated circuit, that converts signals from an RS 232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.

29

Fig14: Typical MAX-232 Circuit.

When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state.

MAX232(A) DIP Package Pin Layout Capacitor MAX232 Value

Nbr Name Purpose

Signal Voltage

C1+

connector

for capacitor should stand at least 16V +10V, capacitor should stand at least 16V

capacitor C1

1F

V+

output of voltage pump

1F to VCC

C1-

connector

for capacitor should stand at least 16V

capacitor C1

1F

30

C2+

connector

for capacitor should stand at least 16V for capacitor should stand at least 16V

capacitor C2 connector

1F

C2-

capacitor C2

1F

V-

output of voltage pump -10V, capacitor should stand / inverter at least 16V RS-232 RS-232 TTL TTL TTL TTL RS-232 RS-232 0V +5V Table3:MAX232 PIN Layout

1F to GND

7 8 9 10 11 12 13 14 15 16

T2out Driver 2 output R2in Receiver 2 input

R2out Receiver 2 output T2in T1in Driver 2 input Driver 1 input

R1out Receiver 1 output R1in Receiver 1 input

T1out Driver 1 output GND VCC Ground Power supply

1F to VCC see above

31

CHAPTER 8

LCD MODULE

32

8.1 OVERVIEW LCD modules are available in a wide range like 8x1, 8x2, 16x1, 16x2, 20x2, 20x4, and 40x4. Here we have used 16x2- that means two rows of 16 characters. It is a Hitachi HD44780 compatible module, having 16 pins including two pins for backlight. Following table gives pin structure of LCD module. LCD modules without backlight will have only 14 pins. If you are using such LCDs, simply ignore 15th and 16th pins.

8.2 PIN DESCRIPTION

Table4:PIN Functions of LCD Module To program the LCD module, first we have to initialize the LCD by sending some control words. RS should be low and E should be high when we send control. R/W pin 0 mean write data or control to LCD and R/W pin 1 means read data from the LCD. To send a data to
33

LCD, make RS high, R/W low, place the data in pins 7 to 14 and make pin E high and low once.

Fig15:LCD Display

34

CHAPTER 9

SOFTWARE USED

35

9.1 INTRODUCTION TO KEIL SOFTWARE Keil MicroVision is an integrated development environment used to create software to be run on embedded systems (like a microcontroller). It allows for such software to be written either in assembly or C programming languages and for that software to be simulated on a computer before being loaded onto the microcontroller. 9.2 VISION3 Vision3 is an IDE (Integrated Development Environment) that helps write, compile, and debug embedded programs. It encapsulates the following components: A project manager. A make facility. Tool configuration. Editor. A powerful debugger.

9.3 STEPS FOLLOWED IN CREATING AN APPLICATION IN Vision3 To create a new project in uVision3: 1. Select Project - New Project. 2. Select a directory and enter the name of the project file. 3. Select Project Select Device and select a device from Device 4. Create source files to add to the project 5. Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and add the source files to the project. 6. Select Project - Options and set the tool options. Note that when the target device is selected from the Device Database all-special options are set automatically. Default memory model settings are optimal for most applications. Database.

36

7. Select Project - Rebuild all target files or Build target To create a new project, simply start MicroVision and select

Project=>New Project from the pulldown menus. In the file dialog that appears, choose a name and base directory for the project. It is recommended that a new directory be created for each project, as several files will be generated. Once the project has been named, the dialog shown in the figure below will appear, prompting the user to select a target device. In this lab, the chip being used is the AT89S52, which is listed under the heading Atmel.

Fig16.: Window for choosing the target device Next, MicroVision must be instructed to generate a HEX file upon program compilation. A HEX file is a standard file format for storing executable code that is to be loaded onto the microcontroller. In the Project Workspace pane at the left, rightclick on Target 1 and select Options for Target 1 .Under the Output tab of the resulting options dialog, ensure that both the Create Executable and Create HEX File options are checked. Then click OK. Next, a file must be added to the project that will contain the project code. To do this,
37

expand the Target 1 heading, rightclick on the Source Group 1 folder, and select Add files Create a new blank file (the file name should end in .asm), select it, and click Add. The new file should now appear in the Project Workspace pane under the Source Group 1 folder. Double-click on the newly created file to open it in the editor. All code for this lab will go in this file. To compile the program, first save all source files by clicking on the Save All button, and then click on the Rebuild all Target Files to compile the program as shown in the figure below. If any errors or warnings occur during compilation, they will be displayed in the output window at the bottom of the screen. All errors and warnings will reference the line and column number in which they occur along with a description of the problem so that they can be easily located. Note that only errors indicate that the compilation failed, warnings do not (though it is generally a good idea to look into them anyway).

Fig.17 Save All and Build All Target Files Buttons When the program has been successfully compiled, it can be simulated using the integrated debugger in Keil MicroVision. To start the debugger, select Debug=>Start/Stop Debug Session from the pulldown menus. At the left side of the debugger window, a table is displayed containing several key parameters about the simulated microcontroller, most notably the elapsed time (circled in the figure below). Just above that, there are several buttons that control code execution. The Run button will cause the program to run continuously until a breakpoint is reached, whereas the Step Into button will execute the next line of code and then pause (the current position in the program is indicated by a yellow arrow to the left of the code).

38

Breakpoints can be set by doubleclicking on the grey bar on the left edge of the window containing the program code. A breakpoint is indicated by a red box next to the line of code.

39

Fig.18: Reset, Run and Step into options

The current state of the pins on each I/O port on the simulated microcontroller can also be displayed. To view the state of a port, select Peripherals=>I/O Ports=>Port n from the pulldown menus, where n is the port number. A checked box in the port window indicates a high (1) pin, and an empty box indicates a low (0) pin. Both the I/O port data and the data at the left side of the screen are updated whenever the program is paused. The debugger will help eliminate many programming errors, however the simulation is not perfect and code that executes properly in simulation may not always work on the actual microcontroller.

9.4 DEVICE DATABASE A unique feature of the Keil Vision3 IDE is the Device Database, which contains information abo ut more than 400 supported microcontrollers. When you create a new Vision3 project and select the target chip from the database, Vision3 sets all assembler,
40

compiler, linker, and debugger options for you. The only option you must configure is the memory map.

9.5 PERIPHERAL SIMULATION The Vision3 Debugger provides complete simulation for the CPU and on-chip peripherals of most embedded devices. To discover which peripherals of a device are supported, in Vision3 select the Simulated Peripherals item from the Help menu. You may also use the web-based Device Database. We are constantly adding new devices and simulation support for on-chip peripherals so be sure to check Device Database often.

9.6 PROGRAMMER The programmer used is a powerful programmer for the Atmel 89 series of microcontrollers that includes 89C51/52/55, 89S51/52/55 and many more. It is simple to use & low cost, yet powerful flash microcontroller programmer for the Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank Check. All fuse and lock bits are programmable. This programmer has intelligent onboard firmware and connects to the serial port. It can be used with any type of computer and requires no special hardware. All that is needed is a serial communication port which all computers have. All devices also have a number of lock bits to provide various levels of software and programming protection. These lock bits are fully programmable using this

programmer. Lock bits are useful to protect the program to be read back from microcontroller only allowing erase to reprogram the microcontroller. Major parts of this programmer are Serial Port, Power Supply and Firmware microcontroller. Serial data is sent and received from 9 pin connector and converted to/from All the programming intelligence is built into the programmer so you do n o t need any special hardware to run it. Programmer comes with window based software for easy programming of the devices.
41

9.7 PROLOAD PROGRAMMING SOFTWARE ProLoad is a software working as a user-friendly interface for programmer boards from Sunrom Technologies. Proload gets its name from Program Loader term, because that is what it is supposed to do. It takes in compiled HEX file and loads it to the hardware. Any compiler can be used with it, Assembly or C, as all of them generate compiled HEX files. ProLoad accepts the Intel HEX format file generated from compiler to be sent to target microcontroller. It auto detects the hardware connected to the serial port. It also auto detects the chip inserted and bytes used. The software is developed in Delphi and requires no overhead of any external DLL.

42

CHAPTER 10

WORKING

43

10.1 CIRCUIT DESCRIPTION In this project, the GSM and GPS are connected to the micro controller through RS232. The GSM is used for sending, receiving and reading the messages. The GPS is used for getting the location of the vehicle from the satellites which sends the location name in the form of coordinates i.e., latitudes, longitudes and altitudes. GPS uses four satellites at a time to track the location of the vehicle. These GSM and GPS modules are both meant for serial communication. Both the GSM and GPS are RS voltage level compatible but the Micro controller is TTL compatible. To match the voltage levels we are using the MAX-232 line driver to convert the RS voltage level to TTL voltage levels and vice versa. The controller is having one serial port. compatibility. The LCD display will act as an output source in this project that will be helpful to display the latitude and longitude of the vehicle . The LCD display, requires maximum of +5V DC power supply. Power supply is regulated by using IC 7805 which is a voltage regulator IC, thus providing constant 5V DC power supply. A MAX232 IC which is a transceiver,is used for voltage

44

10.2 CIRCUIT DIAGRAM

Fig.19Circuit Diagram Of Vehicle Tracking System 10.3 SCHEMATIC DESCRIPTION The project consists of six sections: i. ii. iii. Power Supply Microcontroller LCD module
45

iv. v. vi.

MAX232 GSM module GPS module

10.3.1 POWER SUPPLY The project works on 5V DC power supply. The components used are: 240/12V step down transformer, IN4007 diodes, 7805 voltage regulator, and 1000F electrolytic capacitors.

Fig.20:5V DC power supply The 12V AC to DC conversion is done by bridge rectifier and passed through filter to remove ripples. Finally, voltage regulator gives regulated 5V dc output. The role of the output capacitor is to remove fluctuations in the output voltage due to load.

10.3.2MICROCONTROLLER The main function of AT89S52 microcontroller is to interface with other three modules. The microcontroller receives data from GPS module, displays it on LCD and simultaneously sends an SMS to the owner of the current location of the vehicle using GSM module. AT89S52 is a 40-pin microcontroller. Out of four ports, Port 1is connected to LCD for display. Function of ports is to output the data stored in microcontroller to the device connected to it.
46

Fig21:PIN Diagram of AT89S52 In microcontroller, Pin No.10 and Pin No.11 are pins for serial communication. Pin No. 10(RxD) is for serial reception and Pin No.11 (TxD) is for serial transmission. Thus, GPS sends latitude and longitudinal information to microcontroller via RxD pin. Now this data is send to LCD for display by Port 1 and to GSM for SMS.GSM cannot receive data directly from microcontroller since both devices are not voltage compatible. Thus, microcontroller sends data via TxD pin to Pin 11 of MAX232, which then transmits it to GSM module.

47

10.3.3 LCD MODULE LCD modules main function is to display the latitude and longitude of the vehicle. In our project we are using 162 LCD is used. Function and description of pins are shown below:

Table5:PIN Assignment of LCD LCD pins from 7to14 connects to port 1 of microcontroller to receive data bits. Pin 1and pins 2 are ground and supply voltage respectively. For LCD contrast 22k resistor connects in between pin1 and pin3.Pin 15 and 16 are for backlights and hence connects to Vcc. The RS, R/W. and EN pins are the control pins which are used for controlling purpose. The RS pin is used to select either data mode or command mode. The R/W is used to indicate that the LCD will acts as an either read or write mode. The EN pin is used to enable the data. The connection of LCD with microcontroller is shown below:

48

Fig22: LCD and microcontroller interfacing

10.3.4MAX232: The MAX232 is an integrated circuit, that converts signals from an RS 232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.

49

MAX232(A) external Capacitors Capacitor C1 C2 C3 C4 C5 + Pin 1 4 2 GND 16 - Pin 3 5 16 6 GND

Table6:MAX232 External Capacitors The following figure shows the connection of MAX232 with RS232:

Fig23:MAX232 Connection with RS232 Thus MAX232 receives signal from microcontroller at TTL level which is send to GSM modem via RS232 connector.
50

CHAPTER 11

PROGRAMMING

51

#include <AT89X51.H>

/* special function register declarations */ */

/* for the intended 8051 derivative #include <stdio.h>

/* prototype declarations for I/O functions */ /* standard I/O .h-file */ */

#include <ctype.h> #include <lcd.h> void convertanddisplay(void); void data_send (void); void data_send1 (void); void delay (void); unsigned char ln; unsigned int x=0; unsigned char temp; unsigned char *text; unsigned int speed; void tx_buf(unsigned char); void rx_buf(void ); void delay_m (unsigned char ); static unsigned char send_v; #define my_adc_data P2 sbit sbit lcd_rs=P3^7; lcd_e=P3^6;

/* character functions

52

#define lcd_data P1 //static unsigned char temp,key_value; static unsigned char averge[3],v_temp100,v_temp10,v_temp1; unsigned char lcd_buffer; static unsigned int value,count,count1,day; unsigned char lcd_add,base_data,key_value; static unsigned char n1,n2,n3,n4,n5; static unsigned char e1,e2,e3,e4,e5; unsigned char *text; static unsigned char total; code unsigned char msg_M1[]="GSM GPS Tracker code unsigned char msg_M2[]="..........2013 ";//16 ";//16 ";//16 "; //16

code unsigned char msg_gsm[]="GSM ON.......... code unsigned char msg_gps[]="GPS ON.......... code unsigned char msg_blank[]="

";//11 ";//11

code unsigned char msg_dis[]="Lat N---Log E--void MAIN(void) { unsigned char x; delay(); lcd_int(); for (x=0;x<5;x++) {
53

minu(); delay_m(200); delay_m(200); lcd_instruction(0x01); delay_m(200); }

SCON = 0x50; TMOD = 0x21; TH1 = 0xfd; TR1 = 1; TI = 1; count=0; text=msg_M1; ln=16; lcd_line1(lcd_buffer); delay(); text=msg_gsm; ln=16; lcd_line2(lcd_buffer); delay(); data_send (); rx_buf();

/* SCON: mode 1, 8-bit UART, enable rcvr /* TMOD: timer 1, mode 2, 8-bit reload /* TH1: reload value for 9600 */ /* TR1: timer 1 run */ */ */

*/

/* TI: set TI to send first char of UART

54

text=msg_gps; ln=16;

lcd_line2(lcd_buffer); delay(); delay_m(200); text=msg_gps; ln=16; lcd_line2(lcd_buffer); delay(); delay_m(200); text=msg_dis; ln=16; lcd_line2(lcd_buffer); delay(); while(1) { count1++; count++; rx_buf(); if (count>=100) { data_send1 ();
55

count=0; } } } void delay (void) { unsigned int x,y; for (x=0;x<100;x++) for (y=0;y<255;y++); } void msdelay (unsigned int value) { unsigned char x,y; for (x=0;x<value;x++) for(y=0;y<1;y++); } void minu(void) { text=msg_M1; ln=16; lcd_line1(lcd_buffer); delay(); text=msg_M2;
56

ln=16; lcd_line2(lcd_buffer); delay();

} /*averge[0]=value_avrge/0x10000; averge[1]=value_avrge/0x100; averge[2]=value_avrge/0x1;*/

void convertanddisplay(void) { lcd_buffer=0xc0; lcd_instruction(lcd_buffer); LCDwrite('N'); LCDwrite(':'); LCDwrite(n1); LCDwrite(n2); LCDwrite(n3); LCDwrite(n4); LCDwrite(n5); LCDwrite(' '); LCDwrite('E');
57

LCDwrite(':'); LCDwrite(e1); LCDwrite(e2); LCDwrite(e3); LCDwrite(e4); LCDwrite(e5) } void delay_m (unsigned char value ) { unsigned int x,y; for (x=0;x<800;x++) for (y=0;y<value;y++); } void tx_buf(unsigned char temp) { unsigned char i = 0; //lcd_rs=1; i = temp; SBUF=i; while(TI==0); TI=0; } void rx_buf(void )
58

//1275

{ unsigned char i ; while(RI==0); i=SBUF; base_data=i; RI=0; key_value=1; } void data_send1 (void) { delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T'); tx_buf(0x0d); delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T');
59

tx_buf(0x0d); delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T'); tx_buf('+'); tx_buf('C'); tx_buf('M'); tx_buf('G'); tx_buf('F'); tx_buf('='); tx_buf('1'); tx_buf(0x0d); delay(); delay(); delay(); delay(); delay(); delay(); delay(); delay();
60

tx_buf('A'); tx_buf('T'); tx_buf('+'); tx_buf('C'); tx_buf('M'); tx_buf('G'); tx_buf('S'); tx_buf('='); tx_buf('0'); tx_buf('7'); tx_buf('8'); tx_buf('3'); tx_buf('8'); tx_buf('6'); tx_buf('8'); tx_buf('5'); tx_buf('5'); tx_buf('0'); tx_buf('1'); tx_buf(0x0d); delay(); delay(); delay();
61

delay(); tx_buf('V'); tx_buf('e'); tx_buf('h'); tx_buf('i'); tx_buf('c'); tx_buf('l'); tx_buf('e'); tx_buf(' '); tx_buf(' '); tx_buf(' '); tx_buf('E'); tx_buf(':'); tx_buf('-'); tx_buf(e1); tx_buf(e2); tx_buf(e3); tx_buf(e4); tx_buf(e5); tx_buf('N'); tx_buf(':'); tx_buf('-'); tx_buf(n1);
62

tx_buf(n2); tx_buf(n3); tx_buf(n4); tx_buf(n5); tx_buf(' '); tx_buf(' '); tx_buf(' '); tx_buf('E'); tx_buf(':'); tx_buf('-'); tx_buf(e1); tx_buf(e2); tx_buf(e3); tx_buf(e4); tx_buf(e5); } void data_send (void) { delay(); delay(); delay(); delay(); tx_buf('A');
63

tx_buf('T'); tx_buf(0x0d); delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T'); tx_buf(0x0d); delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T'); tx_buf('+'); tx_buf('C'); tx_buf('M'); tx_buf('G'); tx_buf('F'); tx_buf('='); tx_buf('1'); tx_buf(0x0d);
64

delay(); delay(); delay(); delay(); delay(); delay(); delay(); delay(); tx_buf('A'); tx_buf('T'); tx_buf('+'); tx_buf('C'); tx_buf('M'); tx_buf('G'); tx_buf('S'); tx_buf('='); tx_buf('0'); tx_buf('7'); tx_buf('8'); tx_buf('3'); tx_buf('8'); tx_buf('6'); tx_buf('8');
65

tx_buf('5'); tx_buf('5'); tx_buf('0'); tx_buf('1'); tx_buf(0x0d); delay(); delay(); delay(); delay(); tx_buf('V'); tx_buf('e'); tx_buf('h'); tx_buf('i'); tx_buf('c'); tx_buf('l'); tx_buf('e'); tx_buf(' '); tx_buf(' '); tx_buf('S'); tx_buf('t'); tx_buf('a'); tx_buf('r'); tx_buf('t');
66

CHAPTER 12

APPLICATIONS

67

Resource Tracking + job dispatch

Fleet management

68

Child and animal tracking

Car Tracking and management system

69

OTHER APPLICATIONS: Ambulance Tracking Monitoring driving behavior Asset tracking Trailer tracking Field service management Stolen vehicle recovery

70

CHAPTER 13

FURTHER IMPROVEMENTS & FUTURE SCOPE

71

In this project, we may take action after the vehicle is stolen like engine halt or simply tracking. We may provide some of the authentication before operating the vehicle too so that we can prevent the vehicle thefting at the starting itself. The authentication may be either the RFID or smart card or a finger print module. By adding the authentication to this project, more security would add to this project. This technology in conjunction with mechatronics can be implemented in real time vehicle tracking and controlling system. Also with the help of Free Google map and the use of HTTP protocol, location can be specified accurately and over a broader range. This setup can be made more interactive by adding a display to show some basic information about the vehicle and also add emergency numbers which can be used in case of emergency. Upgrading this setup is very easy which makes it open to future requirements without the need of rebuilding everything from scratch.

72

REFERENCES Muhammad Ali Mazidi,Janice Gillispie Mazidi The 8051 Micro controller and Embedded Systems 3rd edition Kenneth J.Ayala The 8051 Micro controller Architecture, Programming & Applications -2nd edition B.Ram Fundamentals of Micro processors and Micro computers -3rd edition Ramesh S.Gaonkar Micro processor Architecture, Programming & Applications2nd edition D.V.Prasad Electronic Components -3rd edition Theodore S. Rappaport Wireless Communications- 2nd edition William C.Y. Lee Mobile Tele Communications- 3rd edition www.8051projects.info www.instructables.com www.alldatasheet.com www.datasheet4u.com www.datasheetcatalog.com www.national.com www.atmel.com www.microsoftsearch.com www.geocities.com www.tycho.usno.navy.mil/gpscurr.html

73

You might also like