FinalReport2 (1)

download FinalReport2 (1)

of 73

Transcript of FinalReport2 (1)

  • 7/29/2019 FinalReport2 (1)

    1/73

    1

    CHAPTER-1

    INTRODUCTION

  • 7/29/2019 FinalReport2 (1)

    2/73

    2

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

  • 7/29/2019 FinalReport2 (1)

    3/73

    3

    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. These are the main hardware

    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.

  • 7/29/2019 FinalReport2 (1)

    4/73

    4

    1.3 PICTORIAL REPRESENTATION

    Fig3: Pictorial Representation

  • 7/29/2019 FinalReport2 (1)

    5/73

    5

    CHAPTER-2

    SYSTEM OVERVIEW

  • 7/29/2019 FinalReport2 (1)

    6/73

    6

    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.

  • 7/29/2019 FinalReport2 (1)

    7/73

    7

    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.

  • 7/29/2019 FinalReport2 (1)

    8/73

    8

    CHAPTER-3

    POWER SUPPLY

    `

  • 7/29/2019 FinalReport2 (1)

    9/73

    9

    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 secondarywinding. This varying magnetic flux induces a varying electromotive force

    (emf) or voltage in the secondary winding.

    The ideal transformer induces secondary voltageES =VS as a proportion of the primary

    voltage VP =EP and respective winding turns as given by the equation

    where

  • 7/29/2019 FinalReport2 (1)

    10/73

    10

    VP/VS =EP/ES = a is the voltage ratio andNP/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.

  • 7/29/2019 FinalReport2 (1)

    11/73

    11

    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

    Fig8.: PIN DESCRIPTION Of 7805

    Pin

    No

    Function Name

    1 Input voltage (5V-18V) Input

    2 Ground (0V) Ground

    3 Regulated output; 5V (4.8V-5.2V) Output

  • 7/29/2019 FinalReport2 (1)

    12/73

    12

    CHAPTER-4

    MICROCONTROLLER

  • 7/29/2019 FinalReport2 (1)

    13/73

    13

    4.1 INTRODUCTION TO AT89S52 MICROCONTROLLER

    The AT89S52 is a low power, high-performance CMOS 8-bit microcontroller with 8K bytesof in-system programmable Flash memory. The device is manufactured using Atmels high-

    density 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 in-

    system 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 six-

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

  • 7/29/2019 FinalReport2 (1)

    14/73

    14

    4.2 PIN DIAGRAM

    Fig 9: Pin diagram of AT89S52

  • 7/29/2019 FinalReport2 (1)

    15/73

    15

    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 0may 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

  • 7/29/2019 FinalReport2 (1)

    16/73

    16

    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

    Function Name

    1

    8 bit input/output port (P1) pins

    P1.0

    2 P1.1

    3 P1.2

    4 P1.3

    5 P1.4

    6 P1.5

    7 P1.6

    8 P1.7

    9 Reset pin; Active high Reset

  • 7/29/2019 FinalReport2 (1)

    17/73

    17

    10Input (receiver) for serial

    communicationRxD

    8 bit

    input/output

    port (P3) pins

    P3.0

    11Output (transmitter) for serial

    communicationTxD P

    3.1

    12 External interrupt 1 Int0 P3.2

    13 External interrupt 2 Int1 P3.3

    14 Timer1 external input T0 P3.4

    15 Timer2 external input T1 P3.5

    16 Write to external data memory Write P3.6

    17 Read from external data memory Read P3.7

    18

    Quartz crystal oscillator (up to 24 MHz)

    Crystal 2

    19 Crystal 1

    20 Ground (0V) Ground

    21

    8 bit input/output port (P2) pins

    /

    High-order address bits when interfacing with external memory

    P2.0/ A8

    22 P2.1/ A9

    23 P2.2/ A10

    24 P2.3/ A11

    25 P2.4/ A12

    26 P2.5/ A13

    27 P2.6/ A14

    28 P2.7/ A15

    29 Program store enable; Read from external program memory PSEN

  • 7/29/2019 FinalReport2 (1)

    18/73

    18

    30

    Address Latch Enable ALE

    Program pulse input during Flash programming Prog

    31 External Access Enable; Vcc for internal program executions EA

    Programming enable voltage; 12V (during Flash programming) Vpp

    32

    8 bit input/output port (P0) pins

    Low-order address bits when interfacing with external memory

    P0.7/ AD7

    33 P0.6/ AD6

    34 P0.5/ AD5

    35 P0.4/ AD4

    36 P0.3/ AD3

    37 P0.2/ AD2

    38 P0.1/ AD1

    39 P0.0/ AD0

    40 Supply voltage; 5V (up to 6.6V) Vcc

  • 7/29/2019 FinalReport2 (1)

    19/73

    19

    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)

  • 7/29/2019 FinalReport2 (1)

    20/73

    20

    CHAPTER-5

    GSM MODULE

  • 7/29/2019 FinalReport2 (1)

    21/73

    21

    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.

  • 7/29/2019 FinalReport2 (1)

    22/73

    22

  • 7/29/2019 FinalReport2 (1)

    23/73

    23

  • 7/29/2019 FinalReport2 (1)

    24/73

    24

    CHAPTER-6

    GPS MODULE

  • 7/29/2019 FinalReport2 (1)

    25/73

    25

    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 acquisition

    (not in LS20033)

    LED indicator for GPS fix or not fix (not in LS20033)

  • 7/29/2019 FinalReport2 (1)

    26/73

    26

    6.3 APPLICATION

    o Personal positioning and navigationo Automotive navigationo Marine navigation

    6.4 BLOCK DIAGRAM OF LS20030

    Fig12:LS20030 Block Diagram

  • 7/29/2019 FinalReport2 (1)

    27/73

    27

    CHAPTER-7

    RS232

  • 7/29/2019 FinalReport2 (1)

    28/73

    28

    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

  • 7/29/2019 FinalReport2 (1)

    29/73

    29

    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.

    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.

    RS232 Line Type & Logic Level RS232 Voltage

    TTL Voltage

    to/from

    MAX232

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

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

    Control Signals

    (RTS/CTS/DTR/DSR) Logic 0-3 V to -15 V 5 V

    Control Signals

    (RTS/CTS/DTR/DSR) Logic 1+3 V to +15 V 0 V

    http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/Integrated_circuit
  • 7/29/2019 FinalReport2 (1)

    30/73

    30

    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

    Nbr Name Purpose Signal VoltageCapacitor Value

    MAX232

    1 C1+ + connector forcapacitor C1

    capacitor should stand atleast 16V

    1F

    2 V+ output of voltage pump+10V, capacitor should stand

    at least 16V1F to VCC

    3 C1-- connector for

    capacitor C1

    capacitor should stand at

    least 16V1F

  • 7/29/2019 FinalReport2 (1)

    31/73

    31

    4 C2++ connector for

    capacitor C2

    capacitor should stand at

    least 16V1F

    5 C2- - connector forcapacitor C2

    capacitor should stand atleast 16V

    1F

    6 V-output of voltage pump

    / inverter

    -10V, capacitor should stand

    at least 16V1F to GND

    7 T2out Driver 2 output RS-232

    8 R2in Receiver 2 input RS-232

    9 R2out Receiver 2 output TTL

    10 T2in Driver 2 input TTL

    11 T1in Driver 1 input TTL

    12 R1out Receiver 1 output TTL

    13 R1in Receiver 1 input RS-232

    14 T1out Driver 1 output RS-232

    15 GND Ground 0V 1F to VCC

    16 VCC Power supply +5V see above

    Table3:MAX232 PIN Layout

  • 7/29/2019 FinalReport2 (1)

    32/73

    32

    CHAPTER 8

    LCD MODULE

  • 7/29/2019 FinalReport2 (1)

    33/73

    33

    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 writedata or control to LCD and R/W pin 1 means read data from the LCD. To send a data to

  • 7/29/2019 FinalReport2 (1)

    34/73

    34

    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

  • 7/29/2019 FinalReport2 (1)

    35/73

    35

    CHAPTER 9

    SOFTWARE USED

  • 7/29/2019 FinalReport2 (1)

    36/73

    36

    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 ProjectSelect Device and select a device from Device Database.

    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.

  • 7/29/2019 FinalReport2 (1)

    37/73

    37

    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 chipbeing 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 forTarget 1.Under the Output tab of the resulting options dialog, ensure

    that both the Create Executable and Create HEX File options are checked. Then

    clickOK.

    Next, a file must be added to the project that will contain the project code. To do this,

  • 7/29/2019 FinalReport2 (1)

    38/73

    38

    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 clickAdd. 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 currentposition in the program is indicated by a yellow arrow to the

    left of the code).

  • 7/29/2019 FinalReport2 (1)

    39/73

    39

    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.

  • 7/29/2019 FinalReport2 (1)

    40/73

    40

    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 about more than 400 supported microcontrollers. When you create a new

    Vision3 project and select the target chip from the database, Vision3 sets all assembler,

  • 7/29/2019 FinalReport2 (1)

    41/73

    41

    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 not need any

    special hardware to run it. Programmer comes with window based software for easyprogramming of the devices.

  • 7/29/2019 FinalReport2 (1)

    42/73

    42

    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.

  • 7/29/2019 FinalReport2 (1)

    43/73

    43

    CHAPTER 10

    WORKING

  • 7/29/2019 FinalReport2 (1)

    44/73

    44

    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. A MAX232 IC which is a transceiver,is used for voltage

    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.

  • 7/29/2019 FinalReport2 (1)

    45/73

    45

    10.2 CIRCUIT DIAGRAM

    Fig.19Circuit Diagram Of Vehicle Tracking System

    10.3 SCHEMATIC DESCRIPTION

    The project consists of six sections:

    i. Power Supplyii.

    Microcontroller

    iii. LCD module

  • 7/29/2019 FinalReport2 (1)

    46/73

    46

    iv. MAX232v. GSM module

    vi. GPS module

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

  • 7/29/2019 FinalReport2 (1)

    47/73

    47

    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.

  • 7/29/2019 FinalReport2 (1)

    48/73

    48

    10.3.3LCD 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:

  • 7/29/2019 FinalReport2 (1)

    49/73

    49

    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.

    http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/Integrated_circuit
  • 7/29/2019 FinalReport2 (1)

    50/73

    50

    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.

    MAX232(A) external Capacitors

    Capacitor + Pin - Pin

    C1 1 3

    C2 4 5

    C3 2 16

    C4 GND 6

    C5 16 GND

  • 7/29/2019 FinalReport2 (1)

    51/73

    51

    CHAPTER 11

    PROGRAMMING

  • 7/29/2019 FinalReport2 (1)

    52/73

  • 7/29/2019 FinalReport2 (1)

    53/73

  • 7/29/2019 FinalReport2 (1)

    54/73

    54

    minu();

    delay_m(200);

    delay_m(200);

    lcd_instruction(0x01);

    delay_m(200);

    }

    SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */

    TMOD = 0x21; /* TMOD: timer 1, mode 2, 8-bit reload */

    TH1 = 0xfd; /* TH1: reload value for 9600 */

    TR1 = 1; /* TR1: timer 1 run */

    TI = 1; /* TI: set TI to send first char of UART */

    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();

  • 7/29/2019 FinalReport2 (1)

    55/73

    55

    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 ();

  • 7/29/2019 FinalReport2 (1)

    56/73

    56

    count=0;

    }

    }

    }

    void delay (void)

    {

    unsigned int x,y;

    for (x=0;x

  • 7/29/2019 FinalReport2 (1)

    57/73

    57

    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');

  • 7/29/2019 FinalReport2 (1)

    58/73

  • 7/29/2019 FinalReport2 (1)

    59/73

    59

    {

    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');

  • 7/29/2019 FinalReport2 (1)

    60/73

  • 7/29/2019 FinalReport2 (1)

    61/73

    61

    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();

  • 7/29/2019 FinalReport2 (1)

    62/73

  • 7/29/2019 FinalReport2 (1)

    63/73

    63

    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');

  • 7/29/2019 FinalReport2 (1)

    64/73

    64

    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);

  • 7/29/2019 FinalReport2 (1)

    65/73

    65

    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');

  • 7/29/2019 FinalReport2 (1)

    66/73

    66

    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');

  • 7/29/2019 FinalReport2 (1)

    67/73

    67

    }

    CHAPTER 12

    APPLICATIONS

  • 7/29/2019 FinalReport2 (1)

    68/73

    68

    Resource Tracking + job dispatch

    Fleet management

  • 7/29/2019 FinalReport2 (1)

    69/73

    69

    Child and animal tracking

    Car Tracking and management system

  • 7/29/2019 FinalReport2 (1)

    70/73

    70

    OTHER APPLICATIONS:

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

  • 7/29/2019 FinalReport2 (1)

    71/73

    71

    CHAPTER 13

    FURTHER IMPROVEMENTS

    &

    FUTURE SCOPE

  • 7/29/2019 FinalReport2 (1)

    72/73

    72

    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.

  • 7/29/2019 FinalReport2 (1)

    73/73