preston gps project report

73
PRESTON UNIVERSITY (KARACHI) CERTIFICATE This is to certify that the following students: Name of students Roll No. 1. SYED MASOOD HUSAIN 23D2-211003 2.SYED NAWAID ALI 3.DANISH WAQAR Of FINAL Year B.TECH Course in ELECTRONICS TECHNOLOGY have successfully completed their project work on GPS NAVIGATION . (GPS POSITIONING SYSTEM) In the partial fulfillment of requirement as prescribed by the PRESTON UNIVERSITY, in the year 2011-2012. Prof. MATLOOB Department of ELECTRONICS 1

Upload: engr-syed-masood-husain

Post on 24-Oct-2014

124 views

Category:

Documents


0 download

TRANSCRIPT

PRESTON UNIVERSITY(KARACHI)

CERTIFICATEThis is to certify that the following students: Name of students Roll No.

1. SYED MASOOD HUSAIN 2.SYED NAWAID ALI 3.DANISH WAQAR

23D2-211003

Of FINAL Year B.TECH Course in ELECTRONICS TECHNOLOGY have successfully completed their project work on GPS NAVIGATION.

(GPS POSITIONING SYSTEM)In the partial fulfillment of requirement as prescribed by the PRESTON UNIVERSITY, in the year 2011-2012.

Prof. MATLOOB Department of ELECTRONICS PRESTON UNIVERSITY,(MALIR)

INTERNAL EXAMINER

EXTERNAL EXAMINER 1

ACKNOWLEDGEMENT

Our first experience of project has been successfully, thanks to the support staff of many friends & colleagues with gratitude. We wish to acknowledge all of them. However, we wish to make special mention of the following. First of all we are thankful of our project guide Sir Matloob under whose guideline we were able to complete our project. We are wholeheartedly thankful to him for giving us his value able time & attention & co-operation & assistance in solving technical problems. And thanks to all lab maintenance staff for proving us assistance in various hardware & software problems encountered during course of our project. We are also very thankful to respective principal (NAME) sir who gave us an opportunity to present this project.

Participants

2

INDEXSERIAL NO.

CHAPTER NAME

PAGE NO.

1.

INTRODUCTION Introduction to Project Introduction to GPS Introduction to Circuit Introduction to Languages Programming steps 2. GPS CIRCUIT DESCRIPTION CIRCUIT DIAGRAM C PROGRAM (ON-BOARD) VISUAL BASIC PROGRAM 3. FEASIBILITY Time Feasibility Software Availability Cost Effective 4. FUTURE DEVELOPMENT Application Of Project Future Development Of Project 5. BIBLIOGRAPHY Data sheets 89C51 LCD MAX232 HEX INVERTOR GPS MODULE

5- 19

20- 45

46- 47

48- 49

50- 90

3

4

Chapter 1 INTRODUCTION

5

INTRODUCTION OF PROJECTNEED OF PROJECT

As Pakistan rapidly moving toward evolution of mechanism, So as to meet the basic necessity we needs to travel from one place to another & sometimes to an unknown locations otherwise we get lost. GPS Positioning system is the answer to that.

GPS has endless uses in Clock synchronization, Cellular telephony, Disaster relief/emergency services, Geofencing, Vehicle tracking systems, person tracking systems, Geotagging, GPS Aircraft Tracking, Map-making, Navigation, Robotics etc. GPS is a very necessary device in the field of navigation and positioning.

6

INTRODUCTION TO GPS ( GLOBAL POSTIONING SYSTEM)Global Positioning System The Global Positioning System (GPS) is a space-based satellite navigation system that provides location and time information in all weather, anywhere on or near the Earth, where there is an unobstructed line of sight to four or more GPS satellites. The GPS program provides critical capabilities to military, civil and commercial users around the world. In addition, GPS is the backbone for modernizing the global air traffic system.

7

Basic concept of GPSA 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 satellite position at time of message transmission

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 propagates results in a large positional error. Therefore receivers use four or more satellites to solve for both 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.

8

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

StructureThe current GPS consists of three major segments. These are the space segment (SS), a control segment (CS), and a user segment (US). 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, and tens of millions of civil, commercial, and scientific users of the Standard Positioning Service

9

Space segmentThe space segment (SS) is composed of the orbiting GPS satellites. The GPS design originally called for 24 SVs, six orbital planes with four satellites each. 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 km (12,600 mi); orbital radius of approximately 26,600 km (16,500 mi)

Control segment

The control segment is composed of 1. 2. 3. 4. a master control station (MCS), an alternate master control station, four dedicated ground antennas and six dedicated monitor stations10

User segmentIn general, GPS receivers are composed of an antenna, tuned to the frequencies transmitted by the satellites, receiverprocessors, and a highly stable clock (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, receivers typically have between 12 and 20 channels. Receivers can interface with other devices using methods including a serial connection, USB, or Bluetooth.

ApplicationsGPS 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 applications use one or more of GPS's three basic components: absolute location, relative movement, and time transfer. Some uses are given below: 1) 2) 3) 4) 5) 6) 7) Clock synchronization Cellular telephony Disaster relief/emergency services GPS Aircraft Tracking Navigation Robotics Vehicle tracking systems, person tracking systems etc

11

Satellite frequenciesAll satellites broadcast at the same two frequencies, 1.57542 GHz (L1 signal) and 1.2276 GHz (L2 signal). GPS frequency overview is given below:

12

A visual example of the GPS constellation in motion with the Earth rotating:

GPS STATELLITES AROUND THE EARTH

13

Introduction to LanguagesWe are using two programming languages in this project: 1. Embedded C 2. Visual Basic

C Language: C is an imperative (procedural) systems implementation language. It was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support. C was therefore useful for many applications that had formerly been coded in assembly language.

Despite its low-level capabilities, the language was designed to encourage cross-platform programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with few changes to its source code. The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers. C is one of the most widely used programming languages of all time and there are very few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which began as an extension to C.

14

Visual Basic: Visual Basic (VB) is a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Visual Basic is designed to be relatively easy to learn and use. Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.

A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations. Though the program has received criticism for its perceived faults, from version 3 Visual Basic was a runaway commercial success, and many companies offered third party controls greatly extending its functionality.

The final release was version 6 in 1998. Microsoft's extended support ended in March 2008 and the designated successor was Visual Basic .NET (now known simply as Visual Basic).

15

The Programming Process:

The C language is used to program microcontroller that is 89c51 to display data of GPS on LCD and to transmit data on serial port. Display data includes longitude, latitude, time, altitude( from sea level), number of satellites locked. The acquisition of GPS data is at 1 Hz, while the baud rate is set at 9600.

MICROCONTOLLER PROGRAMMING:

GPS provides a lot of geographical information for a particular object like its latitude, longitude, direction of travel, GMT etc. This information is assembled in a particular string format which is to be decoded by GPS modems. A GPS modem gives the output data in a following string format called as NMEA Format. A common GPS sentence ($GPGGA) has been explained below.

$GPGGA,100156.000,2650.9416,N,07547.8441,E,1,08,1.0,442 .8,M,-42.5,M,,0000*71

1. A string always starts with a $ sign 2. GPGGA : Global Positioning System Fix Data 3. , Comma indicates the separation between two values 4. 100156.000 : GMT time as 10(hr):01(min):56(sec):000(ms)

16

5. 2650.9416,N: Latitude 26(degree) 50(minutes) 9416(sec) North 6. 07547.8441,E: Longitude 075(degree) 47(minutes) 8441(sec) East 7. 1 : Fix Quantity 0= invalid data, 1= valid data, 2=DGPS fix 8. 08 : Number of satellites currently viewed. 9. 1.0: HDOP 10. 442.8,M : Altitude (Height above sea level in meter) 11. -42.5,M : Geoids height

12. __ , DGPS data 13. 0000 : DGPS data 14. *71 : checksum

The main objective here is to find the location of the GPS Receiver in terms of latitude and longitude. The GPS module gives output data in RS232 logic level format. The latitude and longitude data has been displayed on a16x2 LCD interfaced to microcontroller.

Programming steps:

1. Set the baud rate of microcontroller USART to 9600 bps. 2. Enable the SPEN and CREN bits (RCSTA register).

17

3. Receive the Serial data and compare with the string $GPGGA, byte by byte. 4. Wait for comma (,) as string gets matched. 5. Store the data which appears after the above comma into a string which will be the Latitude. 6. After another comma (,), store the data into another string which will be the Longitude. 7. After another comma (,), store the data into another string which will be the Altitude. 8. After another comma (,), store the data into another string which will be the Time. 9. After another comma (,), store the data into another string which will be the Satellite lock. 10. Display Latitude, Longitude, altitude, time and satellite lock data on LCD. 11. Repeat the steps 3 to 9 to update the GPS modules positions on LCD.

WINDOWS PROGRAMING:

While the Visual Basic is used to acquire ( save and compile) GPS data from computers serial port. GPS saved data is formatted in such a way that it can be loaded in GOOGLE EARTH. The GPS data is also displayed on computer screen using GUI ( graphical user interface). Time displayed in 12 hours clock PST format. Google earth is a navigation software use internet connection to display satellite imaginary and maps.

18

The real time data is acquired using this project ( circuit).

Programming steps: 1. Set the baud rate of computer serial port to 9600 bps. 2. Receive the Serial data and compare with the string $GPGGA, byte by byte. 3. Wait for comma (,) as string gets matched. 4. Make GUI for display on computer screen. 5. Time conversation from UTC to PST and in 12 hour clock. 6. Wait for comma (,) as string gets matched. 7. Save the acquired file in notepad as well as Google Earth executable file.

19

Chapter 2 GPS CIRCUIT

20

DESCRIPTION OF GPS CIRCUIT:The GPS module continuously transmits serial data (RS232 protocol) in the form of sentences according to NMEA standards. The latitude and longitude values of the location are contained in the GPGGA sentence (refer NMEA format). In this program, these values are extracted from the GPGGA sentence and are displayed on LCD.

The serial data is taken from the GPS module through MAX232 into the SBUF register of 8051 controller (refer serial interfacing with 8051). The serial data from the GPS receiver is taken by using the Serial Interrupt of the controller. This data consists of a sequence of NMEA sentences from which GPGGA sentence is identified and processed.

The extraction of location values is done as follows. The first six bytes of the data received are compared with the pre-stored ($GPGGA) string and if matched then only data is further accounted for; otherwise the process is repeated again. From the comma delimited GPGGA sentence, latitude and longitude positions are extracted by finding the respective comma positions and extracting the data. The latitude and longitude positions extracted are displayed on the LCD interfaced with AT89C51.

The circuit connections are as follows:

1) Receiver1 (R1) of MAX232 has been used for the serial communication. The receiver pin of GPS module is connected to R1IN (pin13) of MAX232. R1OUT (pin 12) of MAX232 is connected to RxD (P3.0) of AT89C51. 2) Pins 1-3 of port P1 (P1.0, P1.1 & P1.2 respectively) of AT89C51 are connected to the control pins (RS, R/W& EN) of LCD. 3) The data pins of LCD are connected to Port P2 of the controller.

21

4) The latitude and longitude positions are displayed on the LCD.

SUMMERY:GPS has become an efficient tool in the field of scientific use, commerce, surveillance and tracking. This project presents a small application based on Global Positioning System. It depicts the use of GPS module/receiver to find latitude and longitude of its location. The data obtained from GPS receiver (GPGGA sentence) is processed by the microcontroller to extract its latitude and longitude values. The GPS Module has been interfaced with AT89C51 and the location values are displayed on a 16x2 LCD interface.

CIRCUIT DIAGRAM OF GPS POSITIONING CIRCUIT

22

MICROCONTROLLER (8051) PROGRAMING:

#include #define port2 P2 sbit rs = P1^0; sbit rw = P1^1; sbit e = P1^2; char info[70]; char test[6]={"$GPGGA"}; char comma_position[15]; unsigned int check=0,i; unsigned char a; void receive_data(); void lcd_preston(); void lcd_satellite(); void lcd_time(); void lcd_latitude(); void lcd_longitude(); void lcd_altitude();

//DELAY FUNCTION void delay(unsigned int msec) { int i,j ; for(i=0;i