nwwautomatic vehicle control and tracking

53
8/4/2019 Nwwautomatic Vehicle Control and Tracking http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 1/53 AUTOMATIC VEHICLE CONTROL AND TRACKING A PROJECT REPORT  Submitted by PRIYA JOHNSON PRIYANKA MOHAN K REHANA JOSE in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING MG UNIVERSITY : KOTTAYAM MAY 2011

Upload: rehana-jose

Post on 07-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 1/53

AUTOMATIC VEHICLE CONTROL AND

TRACKING

A PROJECT REPORT

 Submitted by

PRIYA JOHNSON

PRIYANKA MOHAN K 

REHANA JOSE

in partial fulfillment for the award of the degree

of 

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS AND COMMUNICATION ENGINEERING

SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING 

MG UNIVERSITY : KOTTAYAM

MAY 2011

Page 2: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 2/53

MG UNIVERSITY: KOTTAYAM

BONAFIDE CERTIFICATE

Certified that this project report “AUTOMATIC VEHICLE CONTROL AND

TRACKING”

is the bonafide work of   “PRIYA JOHNSON,PRIYANKA

MOHAN,REHANA JOSE” who carried out the project work under my

supervision.

<<Signature of the Head of the Department>> <<Signature of theSupervisor>>SIGNATURE SIGNATURE

<<Name>> <<Name>>HEAD OF THE DEPARTMENT SUPERVISOR 

<<Academic Designation>>

<<Department>> <<Department>>

<<Full address of the Dept & College >> <<Full address of the Dept&College >>

Page 3: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 3/53

  ABSTRACT

Automatic vehicle control and tracking is a means for automatically

controlling vehicles for the purpose of safety and for determining the

geographic location of the vehicle and transmitting the information

the requester. Automatic control and tracking is a powerful concept over

vehicles as a security measure. This system helps to send messages while the

vehicle is started, using GSM and can locate the current position of vehicle

using GPS. The controlling and tracking messages are sent through a cell

phone. If the owner itself or somebody whom he knows is starting the

vehicle no actions are taken. On the other hand, If a stranger has started

the car without the awareness of the owner, the owner can send a message

to stop the vehicle via GSM. He can also locate the current position of the

vehicle via GPS. Here we are using PIC as the microcontroller which is

programmed accordingly. This system can also be used to track the

vehicle. Suppose somebody with our consent has taken the vehicle and we

want to know the current location of the vehicle, then send a message, say,

TRACK via GSM from owners cell phone. The PIC will detect the message

and accordingly collect the location details through GPS

and send the same to owner’s cell phone via GSM.

Page 4: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 4/53

TABLE OF CONTENTS 

CHAPTER NO. TITLE PAGE

NO.

ABSTRACT iii

LIST OF TABLE xvi

LIST OF FIGURES xviii

LIST OF SYMBOLS xxvii

1. INTRODUCTION 1

1.1 GENERAL 1

1.2 . . . . . . . . . . . . . 2

1.2.1 General 5

1.2.2 . . . . . . . . . . . 12

1.2.2.1 General 19

1.2.2.2 . . . . . . . . . . 25

1.2.2.3 . . . . . . . . . . 29

1.2.3 . . . . . . . . . . . . 30

1.3 . . . . . . . . . . .. . . . . . . 45

1.4 . . . . . . . . . . . . . . . . . . 58

  2. LITERATURE REVIEW 69

2.1 GENERAL 75

2.2 . . . . . . . . . . 99

2.2 ……………. 100

Page 5: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 5/53

LIST OF TABLES

Page 6: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 6/53

LIST OF FIGURES

Page 7: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 7/53

LIST OF SYMBOL ABBREVIATIONS

Page 8: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 8/53

BLOCK DIAGRAM

EXPLANATION

Page 9: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 9/53

The system consist of mainly four modules. GSM, GPS, PIC and LCD. TheLED in block diagram represents the spark plug of the vehicle. PIC is

 programmed in such a way that when LED is ON (which represents the ignition

of spark plug) a message is sent to the preset number.When supply is given to the LED it gets turned on. This

shows the ignition of spark plug. When this happens a

message “VEHICLE IS TURNED ON” will be sent to a preset

number via GSM from the SIM loaded in the GSM modem.

On receiving this message two actions can be done

• Stop

• Track 

If the vehicle is started by a stranger then the owner can stop thevehicle on receiving the message. This can be done by sending amessage “STOP” to the sim loaded in GSM modem. On receivingthis message the supply to the spark plug is cut off stopping thevehicle. Simultaneously the current location of the vehicle isretrieved from the GPS in the form of latitude and longitude. Thena message “VEHICLE IS TURNED OFF “along with locationdetails will be sent to the preset number.

If we want to track the vehicle then a message “TRACK” is sentto the sim loaded in GSM modem. On receiving this message thecurrent location of the vehicle in the form of latitude andlongitude is retrieved from GPS. This is sent to the preset number.

Here the reception function is done by both GPS and GSM. FromGPS we receive data about the location and from GPS we receivemessages. So at a time either GSM or GPS will be performingreception. A relay is used to switch between these modules whilereception. That is, at a time the relay will connect either GSM or GPS to the PIC.

GSM

Global System for Mobile Communications, or GSM (originally from Groupe

Spécial Mobile), is the world's most popular standard for mobile telephone

systems. The GSM Association estimates that 80% of the global mobile market

Page 10: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 10/53

uses the standard. GSM is used by over 1.5 billion people  across more than 212

countries and territories. This ubiquity means that subscribers can use their 

 phones throughout the world, enabled by international roaming arrangements

 between mobile network operators. GSM differs from its predecessor 

technologies in that both signaling and speech channels are digital, and thus

GSM is considered a second generation (2G) mobile phone system. This also

facilitates the wide-spread implementation of data communication applications

into the system.

The GSM standard has been an advantage to both consumers, who may benefit

from the ability to roam and switch carriers without replacing phones, and also

to network operators, who can choose equipment from many GSM equipment

vendors. GSM also pioneered low-cost implementation of the short message

service (SMS), also called text messaging, which has since been supported on

other mobile phone standards as well. The standard includes a worldwide

emergency telephone number feature (112).

 Newer versions of the standard were backward-compatible with the original

GSM system. For example, Release '97 of the standard added packet data

capabilities by means of General Packet Radio Service (GPRS). Release '99

introduced higher speed data transmission using Enhanced Data Rates for GSM

Evolution (EDGE).

Technical details

GSM is a cellular network, which means that mobile phones connect to it by

searching for cells in the immediate vicinity. There are five different cell sizes in

a GSM network—macro, micro, pico, femto and umbrella cells. The coverage

area of each cell varies according to the implementation environment. Macro

cells can be regarded as cells where the base station antenna is installed on a

mast or a building above average roof top level. Micro cells are cells whose

Page 11: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 11/53

antenna height is under average roof top level; they are typically used in urban

areas. Picocells are small cells whose coverage diameter is a few dozen metres;

they are mainly used indoors. Femtocells are cells designed for use in

residential or small business environments and connect to the service provider’s

network via a broadband internet connection. Umbrella cells are used to cover 

shadowed regions of smaller cells and fill in gaps in coverage between those

cells.

Cell horizontal radius varies depending on antenna height, antenna gain and

 propagation conditions from a couple of hundred meters to several tens of 

kilometres. The longest distance the GSM specification supports in practical use

is 35 kilometres (22 mi). There are also several implementations of the concept

of an extended cell,[11] where the cell radius could be double or even more,

depending on the antenna system, the type of terrain and the timing advance.

Indoor coverage is also supported by GSM and may be achieved by using an

indoor picocell base station, or an indoor repeater with distributed indoor 

antennas fed through power splitters, to deliver the radio signals from an

antenna outdoors to the separate indoor distributed antenna system. These are

typically deployed when a lot of call capacity is needed indoors; for example, in

shopping centers or airports. However, this is not a prerequisite, since indoor 

coverage is also provided by in-building penetration of the radio signals from

any nearby cell.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK), akind of continuous-phase frequency shift keying. In GMSK, the signal to be

modulated onto the carrier is first smoothed with a Gaussian low-pass filter  

 prior to being fed to a frequency modulator , which greatly reduces the

interference to neighboring channels (adjacent-channel interference).

Page 12: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 12/53

GSM carrier frequencies

GSM networks operate in a number of different carrier frequency ranges

(separated into GSM frequency ranges for 2G and UMTS frequency bands for 

3G), with most 2G GSM networks operating in the 900 MHz or 1800 MHz

 bands. Where these bands were already allocated, the 850 MHz and 1900 MHz

 bands were used instead (for example in Canada and the United States). In rare

cases the 400 and 450 MHz frequency bands are assigned in some countries

 because they were previously used for first-generation systems.

Most 3G networks in Europe operate in the 2100 MHz frequency band.

Regardless of the frequency selected by an operator, it is divided into timeslots 

for individual phones to use. This allows eight full-rate or sixteen half-rate

speech channels per radio frequency. These eight radio timeslots (or eight  burst 

 periods) are grouped into a TDMA frame. Half rate channels use alternate

frames in the same timeslot. The channel data rate for all 8 channels is

270.833 kbit/s, and the frame duration is 4.615 ms.

The transmission power in the handset is limited to a maximum of 2 watts in

GSM850/900 and 1 watt in GSM1800/1900.

Voice codecs

GSM has used a variety of voice codecs to squeeze 3.1 kHz audio into between

5.6 and 13 kbit/s. Originally, two codecs, named after the types of data channel

they were allocated, were used, called Half Rate (5.6 kbit/s) and Full Rate 

(13 kbit/s). These used a system based upon linear predictive coding (LPC). In

addition to being efficient with bitrates, these codecs also made it easier to

identify more important parts of the audio, allowing the air interface layer to

 prioritize and better protect these parts of the signal.

GSM was further enhanced in 1997[12] with the Enhanced Full Rate (EFR)

codec, a 12.2 kbit/s codec that uses a full rate channel. Finally, with the

Page 13: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 13/53

development of UMTS, EFR was refactored into a variable-rate codec called

AMR-Narrowband, which is high quality and robust against interference when

used on full rate channels, and less robust but still relatively high quality when

used in good radio conditions on half-rate channels.

 Network structure

The structure of a GSM network 

The network is structured into a number of discrete sections:

• The Base Station Subsystem (the base stations and their controllers).

• the Network and Switching Subsystem (the part of the network most

similar to a fixed network). This is sometimes also just called the core

network.

• The GPRS Core Network (the optional part which allows packet based

Internet connections).

• The Operations support system (OSS) for maintenance of the network.

 Subscriber Identity Module (SIM)

One of the key features of GSM is the Subscriber Identity Module, commonly

known as a SIM card. The SIM is a detachable smart card containing the user's

subscription information and phone book. This allows the user to retain his or 

her information after switching handsets. Alternatively, the user can also change

operators while retaining the handset simply by changing the SIM. Some

operators will block this by allowing the phone to use only a single SIM, or only

a SIM issued by them; this practice is known as SIM locking.

Page 14: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 14/53

Global Positioning System

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

satellite system (GNSS) that provides reliable location and time information in

all weather and at all times and anywhere on or near the Earth when and where

there is an unobstructed line of sight to four or more GPS satellites. It is

maintained by the United States government and is freely accessible by anyone

with a GPS receiver.

The GPS project was developed in 1973 to overcome the limitations of previous

navigation systems,[1] integrating ideas from several predecessors, including a

number of classified engineering design studies from the 1960s. GPS was

created and realized by the U.S. Department of Defense (USDOD) and was

originally run with 24 satellites. It became fully operational in 1994.

In addition to GPS, other systems are in use or under development. The Russian

GLObal NAvigation Satellite System (GLONASS) was in use by the Russian

military only until it was made fully available to civilians in 2007. There are

also the planned Chinese Compass navigation system and the European Union's

Galileo positioning system.

Page 15: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 15/53

Basic concept of GPS 

A GPS receiver calculates its position by precisely timing the signals sent by

GPS satellites high above the Earth. Each satellite continually transmits

messages that include

• the time the message was transmitted

•  precise orbital information (the ephemeris)

• The general system health and rough orbits of all GPS satellites (the

almanac).

The receiver uses the messages it receives to determine the transit time of each

message and computes the distance to each satellite. These distances along with

the satellites' locations are used with the possible aid of trilateration, depending

on which algorithm is used, to compute the position of the receiver. This

 position is then displayed, perhaps with a moving map display or latitude and

longitude; elevation information may be included. Many GPS units show

derived information such as direction and speed, calculated from position

changes.

Three satellites might seem enough to solve for position since space has three

dimensions and a position near the Earth's surface can be assumed. However,

even a very small clock error multiplied by the very large speed of light — the

speed at which satellite signals propagate — results in a large positional error.

Therefore receivers use four or more satellites to solve for the receiver's location

and time. The very accurately computed time is effectively hidden by most GPS

applications, which use only the location. A few specialized GPS applications

do however use the time; these include time transfer , traffic signal timing, and

synchronization of cell phone base stations.

Although four satellites are required for normal operation, fewer apply in

special cases. If one variable is already known, a receiver can determine its

 position using only three satellites. For example, a ship or aircraft may have

Page 16: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 16/53

known elevation. Some GPS receivers may use additional clues or assumptions

(such as reusing the last known altitude, dead reckoning, inertial navigation, or 

including information from the vehicle computer) to give a less accurate

(degraded) position when fewer than four satellites are visible.

Position calculation introduction

To provide an introductory description of how a GPS receiver works, error 

effects are deferred to a later section. Using messages received from a minimum

of four visible satellites, a GPS receiver is able to determine the times sent and

then the satellite positions corresponding to these times sent. The x, y, and z

components of position, and the time sent, are designated as where the subscript

i is the satellite number and has the value 1, 2, 3, or 4. Knowing the indicated,

or uncorrected, time the message was received, the GPS receiver can compute

the uncorrected transit time of the message as . Assuming the message traveled

at the speed of light, c, the uncorrected distance traveled or pseudo range, can

 be computed as .A satellite's position and pseudo range define a sphere, centered on the satellite

with radius equal to the pseudo range. The position of the receiver is somewhere

on the surface of this sphere. Thus with four satellites, the indicated position of 

the GPS receiver is at or near the intersection of the surfaces of four spheres. In

the ideal case of no errors, the GPS receiver would be at a precise intersection

of the four surfaces.If the surfaces of two spheres intersect at more than one point, they intersect in a

circle. The article trilateration shows this mathematically. A figure, Two Sphere

Surfaces Intersecting in a Circle, is shown below. Two points where the

surfaces of the spheres intersect are clearly shown in the figure. The distance

 between these two points is the diameter of the circle of intersection.

Page 17: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 17/53

Two sphere surfaces intersecting in a circle

The intersection of a third spherical surface with the first two will be its

intersection with that circle; in most cases of practical interest, this means they

intersect at two points.[31] Another figure, Surface of Sphere Intersecting a

Circle (not a solid disk) at Two Points, illustrates the intersection. The two

intersections are marked with dots. Again the article trilateration clearly shows

this mathematically.

Surface of sphere intersecting a circle (not a solid disk) at two points

For automobiles and other near-earth vehicles, the correct position of the GPS

receiver is the intersection closest to the Earth's surface. For space vehicles, the

intersection farthest from Earth may be the correct one.

The correct position for the GPS receiver is also the intersection closest to the

surface of the sphere corresponding to the fourth satellite.

Structure

The current GPS consists of three major segments. These are the space segment

(SS), a control segment (CS), and a user segment (U.S.). The U.S. Air Force

develops, maintains, and operates the space and control segments. GPS

satellites broadcast signals from space, and each GPS receiver uses these signals

to calculate its three-dimensional location (latitude, longitude, and altitude) and

the current time.

The space segment is composed of 24 to 32 satellites in medium Earth orbit and

also includes the payload adapters to the boosters required to launch them into

orbit. The control segment is composed of a master control station, an alternate

master control station, and a host of dedicated and shared ground antennas and

monitor stations. The user segment is composed of hundreds of thousands of 

U.S. and allied military users of the secure GPS Precise Positioning Service,

Page 18: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 18/53

and tens of millions of civil, commercial, and scientific users of the Standard

Positioning Service (see GPS navigation devices).

Space segmentThe space segment (SS) is composed of the orbiting GPS satellites or Space

Vehicles (SV) in GPS parlance. The GPS design originally called for 24 SVs,

eight each in three circular orbital planes. But this was modified to six planes

with four satellites each.] The orbital planes are centered on the Earth, not

rotating with respect to the distant stars.] The six planes have approximately 55°

inclination (tilt relative to Earth's equator ) and are separated by 60° right

ascension of the ascending node (angle along the equator from a reference point

to the orbit's intersection). The orbits are arranged so that at least six satellites

are always within line of sight from almost everywhere on Earth's surface. The

result of this objective is that the four satellites are not evenly spaced (90

degrees) apart within each orbit. In general terms, the angular difference

 between satellites in each orbit is 30, 105, 120, and 105 degrees apart which, of course, sum to 360 degrees.

Orbiting at an altitude of approximately 20,200 kilometers (about 12,550 miles

or 10,900 nautical miles; orbital radius of approximately 26,600 km (about

16,500 mi or 14,400 NM)), each SV makes two complete orbits each sidereal

day, repeating the same ground track each day. This was very helpful during

development because even with only four satellites, correct alignment means allfour are visible from one spot for a few hours each day. For military operations,

the ground track repeat can be used to ensure good coverage in combat zones.

As of March 2008, there are 31 actively broadcasting satellites in the GPS

constellation, and two older, retired from active service satellites kept in the

constellation as orbital spares. The additional satellites improve the precision of 

GPS receiver calculations by providing redundant measurements. With the

increased number of satellites, the constellation was changed to a no uniform

Page 19: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 19/53

arrangement. Such an arrangement was shown to improve reliability and

availability of the system, relative to a uniform system, when multiple satellites

fail. About eight satellites are visible from any point on the ground at any one

time (see animation at right).

A visual example of the GPS constellation in motion with the Earth rotating. Notice how the

number of  satellites in view from a given point on the Earth's surface, in this example at 45°N,

changes with time.

Control segment

The control segment is composed of 

1. a master control station (MCS),

2. an alternate master control station,

3. four dedicated ground antennas and

4. six dedicated monitor stations

The MCS can also access U.S. Air Force Satellite Control Network (AFSCN)ground antennas (for additional command and control capability) and NGA

( National Geospatial-Intelligence Agency) monitor stations. The flight paths of 

the satellites are tracked by dedicated U.S. Air Force monitoring stations in

Hawaii, Kwajalein, Ascension Island, Diego Garcia, Colorado Springs,

Colorado and Cape Canaveral, along with shared NGA monitor stations

operated in England, Argentina, Ecuador, Bahrain, Australia and WashingtonDC. The tracking information is sent to the Air Force Space Command's MCS at

Schriever Air Force Base 25 km (16 miles) ESE of Colorado Springs, which is

operated by the 2nd Space Operations Squadron (2 SOPS) of the U.S. Air Force.

Then 2 SOPS contacts each GPS satellite regularly with a navigational update

using dedicated or shared (AFSCN) ground antennas (GPS dedicated ground

antennas are located at Kwajalein, Ascension Island, Diego Garcia, and Cape

Canaveral). These updates synchronize the atomic clocks on board the satellites

Page 20: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 20/53

to within a few nanoseconds of each other, and adjust the ephemeris of each

satellite's internal orbital model. The updates are created by a Kalman filter that

uses inputs from the ground monitoring stations, space weather information, and

various other inputs.

Satellite maneuvers are not precise by GPS standards. So to change the orbit of 

a satellite, the satellite must be marked unhealthy, so receivers will not use it in

their calculation. Then the maneuver can be carried out, and the resulting orbit

tracked from the ground. Then the new ephemeris is uploaded and the satellite

marked healthy again.

User segment

The user segment is composed of hundreds of thousands of U.S. and allied

military users of the secure GPS Precise Positioning Service, and tens of 

millions of civil, commercial and scientific users of the Standard Positioning

Service. In general, GPS receivers are composed of an antenna, tuned to the

frequencies transmitted by the satellites, receiver-processors, and a highly stableclock (often a crystal oscillator ). They may also include a display for providing

location and speed information to the user. A receiver is often described by its

number of channels: this signifies how many satellites it can monitor 

simultaneously. Originally limited to four or five, this has progressively

increased over the years so that, as of 2007, receivers typically have between 12

and 20 channels.

 

GPS receivers may include an input for differential corrections, using the

RTCM SC-104 format. This is typically in the form of an RS-232 port at

4,800 bit/s speed. Data is actually sent at a much lower rate, which limits the

accuracy of the signal sent using RTCM. Receivers with internal DGPS

receivers can outperform those using external RTCM data. As of 2006, even

low-cost units commonly include Wide Area Augmentation System (WAAS)

receivers.

Page 21: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 21/53

Many GPS receivers can relay position data to a PC or other device using the

 NMEA 0183 protocol. Although this protocol is officially defined by the

 National Marine Electronics Association (NMEA), references to this protocol

have been compiled from public records, allowing open source tools like gpsd 

to read the protocol without violating intellectual property laws. Other 

 proprietary protocols exist as well, such as the SiRF and MTK protocols.

Receivers can interface with other devices using methods including a serial

connection, USB, or Bluetooth

A typical GPS receiver with integrated antenna.

 Applications

While originally a military project, GPS is considered a dual-use technology,

meaning it has significant military and civilian applications.

GPS has become a widely deployed and useful tool for commerce, scientific

uses, tracking, and surveillance. GPS's accurate time facilitates everyday

activities such as banking, mobile phone operations, and even the control of 

 power grids by allowing well synchronized hand-off switching.

Civilian

This antenna is mounted on the roof of a hut containing a scientific experiment needing precise

timing.

Many civilian applications use one or more of GPS's three basic components:

absolute location, relative movement, and time transfer.

Page 22: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 22/53

• Cellular telephony: Clock synchronization enables time transfer, which is

critical for synchronizing its spreading codes with other base stations to

facilitate inter-cell handoff and support hybrid GPS/cellular position

detection for mobile emergency calls and other applications. The first

handsets with integrated GPS launched in the late 1990s. The U.S.

Federal Communications Commission (FCC) mandated the feature in

either the handset or in the towers (for use in triangulation) in 2002 so

emergency services could locate 911 callers. Third-party software

developers later gained access to GPS APIs from  Nextel upon launch,

followed by Sprint in 2006, and Verizon soon thereafter.

• Disaster relief /emergency services: Depend upon GPS for location and

timing capabilities.

• Geofencing: Vehicle tracking systems, person tracking systems, and pet

tracking systems use GPS to locate a vehicle, person, or pet. These

devices are attached to the vehicle, person, or the pet collar. The

application provides continuous tracking and mobile or Internet updates

should the target leave a designated area.[47]

• Geotagging: Applying location coordinates to digital objects such as

 photographs and other documents for purposes such as creating map

overlays.

• GPS Aircraft Tracking

• GPS tours: Location determines what content to display; for instance,

information about an approaching point of interest.

• Map-making: Both civilian and military cartographers use GPS

extensively.

•  Navigation: Navigators value digitally precise velocity and orientation

measurements.

Page 23: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 23/53

• Phasor measurement units: GPS enables highly accurate timestamping of 

 power system measurements, making it possible to compute phasors.

• Recreation: For example, geocaching, geodashing, GPS drawing and

waymarking.

• Surveying: Surveyors use absolute locations to make maps and determine

 property boundaries.

• Tectonics: GPS enables direct fault motion measurement in earthquakes.

Military

As of 2009, military applications of GPS include:•  Navigation: GPS allows soldiers to find objectives, even in the dark or in

unfamiliar territory, and to coordinate troop and supply movement. In the

United States armed forces, commanders use the Commanders Digital 

 Assistant and lower ranks use the Soldier Digital Assistant .

• Target tracking: Various military weapons systems use GPS to track 

 potential ground and air targets before flagging them as hostile.[citation needed ]

These weapon systems pass target coordinates to precision-guided

munitions to allow them to engage targets accurately. Military aircraft,

 particularly in air-to-ground roles, use GPS to find targets (for example,

gun camera video from AH-1 Cobras in Iraq show GPS co-ordinates that

can be viewed with special software.)

Missile and projectile guidance: GPS allows accurate targeting of variousmilitary weapons including ICBMs, cruise missiles and precision-guided

munitions. Artillery  projectiles. Embedded GPS receivers able to

withstand accelerations of 12,000 g or about 118 km/s2 have been

developed for use in 155 millimeters (6.1 in) howitzers.

• Search and Rescue: Downed pilots can be located faster if their position

is known.

• Reconnaissance: Patrol movement can be managed more closely.

Page 24: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 24/53

GPS satellites carry a set of nuclear detonation detectors consisting of an optical

sensor (Y-sensor), an X-ray sensor, a dosimeter, and an electromagnetic pulse

(EMP) sensor (W-sensor), that form a major portion of the United States

 Nuclear Detonation Detection System

Communication

The navigational signals transmitted by GPS satellites encode a variety of 

information including satellite positions, the state of the internal clocks, and the

health of the network. These signals are transmitted on two separate carrier 

frequencies that are common to all satellites in the network. Two different

encodings are used, a public encoding that enables lower resolution navigation,

and an encrypted encoding used by the U.S. military.

Message format

GPS message

format

Subframes Description

1Satellite clock,

GPS time relationship

2–3Ephemeris

(precise satellite orbit)

4–5

Almanac component

(satellite network synopsis,

error correction)

Each GPS satellite continuously broadcasts a navigation message at a rate of 50

 bits per second (see bitrate). Each complete message is composed of 30-second

frames, distinct groupings of 1,500 bits of information. Each frame is further 

subdivided into 5 subframes of length 6 seconds and with 300 bits each. Each

Page 25: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 25/53

subframe contains 10 words of 30 bits with length 0.6 seconds each. Each

30 second frame begins precisely on the minute or half minute as indicated by

the atomic clock on each satellite.

The first part of the message encodes the week number and the time within the

week, as well as the data about the health of the satellite. The second part of the

message, the ephemeris, provides the precise orbit for the satellite. The last part

of the message, the almanac, contains coarse orbit and status information for all

satellites in the network as well as data related to error correction.

All satellites broadcast at the same frequencies. Signals are encoded using code

division multiple access (CDMA) allowing messages from individual satellites

to be distinguished from each other based on unique encodings for each satellite

(that the receiver must be aware of). Two distinct types of CDMA encodings are

used: the coarse/acquisition (C/A) code, which is accessible by the general

 public, and the precise (P) code, that is encrypted so that only the U.S. military

can access it.

The ephemeris is updated every 2 hours and is generally valid for 4 hours, with

 provisions for updates every 6 hours or longer in non-nominal conditions. The

almanac is updated typically every 24 hours. Additionally data for a few weeks

following is uploaded in case of transmission updates that delay data upload.

Satellite frequencies

GPS frequency

overview

Band Frequency Description

L1 1575.42 MHz

Course-acquisition (C/A) and encrypted

 precision P(Y) codes, plus the L1

civilian (L1C) and military (M) codes on

future Block III satellites.

L2 1227.60 MHz P(Y) code, plus the L2C and military

Page 26: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 26/53

codes on the Block IIR-M and newer 

satellites.

L3 1381.05 MHz

Used for nuclear detonation (NUDET)

detection.

L4 1379.913 MHzBeing studied for additional ionospheric

correction.

L5 1176.45 MHzProposed for use as a civilian safety-of-

life (SoL) signal.

All satellites broadcast at the same two frequencies, 1.57542 GHz (L1 signal)

and 1.2276 GHz (L2 signal). The satellite network uses a CDMA spread-

spectrum technique where the low-bitrate message data is encoded with a high-

rate pseudo-random (PRN) sequence that is different for each satellite. The

receiver must be aware of the PRN codes for each satellite to reconstruct the

actual message data. The C/A code, for civilian use, transmits data at

1.023 million chips per second, whereas the P code, for U.S. military use,

transmits at 10.23 million chips per second. The L1 carrier is modulated by both

the C/A and P codes, while the L2 carrier is only modulated by the P code. The

P code can be encrypted as a so-called P(Y) code that is only available to

military equipment with a proper decryption key. Both the C/A and P(Y) codes

impart the precise time-of-day to the user.

The L3 signal at a frequency of 1.38105 GHz is used by the United States

 Nuclear Detonation (NUDET) Detection System (USNDS) to detect, locate, and

report nuclear detonations (NUDETs) in the Earth's atmosphere and near space.

One usage is the enforcement of nuclear test ban treaties.

The L4 band at 1.379913 GHz is being studied for additional ionospheric

correction.

The L5 frequency band at 1.17645 GHZ was added in the process of GPS

modernization. This frequency falls into an internationally protected range for 

Page 27: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 27/53

aeronautical navigation, promising little or no interference under all

circumstances. The first Block IIF satellite that would provide this signal is set

to be launched in 2009. The L5 consists of two carrier components that are in

 phase quadrature with each other. Each carrier component is bi-phase shift key

(BPSK) modulated by a separate bit train.

A waiver has recently been granted to LightSquared to operate a terrestrial

 broadband service in the L1 band. There is some concern that this will seriously

degrade the GPS signal for many consumer uses.

Demodulation and decoding

Demodulating and Decoding GPS Satellite Signals using the Coarse/Acquisition Gold code.

Because all of the satellite signals are modulated onto the same L1 carrier 

frequency, the signals must be separated after demodulation. This is done by

assigning each satellite a unique binary sequence known as a Gold code. The

signals are decoded after demodulation using addition of the Gold codes

corresponding to the satellites monitored by the receiver.

If the almanac information has previously been acquired, the receiver picks the

satellites to listen for by their PRNs, unique numbers in the range 1 through 32.

If the almanac information is not in memory, the receiver enters a search mode

until a lock is obtained on one of the satellites. To obtain a lock, it is necessarythat there be an unobstructed line of sight from the receiver to the satellite. The

receiver can then acquire the almanac and determine the satellites it should

listen for. As it detects each satellite's signal, it identifies it by its distinct

C/A code pattern. There can be a delay of up to 30 seconds before the first

estimate of position because of the need to read the ephemeris data.

Page 28: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 28/53

Processing of the navigation message enables the determination of the time of 

transmission and the satellite position at this time. For more information see

Demodulation and Decoding, Advanced.

  PROGRAM

ALGORITHM

1.LCD is initialized.

2.project name is diplayed on LCD.

3.USART is initialized.

4.GSM is initialized and is displayed on LCD.5.Supply is given to LED (RC3=1).

6.Message “vehicle is on” is send to a mobile number.And is also diplayed on

LCD.

7.Received message is saved.

8.If the message is “track”, “tracking…..” is displayed on LCD.

9.Latitude and longitude of position is sent to mobile and is also displayed on

LCD.

10.IF the message is “stop”,supply to LED is cut off.

11.A message “vehicle engine is turned off ” is sent to mobile and is also

displayed on LCD.

12.Also the location is sent to mobile and is displayed on LCD.

13.IF any other messages,a message “wrong command ” is sent to mobile and

is also displayed on LCD.

Page 29: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 29/53

PROGRAM

#include"pic.h"#include"delay.h"#include"usart.h"#include"gsmreceive.h"#include"gsmsend.h"#include"lcd_4.h"

void flags(void);void read(void);void check();char nn,q,t;unsigned char bank1 inbox[10];unsigned char bank1 recmob[14];char bank1 pp;char jj;

void main(){char a,b,c,i,d;

TRISC0=0;TRISC2=1;TRISC3=0;RC0=0;RC2=0;

RC3=0;lcd_init();cmdwrt(0x01);cmdwrt(0x80);LCD_string("VEHICLE TRACKING");usart_init();gsm_init();cmdwrt(0x01);cmdwrt(0x80);

LCD_string("GSM INITIALIZED");DelayMs(250);

Page 30: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 30/53

DelayMs(250);DelayMs(250);DelayMs(250);DelayMs(250);

DelayMs(250);DelayMs(250);DelayMs(250);DelayMs(250);DelayMs(250);

while(RC2==0);

RC3=1;

cmdwrt(0xC0);

LCD_string(" VEHICLE IS ON ");

 

usart_string("AT+CMGS=\"+9495302630\"");

usart_trx(0x0D); 

DelayMs(5);

usart_trx(0x0A); 

DelayMs(50); 

usart_string("Vehicle is turned ON!!"); 

usart_trx(0x0D); 

DelayMs(5);

Page 31: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 31/53

usart_trx(0x1A); 

DelayMs(50);

usart_trx(0x0D);

 DelayMs(5);

usart_trx(0x0A); 

DelayMs(50);

 gsm_init();

 

while(1){

cmdwrt(0x01);

cmdwrt(0x80);

LCD_string("VEHICLE TRACKING");

cmdwrt(0xC0);

LCD_string(" WELCOME "); 

mess_recv();

Page 32: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 32/53

for(i=0;i<10;i++) inbox[i]=0;

for(i=0;i<14;i++) recmob[i]=0;

}}

Delay fn

#include

"delay.h"

voidDelayMs(unsigned char cnt){#if XTAL_FREQ <= 2MHZ

do {

DelayUs(996);

} while(--cnt);#endif 

#if XTAL_FREQ > 2MHZ

unsigned char i;

do {

i = 4;

do {

DelayUs(250);

} while(--i);

Page 33: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 33/53

} while(--cnt);#endif }

GPS

#include"pic.h"#include"delay.h"#include"usart.h"#include"gps.h"#include"lcd_4.h"

char day1;char day2;char mon1;char mon2;char yer1;char yer2;char hr1;char hr2;char min1;

char min2;

void gps(){char aa,bb,cc,i;char mm;

 cmdwrt(0xC0);

LCD_string(" TRACKING.... ");RC0=1;DelayMs(250);BAUD_RATE=0x33;DelayMs(250);

 while (usart_rx()!='$');

Page 34: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 34/53

 while (usart_rx()!='G');

while (usart_rx()!='P'); while (usart_rx()!='R'); while (usart_rx()!='M'); while (usart_rx()!='C'); mm=usart_rx();

hr1=usart_rx();hr2=usart_rx();

min1=usart_rx();min2=usart_rx();

mm=usart_rx();mm=usart_rx();for(aa=0;aa<5;aa++){mm=usart_rx();}

while (usart_rx()!='A');

mm=usart_rx(); for(aa=0;aa<11;aa++)

{latitude[aa]=usart_rx();

}

mm=usart_rx(); 

for(bb=0;bb<12;bb++){longitude[bb]=usart_rx();

}

for(aa=0;aa<=11;aa++)

{

Page 35: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 35/53

mm=usart_rx();

}

day1=usart_rx();day2=usart_rx();mon1=usart_rx();mon2=usart_rx();yer1=usart_rx();yer2=usart_rx();RC0=0;

DelayMs(250);

cmdwrt(0x01);cmdwrt(0x80);LCD_string("LATTITUDE IS:");

cmdwrt(0xC0);

for(aa=0;aa<11;aa++){datwrt(latitude[aa]);

}for(i=0;i<10;i++){DelayMs(250);}cmdwrt(0x01);cmdwrt(0x80);LCD_string("LONGITUDE IS:");

cmdwrt(0xC0);

for(bb=0;bb<11;bb++){datwrt(longitude[bb]);

}DelayMs(250);

BAUD_RATE=0x19;DelayMs(250);

Page 36: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 36/53

}

LCD

#include"pic.h"#include"delay.h"#include"lcd_4.h"

void lcd_init(){

unsigned char TRISB=0x00;

TRISA=0X00;

ADCON1=0x07;

cmdwrt(0x28);

cmdwrt(0x28);

cmdwrt(0x28);

cmdwrt(0x06);

cmdwrt(0x0F);

cmdwrt(0x01);

cmdwrt(0x80);return;

}

void cmdwrt(char a){

char c;

c=a;

Page 37: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 37/53

a=(a&0xF0)>>4;

PORTB=a;

RA0=0;

RA1=0;

RA2=1;

DelayUs(5);

RA2=0;

DelayUs(1);

a=(c&0x0F);

PORTB=a;

RA0=0;

RA1=0;

RA2=1;

DelayUs(5);

RA2=0;

DelayMs(10);return;

}

void datwrt(char b){

char c;

c=b;

Page 38: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 38/53

 b=(b&0xF0)>>4;

PORTB=b;

RA0=1;

RA1=0;

RA2=1;

DelayUs(10);

RA2=0;

DelayUs(1);

 b=(c&0x0F);

PORTB=b;

RA0=1;

RA1=0;

RA2=1;

DelayUs(10);

RA2=0;

DelayMs(10);return;

}

void LCD_string(const char *DATA){while(*DATA){

datwrt(*DATA);DATA++;

Page 39: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 39/53

}

GSM receive

#include"pic.h"#include"delay.h"#include"usart.h"#include"gsmreceive.h"#include"gsmsend.h"#include"string.h"#include"gps.h"#include"lcd_4.h"

void DELAY();extern unsigned char bank1 inbox[10];extern unsigned char bank1 recmob[14];char bank1 latitude[11];char bank1 longitude[12];

char mess_recv(){

int j=0;

unsigned int i,k;

unsigned char l,sp1,sp2,val,x,qq;

cmdwrt(0xC0);

LCD_string(" MESSAGE ");while(usart_rx()!='+');

while(usart_rx()!='C');

while(usart_rx()!='M');

while(usart_rx()!='T');

while(usart_rx()!='I');

while(usart_rx()!=',');

Page 40: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 40/53

qq=usart_rx();

//MSG INDEX

usart_string("AT+CMGR=1");

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);

while(usart_rx()!='+');

while(usart_rx()!='C');

while(usart_rx()!='M');

while(usart_rx()!='G');

while(usart_rx()!='R');

while(usart_rx()!=',');x=usart_rx();

while(1)

{

x=usart_rx();

if(x=='"') 

 break;

Page 41: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 41/53

else 

recmob[j]=x; 

 j++; 

continue; 

}

 

 break;

}

 j=0;

while(usart_rx()!=0x0D);

 x=usart_rx();

while(1){

x=usart_rx();if(x==0x0D)

 break;else

 {

 inbox[j]=x;

  j++;

 

continue;

Page 42: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 42/53

 

 break;}x=usart_rx(); cmdwrt(0xC0);

LCD_string(" MSG RECEIVED ");DELAY();cmdwrt(0xC0);LCD_string(" ");

cmdwrt(0xC0);LCD_string("MSG=");for(i=0;inbox[i]!='\0';i++)

{

datwrt(inbox[i]);}

DELAY();if(strcmp(inbox,"track")==0)

 {//

 cmdwrt(0xC0);//

LCD_string(" TRACKING.... ");gps();

usart_string("AT+CMGS=\"");

 for(i=0;recmob[i]!='\0';i++)

{usart_trx(recmob[i]);

DelayMs(50);

Page 43: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 43/53

}usart_string("\"");usart_trx(0x0D);

DelayMs(5);

usart_trx(0x0A);DelayMs(50);usart_string("Vehicle Tracked!!, Location:-");usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);DelayMs(100);

 for(i=0;i<11;i++)

 {usart_trx(latitude[i]);

DelayMs(50);}

for(i=0;i<12;i++){

usart_trx(longitude[i]);DelayMs(50);

}

 usart_trx(0x0D);

DelayMs(5);usart_trx(0x1A);

DelayMs(50);usart_trx(0x0D);

DelayMs(5);usart_trx(0x0A);

while(usart_rx()!='O');

while(usart_rx()!='K'); 

usart_string("AT+CMGD=1");usart_trx(0X0D);DelayMs(5);usart_trx(0X0A);DELAY();

}else if(strcmp(inbox,"stop")==0)

Page 44: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 44/53

cmdwrt(0x01); 

cmdwrt(0x80); 

LCD_string("WARNING!!!"); 

cmdwrt(0xC0); 

LCD_string("ENGINE HALTED!!"); 

RC3=0;

 gps();usart_string("AT+CMGS=\"");

 for(i=0;recmob[i]!='\0';i++){usart_trx(recmob[i]);

DelayMs(50);}

 

usart_string("\""); 

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);DelayMs(50);usart_string("Location:- ");usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);DelayMs(100);

for(i=0;i<11;i++){

usart_trx(latitude[i]);DelayMs(50);

for(i=0;i<12;i++)

 

Page 45: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 45/53

{usart_trx(longitude[i]);

DelayMs(50);

 }

usart_string(" VEHICLE ENGINE TURNED OFF");usart_trx(0x0D);

DelayMs(5);

usart_trx(0x1A);

DelayMs(50);usart_trx(0x0D);

DelayMs(5);

usart_trx(0x0A);while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(50);

usart_string("AT+CMGD=1");

usart_trx(0X0D);DelayMs(5);usart_trx(0X0A);DELAY();

while(1);}

else{

 

cmdwrt(0xC0);LCD_string("wrong command!!");usart_string("AT+CMGS=\"");

 for(i=0;recmob[i]!='\0';i++){usart_trx(recmob[i]);

DelayMs(50);}

usart_string("\"");usart_trx(0x0D);

Page 46: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 46/53

DelayMs(5);usart_trx(0x0A);

DelayMs(50);usart_string("Wrong Command!!");

usart_trx(0x0D);DelayMs(5);

usart_trx(0x1A);DelayMs(50);

usart_trx(0x0D);

DelayMs(5);usart_trx(0x0A);

while(usart_rx()!='O');

while(usart_rx()!='K');DelayMs(50);usart_string("AT+CMGD=1");usart_trx(0X0D);DelayMs(5);usart_trx(0X0A);DELAY();

}cmdwrt(0xC0);LCD_string(" MSG SENT ");

for(i=0;i<12;i++)DelayMs(250);

}void DELAY(){int xxxx;for(xxxx=0;xxxx<32;xxxx++){DelayMs(250);

}}

GSM send#include"pic.h"#include"delay.h"#include"usart.h"

#include"gsmsend.h"#include"gps.h"

Page 47: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 47/53

extern char bank1 latitude[11];extern char bank1 longitude[12];void gsm_init()

//GSM Initialisation{

int ccc;

usart_string("AT");

usart_trx(0x0D);

DelayMs(5);

usart_trx(0x0A); DelayMs(100); 

usart_string("AT");

usart_trx(0x0D);

DelayMs(5);

usart_trx(0x0A);while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

usart_string("AT");

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

usart_string("AT+CMGF=1");

Page 48: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 48/53

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);

while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

usart_string("AT+CMGD=1");

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

usart_string("AT+CMGD=2");

usart_trx(0x0D);

DelayMs(5);

usart_trx(0x0A);

while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

usart_string("AT+CMGD=3");

usart_trx(0x0D);DelayMs(5);

usart_trx(0x0A);while(usart_rx()!='O');while(usart_rx()!='K');DelayMs(100);

Page 49: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 49/53

for(ccc=0;ccc<=8;ccc++)

{

DelayMs(250);

}return;}

USART

#include"pic.h"#include"delay.h"#include"usart.h"char e;unsigned int i;/*USART Initialisation*/void usart_init(){TRANSMIT_PIN=CLEAR;RECEIVE_PIN=SET;

BAUD_TYPE=SET;BAUD_RATE=0x19;SERIAL_PORT=SET;RECEIVE_ENABLE=SET;TRANSMIT_ENABLE=SET;}

/* USART transmission function*/

void usart_trx( char xx){TRANSMIT_REGISTER=xx;while(TRANSMIT_FLAG==CLEAR);}

void usart_string(const char *DATA){

Page 50: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 50/53

while(*DATA){TRANSMIT_REGISTER=*DATA;while(TRANSMIT_FLAG==CLEAR);

DelayMs(50);DATA++;}return;}

/*USART reception function*/

char usart_rx(){char yy;if(OVER_RUN==1){OVER_RUN=CLEAR;RECEIVE_ENABLE=CLEAR;DelayUs(5);

RECEIVE_ENABLE=SET;}while(RECEIVE_FLAG==CLEAR);yy=RECEIVE_REGISTER;return yy;}

Page 51: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 51/53

Page 52: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 52/53

Page 53: Nwwautomatic Vehicle Control and Tracking

8/4/2019 Nwwautomatic Vehicle Control and Tracking

http://slidepdf.com/reader/full/nwwautomatic-vehicle-control-and-tracking 53/53