chapters-project report final

Upload: garima-bokdia

Post on 03-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Chapters-Project Report Final

    1/58

    Page 1 of59

    Vehicle Tracking System

    A

    Project Report

    On

    Vehicle Tracking System Using GPS and GSM

    Submitted for the partial fulfillment for the degree of

    Bachelor of Engineering

    In Information Technology

    Submitted By Guide:

    Harsh Vardhan Pundhir Sh(Dr.) Alok Singh Gehlot

    (IT,09/5228) Assistant Professor

    Kapil Bhadada

    (IT,09/8679)

    Department of Computer Science and EngineeringMBM Engineering College, Faculty of Engineering,

    Jai Narain Vyas University,

    Jodhpur (Rajasthan)

    2012-13

  • 7/28/2019 Chapters-Project Report Final

    2/58

    Page 2 of59

    Vehicle Tracking System

    CERTIFICATE

    This is to certify that report entitled Vehicle Tracking System using GPS and GSM

    modem submitted to Department of Computer Science and Engineering, MBM

    Engineering College, JNV University in partial fulfillment of the requirements for the

    award of the degree of BE. in Information Technology is the bonafide record of the

    work done by group members Harsh Vardhan Pundhir(IT), Kapil Bhadada(IT) under

    my supervision and guidance.

    Sh. Alok Singh Gehlot(Assistant Professor)

  • 7/28/2019 Chapters-Project Report Final

    3/58

    Page 3 of59

    Vehicle Tracking System

    DECLARATION

    Where by declare that this project titled Vehicle tracking System using GPS and

    GSM modem is a record of original work done by me under the supervision and

    guidance of Sh. Alok Singh Gehlot . We further certify that this

    Degree/Diploma/Associate ship/Fellowship or similar work has not formed the basis

    for the award of the Degree work to any candidate of any university and no part of

    this report is reproduced as it is from any other source without seeking permission.

    Harsh Vardhan Pundhir(IT,09/5228)

    Kapil Bhadada(IT,09/8679)

  • 7/28/2019 Chapters-Project Report Final

    4/58

    Page 4 of59

    Vehicle Tracking System

    ACKNOWLEDGEMENT

    Acknowledgement is not mere formality as its the usual notion. It is the only way

    through which we can connote our deep and profound gratitude to the persons whodirectly or indirectly contributed to the work.

    First and foremost, I wish to acknowledge the encouragement received from

    Dr.K.R.Chowdhary (HOD, Computer Science & Engineering Department, MBM

    Engineering College, Jodhpur) for initiating my interest in project for practical

    knowledge.

    I earnestly acknowledge my profound sense of gratitude to Sh. Alok Singh Gehlot

    (Assistant Professor).Under whose supervision I have been able to complete the

    project. His mastery and work helped me in covering out this work smoothly. I am

    also grateful to staff of department who have helped me to improve practical

    knowledge, kind support and information.

    Finally, I wish to add that I am incepted to God & my Parents, family for everything

    good that has happened to me.

    Harsh Vardhan Pundhir(IT,09/5228)

    Kapil Bhadada(IT,09/8679)

  • 7/28/2019 Chapters-Project Report Final

    5/58

    Introduction OfVehicle Tracking System

    Page 5 of59

    Vehicle Tracking System

    Chapter-1

    Introduction of Vehicle Tracking System

    1.1 ABSTRACT

    Vehicle Tracking System is a method used to track the location of the any

    vehicle around the globe. This Project is proposed to design an embedded systemwhich is used for tracking and positioning of any vehicle and implemented using

    Global Positioning System (GPS) and Global system for mobile communication(GSM).Vehicle Tracking System has become a necessity for business owners aroundthe globe trying to manage a fleet. This is used to locate the cars, motor bikes or anyvehicles. The focus of a GPS based vehicle Tracking System is to make use of theknowledge of vehicles location and apply its network attributes such as the stops,timing, available alternative emergency routes and other such constraints in order to

    optimize opportunities for productivity and cost reduction.It comprises of integration between GPS receiver, microcontroller and GSM module.This vehicle tracking system is integration of two systems which is coordinated byGPS receiver controller and controlled by users using command interfaces through

    GSM module as a transmitter and receiver of data. This project can be divided intotwo main parts which are hardware and software development. The hardwaredevelopment include the GPS and the microcontroller wiring connection, and itsintegration with the GSM modem. The software development includes develop themicrocontrollers source code, GSM message command and NMEA protocolcommand.

    1.2 OBJECTIVE

    The main aim of the project is to design and develop an advanced vehicle trackingsystem in the real time environment.When the request by user is sent to the numberat the modem, the system automatically sends a return reply to that mobile indicating

    the position of the vehicle. The user can send a STATUS message from hiscellphone and as soon as the GSM module gets the message, it will check for theusers authentication and if found to be valid, it will immediately send the details ofthe locations like the latitude and the longitude using GPS module. So the user canget to know the exact location of the vehicle.

    Developing Automatic Vehicle Location system using GPS for positioninginformation and GSM/GPRS or information transmission with followingfeatures.

  • 7/28/2019 Chapters-Project Report Final

    6/58

    Introduction OfVehicle Tracking System

    Page 6 of59

    Vehicle Tracking System

    Acquisition of vehicles location information (latitude longitude) after specifiedtime interval.

    Transmission of vehicles location and other information (including ignitionstatus, door(open/close status) to the monitoring station/Tracking server afterspecified interval of time.

    Developing a web based software to display all transmitted information to enduser along with displaying location of vehicle on a map.

    The objective of the project is to build an additional feature to the presentsecurity system that will warn the owner of the vehicle by sending SMS whenthere has been an intrusion into the vehicle.

    To provide a solution to avoid car stolen in the lower cost than advancesecurity car system. (GPS)

    1.3 Working of VTS

    In this project ATmega128 microcontroller is used for interfacing to various hardwareperipherals. The current design is an embedded application which will continuouslymonitor the position of vehicle and report the status of the Vehicle on demand . Fordoing so an ATmega128 microcontroller is interfaced serially to a GSM Modem andGPS Receiver. Intially, the GPS module will continuously receive the data i.e. thelatitude and longitude indicating the position of the vehicle from the satellite andstores the latitude and longitudinal positions in microcontrollers buffer. The GPSmodem gives many parameters as the output, but only the NMEA data coming out is

    read and given to microcontroller through serial interface. After processing of thedata provided by GPS receiver, microcontroller transmits this information to remotelocation using GSM modem.

    Microcontroller controls the operation of GSM modem through serial interface usingAT commands.When the request by user is sent to the number at the modem, itgets activated by receiving our message. At the same instant the GPS getsdeactivated with the help of controller. . As soon as the GSM gets activated it takesthe last received latitude and longitude positions from the buffer and sends amessage to the particular number which is executed in the program. After themessage has been sent to the user the GSM gets deactivated and similarly the GPS

    gets activated. This is a cyclic process .An EEPROM is used to store the mobilenumber. The hardware interfaces to microcontroller are GSM modem and GPSReceiver. The design uses RS-232 protocol for serial communication between themodems and the microcontroller. A serial driver IC is used for converting TTL voltagelevels to RS-232 voltage levels..

  • 7/28/2019 Chapters-Project Report Final

    7/58

    Introduction OfVehicle Tracking System

    Page 7 of59

    Vehicle Tracking System

    1.4 BLOCK DIAGRAM

  • 7/28/2019 Chapters-Project Report Final

    8/58

    Introduction OfVehicle Tracking System

    Page 8 of59

    Vehicle Tracking System

    Fig: Connection Diagram

  • 7/28/2019 Chapters-Project Report Final

    9/58

    Introduction OfVehicle Tracking System

    Page 9 of59

    Vehicle Tracking System

    1.5 Flow Chart of Vehicle Tracking System

  • 7/28/2019 Chapters-Project Report Final

    10/58

    Introduction OfVehicle Tracking System

    Page 10 of59

    Vehicle Tracking System

    1.6 CIRCUIT DIAGRAM

  • 7/28/2019 Chapters-Project Report Final

    11/58

    Introduction OfVehicle Tracking System

    Page 11 of59

    Vehicle Tracking System

    1.7 CIRCUIT OPERATION

    The project is vehicle positioning and navigation system we can locate the vehiclearound the globe with ATmega128 micro controller, GPS receiver, GSM modem,MAX 232 and EEPROM. The code is written in the internal memory ofMicrocontroller i.e. ROM. With help of instruction set it processes the instructionsand it acts as interface between GSM and GPS with help of serial communication.GPS always transmits the data and GSM transmits and receive the data. GPS pinTX is connected to microcontroller RX pin via MAX232 connector. GSM pins TX andRX are connected to microcontroller serial ports alternatively, that is TX to RX andRX to TX.

    Microcontroller communicates with the help of serial communication. First it takes thedata from the GPS receiver and then sends the information to the owner in the formof SMS with help of GSM modem. GPS receiver works on 9600 baud rate is used toreceive the data from space Segment (from Satellites), the GPS values of differentsatellites are sent to microcontroller ATmega128, where these are processed andforwarded to GSM. At the time of processing GPS receives only $GPRMC valuesonly. From these values microcontroller takes only latitude and longitude valuesexcluding time, altitude, name of the satellite, authentication etc. E.g. LAT:1728:2470 LOG: 7843.3089 GSM modem with a baud rate 57600.

    GSM is a Global system for mobile communication in this project it acts as a SMSReceiver and SMS sender. EEPROM is an Electrically Erasable read only memorywhich stores is used to store the mobile number. The power is supplied tocomponents like GSM, GPS and Micro control circuitry using a 12V/3.2A battery.GSM requires 12v,GPS and microcontroller requires 5v .with the help of regulatorswe regulate the power between three components. Crystal oscillator is used in thecircuit to initiate the microcontroller with the frequency of 10Mhz.

    .

    1.7 HARDWARE REQUIREMENTS

    GPS module 634R

    GSM modem SIMCOM300

    ATmega128 Microcontroller

    MAX232

    RS232

  • 7/28/2019 Chapters-Project Report Final

    12/58

    Introduction OfVehicle Tracking System

    Page 12 of59

    Vehicle Tracking System

    1.8 SOFTWARE REQUIREMENT

    AVR studioEmbedded C

    br@ys++ terminal

  • 7/28/2019 Chapters-Project Report Final

    13/58

    Introduction OfVehicle Tracking System

    Page 13 of59

    Vehicle Tracking System

  • 7/28/2019 Chapters-Project Report Final

    14/58

    Micro-Controller

    Page 14 of58

    Vehicle Tracking System

    Chapter-2

    MICROCONTROLLER

    2.1 EMBEDDED SYSTEMS:

    An embedded system is a system which is going to do a predefined specified task andis even defined as combination of both software and hardware. A general-purposedefinition of embedded systems is that they are devices used to control monitor orassist the operation of equipment, machinery or plant. "Embedded" reflects the fact thatthey are an integral part of the system. At the other extreme a general purposecomputer may be used to control the operation of a large complex processing plant, andits presence will be obvious. All embedded systems are including computers ormicroprocessors. Some of these computers are however very simple systems ascompared with a personal computer.

    The very simplest embedded systems are capable of performing only a single functionor set of functions to meet a single predetermined purpose. In more complex systemsan application program that enables the embedded system to be used for a particularpurpose in a specific application determines the functioning of the embedded system.The ability to have programs means that the same embedded system can be used for avariety of different purposes. In some cases a microprocessor may be designed in such a way that applicationsoftware for a particular purpose can be added to the basic software in a secondprocess, after which it is not possible to make further changes. The applicationssoftware on such processors is sometimes referred to as firmware. The simplestdevices consist of a single microprocessor (often called a "chip), which may itself be

    packaged with other chips in a hybrid system or Application Specific Integrated Circuit(ASIC). Its input comes from a detector or sensor and its output goes to a switch oractivator which (for example) may start or stop the operation of a machine or, byoperating a valve, may control the flow of fuel to an engine.

    As the embedded system is the combination of both software and hardware

  • 7/28/2019 Chapters-Project Report Final

    15/58

    Micro-Controller

    Page 15 of58

    Vehicle Tracking System

    Processors are classified into four types like: Micro Processor (p) Micro controller (c) Digital Signal Processor (DSP) Application Specific Integrated Circuits (ASIC)

    Micro Controller (c):A microcontroller is a small computer on a single integrated circuit containing aprocessor core, memory, and programmable input/output peripherals. Program memoryin the form of OTP ROM is also often included on chip, as well as a typically smallamount of RAM. Microcontrollers are designed for embedded applications, in contrast tothe microprocessors used in personal computers or other general purpose applications.

    A microcontroller is a general purpose device, but that is meant to read data, performlimited calculations on that data and control its environment based on thosecalculations. The prime use of a microcontroller is to control the operation of a machineusing a fixed program that is stored in ROM and that does not change over the lifetimeof the system.

    PROM

    A programmable read-only memory (PROM) or field programmable read-only

    memory (FPROM) or one-time programmable non-volatile memory (OTP NVM) is a

    form of digital memory where the setting of each bit is locked by a fuse orantifuse. Such

    PROMs are used to store programs permanently. The key difference from a

    strict ROM is that the programming is applied after the device is constructed.

    http://en.wikipedia.org/wiki/Fuse_(electrical)http://en.wikipedia.org/wiki/Antifusehttp://en.wikipedia.org/wiki/Antifusehttp://en.wikipedia.org/wiki/Antifusehttp://en.wikipedia.org/wiki/Fuse_(electrical)
  • 7/28/2019 Chapters-Project Report Final

    16/58

    Micro-Controller

    Page 16 of58

    Vehicle Tracking System

    These types of memories are frequently seen in video game consoles, mobile phones,

    radio-frequency identification (RFID) tags, implantable medical devices, high-definition

    multimedia interfaces (HDMI) and in many other consumer and automotive electronics

    products.

    2.2 PIN Configuration

    2.3 Features

    The ATmega128 provides the following features: 128Kbytes of In-SystemProgrammable Flash with Read-While-Write capabilities, 4Kbytes EEPROM, 4KbytesSRAM, 53 general purpose I/O lines, 32 general purpose working registers, Real TimeCounter (RTC), 2 USARTs, a byte oriented Two-wire Serial Interface, an 8- channel, 10-bit ADC with optional differential input stage with programmable gain, programmableWatchdog Timer with Internal Oscillator, an SPI serial port, IEEE std. 1149.1 compliant

    http://en.wikipedia.org/wiki/Video_game_consolehttp://en.wikipedia.org/wiki/HDMIhttp://en.wikipedia.org/wiki/HDMIhttp://en.wikipedia.org/wiki/Video_game_console
  • 7/28/2019 Chapters-Project Report Final

    17/58

    Micro-Controller

    Page 17 of58

    Vehicle Tracking System

    JTAG test interface, also used for accessing the On-chip Debug system andprogramming and six software selectable power saving modes.

    High-performance, Low-power AtmelAVR8-bit Microcontroller

    Advanced RISC Architecture

    32 x 8 General Purpose Working Registers + Peripheral Control Registers

    High Endurance Non-volatile Memory segments

    128Kbytes of In-System Self-programmable Flash program memory

    4Kbytes EEPROM

    4Kbytes Internal SRAM

    Optional Boot Code Section with Independent Lock BitsIn-System Programming by On-chip Boot Program

    True Read-While-Write Operation Up to 64Kbytes Optional External Memory Space

    Programming of Flash, EEPROM, Fuses and Lock Bits through the JTAG

    Interface

    Real Time Counter with Separate Oscillator

    Operating Voltages

    4.5 - 5.5V ATmega128

    2.4 CENTRAL PROCESSING UNITCPU has a role of connective element between other blocks in the microcontroller. It

    coordinates the work of other blocks and executes the user program.

  • 7/28/2019 Chapters-Project Report Final

    18/58

    Micro-Controller

    Page 18 of58

    Vehicle Tracking System

    2.5 PIN DESCRIPTION:

    1. VCC:- Digital supply voltage.2. GND:- Ground.

    3. Port A (PA7..PA0),Port B (PB7..PB0), Port C (PC7..PC0), Port D (PD7..PD0),Port E (PE7..PE0), Port F (PF7..PF0), Port G (PG4..PG0):- AllPort has an 8-bit

    bi-directional I/O port with internal pull-up resistors (selected for each bit). ThePort output buffers have symmetrical drive characteristics with both high sink andsource capability. As inputs, Port pins that are externally pulled low will sourcecurrent if the pull-up resistors are activated. The Port pins are tri-stated when areset condition becomes active, even if the clock is not running.

    4. RESET:- Reset input. A low level on this pin for longer than the minimum pulselength will generate a reset, even if the clock is not running. Shorter pulses arenot guaranteed to generate a reset.

  • 7/28/2019 Chapters-Project Report Final

    19/58

    Micro-Controller

    Page 19 of58

    Vehicle Tracking System

    5. XTAL1:- Input to the inverting Oscillator amplifier and input to the internal clockoperating circuit.

    6. XTAL2:- Output from the inverting Oscillator amplifier.7. AVCC:-AVCC is the supply voltage pin for Port F and the A/D Converter. It

    should be externally connected to VCC, even if the ADC is not used. If the ADC

    is used, it should be connected to VCC through a low-pass filter. 8. AREF:-AREF is the analog reference pin for the A/D Converter.9. PEN:- PEN is a programming enable pin for the SPI Serial Programming mode,

    and is internally pulled high . By holding this pin low during a Power-on Reset,the device will enter the SPI Serial Programming mode. PEN has no functionduring normal operation.

    2.6 Architectural Overview

    2.6.1 Program memory (FLASH) is used for storing a written program. Flash memory

    is an example of quite a recent type of storage technology known as solid state devices.

    This type of portable storage has become very popular because of its low price and high

    storage capacity compared to its rivals, e.g. floppy disk.

    Solid state devices are regarded as being robust and reliable because they have no

    moving parts with the data stored in semiconductor chips. This technology already

    exists in the form of flash memory used to store the Basic Input/Output System (BIOS)

    of a motherboard.

    Unlike ROM, flash memory can be read form and written to and unlike RAM does notrequire power to retain its data. Although these devices typically cannot hold as much

    data as hard disks, CD-ROMs and DVDs, the storage capacity is continually increasing.

    Since memory made in FLASH technology can be programmed and cleared more than

    once, it makes this microcontroller suitable for device development.

    2.6.2 EEPROM:- This is the most flexible type of ROM that uses special softwares to

    erase the content of the device. The difference between EPROM and EEPROM is that;

    EEPROM uses electric current to erase the content while EPROM uses ultraviolet rays,

    data memory that needs to be saved when there is no supply. It is usually used forstoring important data that must not be lost if power supply suddenly stops. For

    instance, one such data is an assigned temperature in temperature regulators. If during

    a loss of power supply this data was lost, we would have to make the adjustment once

    again upon return of supply. Thus our device loses on self-reliance.

  • 7/28/2019 Chapters-Project Report Final

    20/58

    Micro-Controller

    Page 20 of58

    Vehicle Tracking System

    2.6.3 RAM:- Data memory used by program during its execution. In ram are stored all

    inter results or temporary data during run-time.

    2.6.4 INTERRUPT SYSTEM:-

    An interrupt is an external or internal event that suspends the operation of

    microcontroller to inform it that a device needs its service. In interrupt method,

    whenever any device needs its service, the device notifies the micro controller by

    sending it an interrupt signal. Upon receiving an interrupt signal, the micro controller

    interrupts whatever it is doing and serves the device. The program associated with

    interrupt is called as interrupt service subroutine (ISR).Main advantage with interrupts is

    that the micro controller can serve many devices.

    2.6.5 ALU Arithmetic Logic Unit:-

    The high-performance AVR ALU operates in direct connection with all the 32 generalpurpose working registers. Within a single clock cycle, arithmetic operations betweengeneral purpose registers or between a register and an immediate are executed. The

    ALU operations are divided into three main categories arithmetic, logical, and bit-functions.

    2.6.6 Status Register:-

    The Status Register contains information about the result of the most recently executedarithmetic instruction. This information can be used for altering program flow in order toperform conditional operations. Note that the Status Register is updated after all ALUoperations, as specified in the Instruction Set Reference. This will in many casesremove the need for using the dedicated compare instructions, resulting in faster andmore compact code. The status register is not automatically stored when entering aninterrupt routine and restored when returning from an interrupt.

  • 7/28/2019 Chapters-Project Report Final

    21/58

    Micro-Controller

    Page 21 of58

    Vehicle Tracking System

    2.6.7 General PurposeRegister File:-

    The Register file is optimized for the AVR Enhanced RISC instruction set. In order toachieve the required performance and flexibility, the following input/output schemes are

    supported by the Register file: One 8-bit output operand and one 8-bit result input Two 8-bit output operands and one 8-bit result input Two 8-bit output operands and one 16-bit result input One 16-bit output operand and one 16-bit result input

    2.6.8 Stack Pointer:-

    The Stack is mainly used for storing temporary data, for storing local variables and forstoring return addresses after interrupts and subroutine calls. The Stack PointerRegister always points to the top of the Stack. Note that the Stack is implemented asgrowing from higher memory locations to lower memory locations. This implies that aStack PUSH command decreases the Stack Pointer.The Stack Pointer points to the data SRAM stack area where the Subroutine andInterrupt Stacks are located. This Stack space in the data SRAM must be defined by theprogram before any subroutine calls are executed or interrupts are enabled.

    2.6.9 Clock generator oscillator:-

    Oscillator circuit is used for providing a microcontroller with a clock. Clock is needed so

    that microcontroller could execute a program or program instructions.

    2.6.10 Reset:-

    Reset is used for putting the microcontroller into a 'known' condition. That

    practically means that microcontroller can behave rather inaccurately under certain

    undesirable conditions. In order to continue its proper functioning it has to be reset,

    meaning all registers would be placed in a starting position. Reset is not only used whenmicrocontroller doesn't behave the way we want it to, but can also be used when trying

    out a device as an interrupt in program execution, or to get a microcontroller ready

    when loading a program.

  • 7/28/2019 Chapters-Project Report Final

    22/58

    Micro-Controller

    Page 22 of58

    Vehicle Tracking System

    2.6.12 Ports:-

    Term "port" refers to a group of pins on a microcontroller which can be accessed

    simultaneously, or on which we can set the desired combination of zeros and ones, or

    read from them an existing status. Physically, port is a register inside a microcontrollerwhich is connected by wires to the pins of a microcontroller. Ports represent physical

    connection of Central Processing Unit with an outside world. Microcontroller uses them

    in order to monitor or control other components or devices.

    2.6.13 Reset andInterrupt Handling:-

    Interrupts are a mechanism of a microcontroller which enables it to respond to

    some events at the moment they occur, regardless of what microcontroller is doing atthe time. This is a very important part, because it provides connection between a

    microcontroller and environment which surrounds it. Generally, each interrupt changes

    the program flow, interrupts it and after executing an interrupt subprogram (interrupt

    routine) it continues from that same point on. The AVR provides several different

    interrupt sources. These interrupts and the separate reset vector each have a separate

    program vector in the program memory space. All interrupts are assigned individual

    enable bits which must be written logic one together with the Global Interrupt Enable bit

    in the Status Register in order to enable the interrupt. The lowest addresses in the

    program memory space are by default defined as the Reset and Interrupt vectors. The

    lower the address the higher is the priority level. RESET has the highest priority, When

    an interrupt occurs, the Global Interrupt Enable I-bit is cleared and all interrupts are

    disabled.

    2.6.14 Pull-up:-The pull-ups on the AD7:0 ports may be activated if the corresponding Port register iswritten to one. To reduce power consumption in sleep mode, it is recommended todisable the pull-ups by writing the Port register to zero before entering sleep.

  • 7/28/2019 Chapters-Project Report Final

    23/58

    Micro-Controller

    Page 23 of58

    Vehicle Tracking System

    2.6.15 AVR ATmega128 Memories:-

    This section describes the different memories in the Atmel AVR ATmega128. The

    AVR architecture has two main memory spaces, the Data Memory and the Program

    Memory space. In addition, the ATmega128 features an EEPROM Memory for data

    storage. All three memory spaces are linear and regular.

    In-System Reprogrammable Flash Program Memory:-

    The ATmega128 contains 128Kbytes On-chip In-System Reprogrammable Flashmemory for program storage. Since all AVR instructions are 16 or 32 bits wide, theFlash is organized as 64K x 16. For software security, the Flash Program memoryspace is divided into two sections,Boot Program section and Application Program section.

    Fig: Flash Memory Diagram

    SRAM Data Memory:-The Atmel AVR ATmega128 supports two different configurations for the SRAM datamemory

  • 7/28/2019 Chapters-Project Report Final

    24/58

    Micro-Controller

    Page 24 of58

    Vehicle Tracking System

    EEPROM Data Memory:-

    The Atmel AVRATmega128 contains 4Kbytes of data EEPROM memory. It isorganized as a separate data space, in which single bytes can be read and written

    External Memory Interface:-

    With all the features the External Memory Interface provides, it is well suited to operateas an interface to memory devices such as External SRAM and Flash, and peripheralssuch as LCD display, A/D, and D/A.

    Program memory:-

    Program memory has been carried out in FLASH technology which makes it possible toprogram a microcontroller many times before it's installed into a device, and even after

    its installment if eventual changes in program or process parameters should occur.

    Data memory:-

    Data memory consists of EEPROM and RAM memories. EEPROM memory consists of256 eight bit locations whose contents is not lost during loosing of power supply.EEPROM is not directly addressable, but is accessed indirectly through EEADR andEEDATA registers. As EEPROM memory usually serves for storing importantparameters (for example, of a given temperature in temperature regulators) , there is a

    strict procedure for writing in EEPROM which must be followed in order to avoidaccidental writing. Locations of RAM memory are also called GPR registers which is anabbreviation for General Purpose Registers. GPR registers can be accessed regardlessof which bank is selected at the moment

    2.7 USART

  • 7/28/2019 Chapters-Project Report Final

    25/58

    Micro-Controller

    Page 25 of58

    Vehicle Tracking System

    The Universal Synchronous and Asynchronous serial Receiver and Transmitter(USART) is a highly flexible serial communication device. The main features are: Full Duplex Operation (Independent Serial Receive and Transmit Registers) Asynchronous or Synchronous Operation

    Master or Slave Clocked Synchronous Operation High Resolution Baud Rate Generator Supports Serial Frames with 5, 6, 7, 8, or 9 Data Bits and 1 or 2 Stop Bits Odd or Even Parity Generation and Parity Check Supported by Hardware Data OverRun Detection Framing Error Detection Noise Filtering Includes False Start Bit Detection and Digital Low Pass Filter Three Separate Interrupts on TX Complete, TX Data Register Empty, and RXComplete Multi-processor Communication Mode Double Speed Asynchronous Communication Mode

    2.7.1 Dual USART:-

    The ATmega128 has two USARTs, USART0 and USART1. The functionality for bothUSARTs is described below. USART0 and USART1 have different I/O registers.in

    ATmega128 compatibility mode, USART1 is not available, neither is the UBRR0H orUCRS0C Registers. This means that in ATmega103 compatibility mode, the

    ATmega128 supports asynchronous operation of USART0 only. The three main parts ofthe USART: Clock Generator, Transmitter, and Receiver. Control registers are sharedby all units. The clock generation logic consists of synchronization logic for externalclock input used by synchronous slave operation, and the baud rate generator. TheXCK (Transfer Clock) pin is only used by Synchronous Transfer mode. The Transmitterconsists of a single write buffer, a serial Shift Register, parity generator and control logicfor handling different serial frame formats. The write buffer allows a continuous transferof data without any delay between frames. The Receiver is the most complex part of theUSART module due to its clock and data recovery units. The recovery units are used forasynchronous data reception. In addition to the recovery units, the receiver includes aparity checker, control logic, a Shift Register and a two level receive buffer (UDR). Thereceiver supports the same frame formats as the Transmitter, and can detect frameerror, data overrun and parity errors.

  • 7/28/2019 Chapters-Project Report Final

    26/58

    Micro-Controller

    Page 26 of58

    Vehicle Tracking System

    Figure: Transmission Diagram

    Figure: Reception Diagram

    2.8 MAX232:

    Max 232 is a communications device used mainly for serial commands to and from aflash ROM. The MAX232 is an integrated circuit that converts signals from an RS-

  • 7/28/2019 Chapters-Project Report Final

    27/58

    Micro-Controller

    Page 27 of58

    Vehicle Tracking System

    232serial port to signals suitable for use in TTL compatible digital logic circuits.TheMAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTSsignals. The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a

    single +5 V supply via on-chip charge pumps and external capacitors. This makes it

    useful for implementing RS-232 in devices that otherwise do not need any voltages

    outside the 0V to +5 V range, as power supply design does not need to be made more

    complicated just for driving the RS-232 in this case.

    The receivers reduce RS-232 inputs (which may be as high as 25 V), to standard 5

    VTTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis

    of 0.5 V.

    The later MAX232A is backwards compatible with the original MAX232 but may operate

    at higher baud rates and can use smaller external capacitors 0.1 F in place of the 1.0

    F capacitors used with the original device.

    The newer MAX3232 is also backwards compatible, but operates at a broader voltage

    range, from 3 to 5.5V.

    2.9 RS-232 (ANSI/EIA-232 Standard) is the serial connection found on IBM

    compatible PCs. It is used for many purposes, such as connecting a mouse, printer, or

  • 7/28/2019 Chapters-Project Report Final

    28/58

    Micro-Controller

    Page 28 of58

    Vehicle Tracking System

    modem, as well as industrial instrumentation. Because of improvements in line drivers

    and cables, applications often increase the performance of RS-232 beyond the distance

    and speed listed in the standard. RS-232 is limited to point-to-point connections

    between PC serial ports and devices. RS-232 hardware can be used for serial

    communication up to distances of 50 feet.

  • 7/28/2019 Chapters-Project Report Final

    29/58

    GSM

    Page 29 of58

    Vehicle Tracking System

    Chapter-3 GLOBAL SYSTEM FOR MOBILE COMMUNICATIONS

    3.1 Introduction of GSM

    GSM, which stands for Global System for Mobile communications, reigns

    (important) as the worlds most widely used cell phone technology. Cell phones use acell phone service carriers GSM network by searching for cell phone towers in the

    nearby area. Global system for mobile communication (GSM) is a globally accepted

    standard for digital cellular communication.

    The Europeans realized this early on, and in 1982 the Conference of European

    Posts and Telegraphs (CEPT) formed a study group called the Groupe Special Mobile

    (GSM) to study and develop a pan-European public land mobile system. The proposed

    system had to meet certain criteria:

    Good subjective speech quality

    Low terminal and service cost

    Low terminal and service cost

    Ability to support handheld terminals

    Support for range of new services and facilities

    Spectral efficiency

    ISDN compatibility

    3.1.1 Need of GSM

    The GSM study group aimed to provide the followings through the GSM:

    Improved spectrum efficiency.

    International roaming.

    Low-cost mobile sets and base stations (BS)

    High-quality speech

    Compatibility with Integrated Services Digital Network (ISDN) and other

    telephone company services.

  • 7/28/2019 Chapters-Project Report Final

    30/58

    GSM

    Page 30 of58

    Vehicle Tracking System

    3.1.2 Services provided by GSM

    Bearer services: Typically data transmission instead of voice. Fax and SMS are

    examples.

    Teleservices: Voice oriented traffic.

    Supplementary services: Call forwarding, caller ID, call waiting and the like.

    3.2 GSM Architecture

    A GSM network consists of several functional entities whose functions and

    interfaces are defined. The GSM network can be divided into following broad parts.

    The Mobile Station (MS)

    The Base Station Subsystem (BSS)

    The Network Switching Subsystem (NSS)

    The Operation Support Subsystem (OSS)

  • 7/28/2019 Chapters-Project Report Final

    31/58

    GSM

    Page 31 of58

    Vehicle Tracking System

    3.3 SIM300 -

    Designed for global market, SIM300 is a Tri-band GSM/GPRS engine that works onfrequencies EGSM 900 MHz, DCS 1800 MHz and PCS1900 MHz. SIM300 providesGPRS multi-slot class 10 capability and support the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4.With a tiny configuration of 40mm x 33mm x 2.85 mm. SIM300 can fit almost all thespace requirement in your application, such as Smart phone, PDA phone and othermobile device.

    The physical interface to the mobile application is made through a 60 pins board-to-board connector, which provides all hardware interfaces between the module andcustomers boards except the RF antenna interface.

    1) The keypad and SPI LCD interface will give you the flexibility to developcustomized applications.

    2) Two serial ports can help you easily develop your applications.3) Two audio channels include two microphones inputs and two speaker

    outputs. This can be easily configured by AT command.

  • 7/28/2019 Chapters-Project Report Final

    32/58

    GSM

    Page 32 of58

    Vehicle Tracking System

    SIM300 provide RF antenna interface with two alternatives: antenna connector andantenna pad. The antenna connector is MURATA MM9329-2700. And customersantenna can be soldered to the antenna pad.The SIM300 is designed with power saving technique, the current consumption to as

    low as 2.5mA in SLEEP mode.The SIM300 is integrated with the TCP/IP protocol, Extended TCP/IP AT commands aredeveloped for customers to use the TCP/IP protocol easily, which is very useful forthose data transfer applications.

    Table: SIM300 Key Features

    Feature Implementation

    Power supply Single supply voltage 3.4V 4.5VPower saving Typical power consumption in

    SLEEP mode to 2.5mA

    Frequency bands SIM300 Tri-band: EGSM 900,DCS 1800, PCS 1900. The band canbe set by AT COMMAND, anddefault band is EGSM 900 and DCS1800. Compliant to GSM Phase 2/2+

    GSM class Small MS

    SMS MT, MO, CB, Text and PDU mode SMS storage: SIM card Support transmission of SMSalternatively over CSD or GPRS.User can choose preferred mode.

  • 7/28/2019 Chapters-Project Report Final

    33/58

    GSM

    Page 33 of58

    Vehicle Tracking System

    3.4 Application

    SIMComs wireless modules have been applied in:1) Automotives2) Telematics

    3) Security4) Tracking and tracing5) Auto meter reading6) Industrial automation7) Payment8) Healthcare9) Others

    Now SIM300 is connect with Microcontroller Atmega128 through serial port and sendLatitude and Longitude position with the help of AT Commands.

    3.5 AT Commands-AT commands are used to control GSM MODEM. AT is the abbreviation for Attention.These commands come from Hayes commands that were used by the Hayes smartmodems. The Hayes commands started with AT to indicate the attention from theMODEM. The dial up and wireless MODEMs (devices that involve machine to machinecommunication) need AT commands to interact with a computer. These include theHayes command set as a subset, along with other extended AT commands.

    AT commands with a GSM/GPRS MODEM or mobile phone can be used to accessfollowing information and services:

    a. Information and configuration pertaining to mobile device or MODEM and SIMcard.

    b. SMS services.c. MMS services.d. Fax services.e. Data and Voice link over mobile network.

    Explanation of commonly used AT commands:1) AT -This command is used to check communication between the module and theComputer.

    For example,ATOK

  • 7/28/2019 Chapters-Project Report Final

    34/58

    GSM

    Page 34 of58

    Vehicle Tracking System

    The command returns a result code OK if the computer (serial port) and module areconnected properly. If any of module or SIM is not working, it would return a result codeERROR.

    2) +CMGF - This command is used to set the SMS mode. Either text or PDU mode canbe selected by assigning 1 or 0 in the command.

    SYNTAX: AT+CMGF=

    0: for PDU mode1: for text mode

    The text mode of SMS is easier to operate but it allows limited features of SMS. ThePDU (protocol data unit) allows more access to SMS services but the operator requiresbit level knowledge of TPDUs. The headers and body of SMS are accessed in hex

    format in PDU mode so it allows availing more features.

    For example,AT+CMGF=1OK3) +CMGW - This command is used to store message in the SIM.

    SYNTAX: AT+CMGW= Phone number> Message to be storedCtrl+z.As one types AT+CMGW and phone number, > sign appears on next line where onecan type the message. Multiple line messages can be typed in this case.This is why the message is terminated by providing a Ctrl+z combination. As Ctrl+z is

    pressed, the following information response is displayed on the screen.

    +CMGW: Number on which message has been stored.

    4) +CMGS - This command is used to send a SMS message to a phone number.

    SYNTAX: AT+CMGS= serial number of message to be send.As the command AT+CMGS and serial number of message are entered, SMS is sent tothe particular SIM.

    For example,AT+CMGS=1OK

    5) ATD - This command is used to dial or call a number.

  • 7/28/2019 Chapters-Project Report Final

    35/58

    GSM

    Page 35 of58

    Vehicle Tracking System

    SYNTAX: ATD(Enter)

    For example,ATD123456789

    6) ATA - This command is used to answer a call. An incoming call is indicated by amessage RING which is repeated for every ring of the call. When the call ends NO CARRIER is displayed on the screen.

    SYNTAX: ATA(Enter)As ATA followed by enter key is pressed, incoming call is answered.

    For example,RINGRING

    ATA

    7) ATH - This command is used to disconnect remote user link with the GSM module.

    SYNTAX: ATH (Enter)

  • 7/28/2019 Chapters-Project Report Final

    36/58

    GPS

    Page 36 of58

    Vehicle Tracking System

    Chapter-4 GLOBAL POSITION SYSTEM

    4.1 Introduction

    The Global Positioning System (GPS) is a space-based satellite navigation system

    that provides location and time information in all weather conditions, anywhere on or

    near the Earth where there is an unobstructed line of sight to four or more GPS

    satellites.

    Each GPS satellite transmits radio signals that enable the GPS receivers to calculate

    where its (or your vehicles) location on the Earth and convert the calculations into

    geodetic latitude, longitude and velocity. A receiver needs signals from at least three

    GPS satellites to pinpoint your vehicles position.

    GPS Receivers commonly used in most Vehicle tracking systems can only receive data

    from GPS Satellites. They cannot communicate back with GPS or any other satellite.

    A system based on GPS can only calculate its location but cannot send it to central

    control room. In order to do this they normally use GSM-GPRS Cellular networks

    connectivity using additional GSM modem/module.

    In this project we use GPS-634R is a highly integrated smart GPS module witha ceramic GPS patch antenna. The antenna is connected to the module via anLNA. The module is with 51 channel acquisition engine and 14 channel trackengine, which be capable of receiving signals from up to 65 GPS satellites andtransferring them into the precise position and timing information that can be

    read over either UART port or RS232 serial port. Small size and high-end GPSfunctionality are at low power consumption, Both of the LVTTL level and RS232signal interface are provided on the interface connector, supply voltage of3.6V~6.0V is supported.

    The smart GPS antenna module is available as an off-the-shelf component, 100%tested. The smart GPS antenna module can be offered for OEM applications withthe versatile adaptation in form and connection. Additionally, the antenna can betuned to the final systems circumstances.

    There are three types GPS of start - hot, warm and cold.

    The hot start is when the GPS device remembers its last calculated position and thesatellites in view, the almanac used (information about all the satellites in theconstellation), the UTC Time and makes an attempt to lock onto the same satellites andcalculate a new position based upon the previous information. This is the quickest GPSlock but it only works if you are generally in the same location as you were when theGPS was last turned off.

  • 7/28/2019 Chapters-Project Report Final

    37/58

    GPS

    Page 37 of58

    Vehicle Tracking System

    The warm start is when the GPS device remembers its last calculated position,almanac used, and UTC Time, but not which satellites were in view. It then performs areset and attempts to obtain the satellite signals and calculates a new position.The receiver has a general idea of which satellites to look for because it knows its lastposition and the almanac data helps identify which satellites are visible in the sky. This

    takes longer than a hot start but not as long as a cold start.

    And finally the cold start is when the GPS device dumps all the information, attemptsto locate satellites and then calculates a GPS lock. This takes the longest becausethere is no known information.The GPS receiver has to attempt to lock onto a satellite signal from any availablesatellites, basically like polling, which takes a lot longer than knowing which satellites tolook for. This GPS lock takes the longest.

  • 7/28/2019 Chapters-Project Report Final

    38/58

    GPS

    Page 38 of58

    Vehicle Tracking System

    4.2 Flow-Chart of GPS

    4.3 FEATURES

    65 channels to acquire and track satellites simultaneously Tracking sensitivity reaches -161 dBm 0.5 PPM TCXO for quick cold start Integral LNA with low power control Cold start _29 sec under clear Sky Hot start _1 sec under clear Sky Accuracy 5m CEP Operable at 3.6V-6V

  • 7/28/2019 Chapters-Project Report Final

    39/58

    GPS

    Page 39 of58

    Vehicle Tracking System

    Both of RS232 and UART interface at CMOS level Small form factor of 32 mm W x 32 mm Lx 8 mm H Mountable without solder process 6 pins wafer connector

    4.4 PIN CONFIGURATION

  • 7/28/2019 Chapters-Project Report Final

    40/58

    GPS

    Page 40 of58

    Vehicle Tracking System

    4.5 Communication Specification

  • 7/28/2019 Chapters-Project Report Final

    41/58

    GPS

    Page 41 of58

    Vehicle Tracking System

    4.6 NMEA Protocol

    The serial interface protocol is based on the National Marine Electronics AssociationsNMEA 0183 ASCII interface specification. The NMEA 0183 standard uses a simple

    ASCII, serial communication protocol that defines how data are transmitted in a"sentence" from one "talker" to multiple "listeners" at a time.

    Application Protocol Layer rules:

    Each message's starting character is a dollar sign.

    The next five characters identify the talker (two characters) and the type of message(three characters).

    All data fields that follow are comma-delimited. Where data is unavailable, the corresponding field remains blank

    The first character that immediately follows the last data field character is anasterisk, but it is only included if a checksum is supplied.

    The asterisk is immediately followed by a checksum represented as a two-digit hexadecimal number. The checksum is the bitwise exclusiveOR of ASCII codes of all characters between the $and *. According to the officialspecification, the checksum is optional for most data sentences, but is compulsoryfor RMA, RMB, and RMC (among others).

    ends the message.

  • 7/28/2019 Chapters-Project Report Final

    42/58

    GPS

    Page 42 of58

    Vehicle Tracking System

    4.6.1 GGA-GLOBAL POSITIONING SYSTEM FIX DATATime, position and fix related data for a GPS receiver.Structure:

    $GPGGA,hhmmss.sss,ddmm.mmmm,a,dddmm.mmmm,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh

    1 2 3 4 5 6 7 8 9 10 11 12 13

  • 7/28/2019 Chapters-Project Report Final

    43/58

    GPS

    Page 43 of58

    Vehicle Tracking System

    4.6.2 GLL - LATITUDE AND LONGITUDE, WITH TIME OF POSITION FIX ANDSTATUSLatitude and longitude of current position, time, and status.Structure:$GPGLL,ddmm.mmmm,a,dddmm.mmmm,a,hhmmss.sss,A,a*hh1 2 3 4 5 6 7 8Example:

  • 7/28/2019 Chapters-Project Report Final

    44/58

    GPS

    Page 44 of58

    Vehicle Tracking System

    $GPGLL,4250.5589,S,14718.5084,E,092204.999,A,A*2D

    4.6.3 GSA - GPS DOP AND ACTIVE SATELLITES

    GPS receiver operating mode, satellites used in the navigation solution reported by theGGA or GNS sentenceand DOP values.Structure:$GPGSA,A,x,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,x.x,x.x,x.x*hh1 2 3 3 3 3 3 3 3 3 3 3 3 3 4 5 6 7

  • 7/28/2019 Chapters-Project Report Final

    45/58

    GPS

    Page 45 of58

    Vehicle Tracking System

    Example:$GPGSA,A,3,01,20,19,13,,,,,,,,,40.4,24.4,32.2*0A

    4.7 Application

    Automotive and Marine Navigation Automotive NavigatorTracking Emergency Locator Geographic Surveying Personal Positioning

  • 7/28/2019 Chapters-Project Report Final

    46/58

    Snapshots

    Page 46 of58

    Vehicle Tracking System

    Chapter-5

    Snapshots

    5.1 AVR STUDIO

    5.1.1 STARTING WITH AVR STUDIO

  • 7/28/2019 Chapters-Project Report Final

    47/58

    Snapshots

    Page 47 of58

    Vehicle Tracking System

    5.1.2 SAVING PROJECT

  • 7/28/2019 Chapters-Project Report Final

    48/58

    Snapshots

    Page 48 of58

    Vehicle Tracking System

    5.1.3 DEVICE SELECTION

  • 7/28/2019 Chapters-Project Report Final

    49/58

    Snapshots

    Page 49 of58

    Vehicle Tracking System

    5.1.4 SHOW SELECTED DEVICE

  • 7/28/2019 Chapters-Project Report Final

    50/58

    Snapshots

    Page 50 of58

    Vehicle Tracking System

    5.1.5 TOOLS

  • 7/28/2019 Chapters-Project Report Final

    51/58

    Snapshots

    Page 51 of58

    Vehicle Tracking System

    5.1.6 OPTIONS

  • 7/28/2019 Chapters-Project Report Final

    52/58

    Snapshots

    Page 52 of58

    Vehicle Tracking System

    5.1.7 BUILDING THE CODE

    5.1.8 SHOWING COMPILED FILE

  • 7/28/2019 Chapters-Project Report Final

    53/58

    Snapshots

    Page 53 of58

    Vehicle Tracking System

    5.1.9 BLINK LED EXAMPLE

  • 7/28/2019 Chapters-Project Report Final

    54/58

    Snapshots

    Page 54 of58

    Vehicle Tracking System

    5.2 Brays Terminal

    5.2.1 Baud RateBaud rate refers to number of signal or symbol changes that occur per second. A

    symbol is one of several voltage, frequency or phase changes. Whereas, the bit rate

    refers to data transfer in bits per second.

    5.2.2 COM Port

    In computer networking, COM port enables external modems connect to PC via a serial

    cable. The standard for serial port communication has been RS-232.

    Note-Data bits, parity and stop bits are 8,none and 1 generally.

  • 7/28/2019 Chapters-Project Report Final

    55/58

    Snapshots

    Page 55 of58

    Vehicle Tracking System

    Fig: Command sending and Signals Receiving on Terminal

  • 7/28/2019 Chapters-Project Report Final

    56/58

    Conclusion

    Page 56 of58

    Vehicle Tracking System

    Chapter 6

    Conclusion and Reference

    The Project titled Vehicle Positioning and Navigating using GPS and GSM is a modelfor Vehicle Tracking unit with the help of GPS receivers and GSM modem.

    The positioning is done in the form of latitude and longitude along with the exactlocation of the place, by making use of Google maps.

    The system tracks the location of particular vehicle and sends to users mobile in form ofSMS and also to EEPROM. The arrived data, is in the form of latitude and longitude isused to locate the Vehicle on the Google maps. To see on the Google map we need todecode the received SMS.

    We have completed the project as per the requirements of our project.

    Finally the aim of the project i.e. to Position and navigate the vehicle, has beenachieved successfully by using Vehicle Positioning and Navigating system.

    Reference

    1. www.wittyrobbo.com

    2. www.robokits.com

    3. www.atmel.in

    4.hekilledmywire.wordpress.com

    5. www.arduino.cc

    6.www.probots.co.in

    7. www.nskelectronics.com

    http://www.probots.co.in/http://www.probots.co.in/http://www.probots.co.in/http://www.probots.co.in/
  • 7/28/2019 Chapters-Project Report Final

    57/58

    Conclusion

    Page 57 of58

    Vehicle Tracking System

    FUTURE SCOPE

    We can use the EEPROM to store the previous Navigating positions up to 256locations and we can navigate up to N number of locations by increasing its

    memory. We can reduce the size of the kit by using GPS+GSM on the same module. We can increase the accuracy up to 3m by increasing the cost of the GPS

    receivers. We can use our kit for detection of bomb by connecting to the bomb detector. With the help of high sensitivity vibration sensors we can detect the accident. Whenever vehicle unexpectedly had an accident on the road with help of

    vibration sensor we can detect the accident and we can send the location to theowner, hospital and police.

    We can use our kit to assist the traffic. By keeping the kits in the entire vehiclesand by knowing the locations of all the vehicles.

    If anybody steals our car we can easily find our car around the globe. By keepingvehicle positioning vehicle on the vehicle.

  • 7/28/2019 Chapters-Project Report Final

    58/58