55

TITLE PAGE

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING

PULCHOWK CAMPUS

GPS GSM Integration for Enhancing Public Transportation System

By:

Anil Gaihre

Basanta Chalise

Binod Basnet

Subash Sharma

A PROJECT WAS SUBMITTED TO THE DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING IN PARTIAL FULLFILLMENT OF THE REQUIREMENT FOR THE BACHELOR’S DEGREE IN ELECTRONICS & COMMUNICATION / COMPUTER ENGINEERING

DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING

LALITPUR, NEPAL

AUGUST, 2013

LETTER OF APPROVAL

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING

PULCHOWK CAMPUS

DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING

The undersigned certify that they have read, and recommended to the Institute of Engineering for acceptance, a project report entitled "Title of the Project" submitted by Name of Student(s) in partial fulfillment of the requirements for the Bachelor’s degree in Electronics & Communication / Computer Engineering.

______

Daya Sagar Baral

Lecturer

Department of Electronics and Computer Engineering

______

Sanjeev Prasad Pandey

Lecturer

Department of Electronics and Computer Engineering

______

External Examiner, name of External

Title

Name of the Organization, he belongs to

------

Coordinator, Name of Coordinator

Title

Name of the coordinating committee

DATE OF APPROVAL: Day.Month.Year

55

COPYRIGHT

55

The author has agreed that the Library, Department of Electronics and Computer Engineering, Pulchowk Campus, Institute of Engineering may make this report freely available for inspection. Moreover, the author has agreed that permission for extensive copying of this project report for scholarly purpose may be granted by the supervisors who supervised the project work recorded herein or, in their absence, by the Head of the Department wherein the project report was done. It is understood that the recognition will be given to the author of this report and to the Department of Electronics and Computer Engineering, Pulchowk Campus, Institute of Engineering in any use of the material of this project report. Copying or publication or the other use of this report for financial gain without approval of to the Department of Electronics and Computer Engineering, Pulchowk Campus, Institute of Engineering and author’s written permission is prohibited. Request for permission to copy or to make any other use of the material in this report in whole or in part should be addressed to:

Prof. Dr Arun Timilsena

Head

Department of Electronics and Computer Engineering

Pulchowk Campus

ACKNOWLEDGEMENT

This project is the result of dedication and encouragement of many individuals. Our sincere and heartfelt appreciation goes to all of them.

We would like to express our hearty gratitude to the Department Of Electronics and Computer Engineering, Pulchowk campus for providing us with the opportunity to do this project and thereby visualize our theoretical knowledge to design some real time system.

We are thankful to Prof. Dr. Arun Timilsena, Head of Department, Department of Electronics and computer Engineering for availing us with resources and continuous support that helped us to carry out the project with ease.

We must acknowledge our obligation to our Project Coordinator, Dr. Aman Shakya deputy head Department of Electronics and computer Engineering for his considerations and suggestions throughout the project.

We owe our debt of gratitude to our Project Supervisor Mr. Daya Sagar Baral for supervising our task and constantly motivating us with ideas regarding the project starting from the time of its inception.

Thanks are due to Prof. Dr. Nanda Bikram Adhikari for his valuable support and ideas regarding the project. He has motivated us a lot in the course of this project.

Last but not the least, we are obliged to everyone who have suggested and supported us in course of our project from the start to the end.

ABSTRACT

The project “GPS GSM Integration For Enhancing Public Transportation System” is an attempt to design a tracking unit that uses the global positioning system to determine the precise location of a vehicle and through GSM modem the vehicle location is transmitted to remote user. This system contains single-board embedded system that is equipped with GPS and GSM modems along with processor. During vehicular motion, its location can be reported by accessing a website. The website maintained has the vehicular information in its database. Information from the GSM to the website is send via SMS. The location of the vehicle is traced in Google map which users can obtain through their mobile phones with internet accessibility. Similarly, at the station the audio information about the status of the bus is broadcasted along with displaying it on the LCD which helps passenger at the station to know the status of their vehicle and helps the visually impaired person to board the bus.

The use of GSM and GPS technologies allows the system to keep trace of vehicle and provides the updated information about ongoing trips. This system finds its application in real time traffic surveillance and can be effective in case of city like Kathmandu where traffic congestion is often a situation. The system aims to help people to board the vehicle they intend to travel in time.

TABLE OF CONTENTS

TITLE PAGE i

LETTER OF APPROVAL ii

COPYRIGHT i

ACKNOWLEDGEMENT ii

ABSTRACT iii

TABLE OF CONTENTS iv

LIST OF FIGURE vii

LIST OF TABLES viii

LIST OF ABBREVIATIONS ix

1. INTRODUCTION 1

1.1. Background 1

1.1.1. Background Research 1

1.2. Objectives 2

1.3. Methodology 3

2. LITERATURE REVIEW 4

3. COMPONENTS AND TECHNIQUES 6

3.1. Global Positioning System 6

3.1.1. Structure 6

3.1.2. GPS Operation 8

3.1.3. Triangulation 9

3.1.4. GPS Frequency 10

3.1.5. GPS Standard Format 10

3.1.6. The NMEA 0183 11

3.2. Global System for Mobile Communication 12

3.2.1. GSM Network Structure 12

3.2.2. GSM carrier frequencies 14

3.2.3. Subscriber Identity Module 14

3.2.4. GSM Data Transmission 14

3.2.5. Message size 15

3.2.6. AT commands 16

3.3. Value Added Service Provider 16

3.3.1. Sparrow SMS 16

3.4. Serial Data Transmission 17

3.5. Asynchronous Serial Data Transmission 17

3.5.1. UART 18

3.6. Microcontroller 18

3.7. Liquid Crystal Display 19

3.8. Multimedia Card 19

3.9. FAT16 20

3.10. LM386 21

3.11. Local Host 23

3.12. Server 23

3.13. HTTP (Hyper Text Transfer Protocol) 24

3.14. Scripting Language 24

3.15. Database management systems (DBMSs) 24

3.16. FTP/FTP Client 25

3.17. Domain Name 25

3.18. Web Hosting 27

3.19. APIs’ 27

4. PROJECT OVERVIEW 28

4.1. System Block Diagram 28

4.1.1. Embedded System in Vehicle 29

4.1.2. Web Server 31

4.1.3. Embedded System at Station 33

5. Methodology 35

5.1. Hardware Implementation 35

5.1.1. Liquid Crystal Display 35

5.1.2. GPS 37

5.1.3. GSM 40

6. Software Implementation 43

6.1. Apache (2.2.19) Server 43

6.1. 43

6.2. My SQL(5.1) 43

6.3. FileZilla (3.7.3) 44

6.4. XAMPP (1.7.4) 44

6.5. Web Hosting Service Provider (000webhost.com) 44

6.5.1. Domain Name (.net78.net) 44

6.6. HTML 45

6.7. PHP 5.3.5 45

6.8. JavaScript 46

6.9. APIs’ 46

6.9.1. Google Maps API for embedding Google map in the webpage 46

6.9.2. Outgoing API –Sparrow SMS Service (VASP API) 49

6.9.3. Incoming API –Sparrow SMS Service (VASP API) 49

7. APPLICATION 51

8. PROBLEM FACED 52

9. LIMITATION AND FUTURE ENHANCEMENT 53

10. CONCLUSION 54

11. REFRENCES 55

12. APPENDIX 56

LIST OF FIGURE

Figure 3.1: Orientation of GPS Satellites in Space (Source: Wikipedia) 7

Figure 3.2: GSM Network Structure 13

Figure 3.3: Pin Diagram for LM386 21

Figure 4.1: System Block Diagram 28

Figure 4.2: Flow Diagram of system in the vehicle 30

Figure 4.3: Flow Diagram of various API for subscription and sending of message 32

Figure 4.4: Flow Diagram of system at the station 34

Figure 5.3: Basic Diagram for Interfacing LCD in 4 bit mode with Microcontroller 37

LIST OF TABLES

Table 3.1: GGA data format 12

Table 3.2: Pin Description of MMC 20

Table 3.3: Capacity of Sector and Cluster in Fat 16 21

Table 5.1: Pin out function for LCD LM016L 35

Table 5.2: Command Control Code 36

LIST OF ABBREVIATIONS

1G: First Generation

2G: Second Generation

ADC: Analog Digital Converter

API: Application Programming Interface

AT: Attention

BSS: Base Station Subsystem

CPU: Central Processing Unit

CS: Control segment

CSS: Cascading Style Sheets

DUART : Dual Universal Asynchronous Receiver/Transmitter

EDGE : Enhanced Data rates for GSM Evolution

EEPROM : Electrically Erasable Programmable Read Only Memory

ETSI : European Telecommunications Standards Institute

FIFO : First In First Out

GLONASS : Global Navigation Satellite System

GND : Ground

GPRS : General Packet Radio Services

GPS : Global Positioning System

GSM : Global System of Mobile Communication

HTML: Hyper Text Markup Language

ID : Identification

IDE : Integrated Development Environment

IMSI : International Mobile Subscriber Identity

LCD : Liquid Crystal Display

LED : Light Emitting Display

LVTTL : Low Voltage Transistor Transistor Logic

MAP : Mobile Application Part

MCS : Master Control Station

MO : Mobile Originating

MT: Mobile Terminated

OCS : Operation Control Segment

OEM : Original Equipment Manufacturer

OSS : Operations Support System

OTP ROM : One Time Programmable Read Only Memory

PHP: Personal Home Page/Hypertext Preprocessor

PIN: Personal Identification Number

PSTN : Public Switched Telephone Network

PWM : Pulse Width Modulation

PUK: Personal Unblocking

RAM : Random Access Memory

RD : Receive

RDBMS: Relational Database Management System

RF : Radio Frequency

RISC : Reduced Instruction Set Computer

ROM : Read Only Memory

SBS : Smart Bus System

SIM : Subscriber Identity/ Identification Module

SMS : Short Message Service

SMSC : Short Message Service Centre

SMS-CB : Short Message Service Cell Broadcast

SMS-PP : Short Message Service Point to Point

SRAM : Static Random Access Memory

SS : Space segment

SV : Space Vehicles

TD: Transmit

TDMA: Time Division Multiple Access

UART: Universal Asynchronous Receiver/Transmitter

UDH: User Data Header

US: User segment

USART: Universal Synchronous/Asynchronous Receiver/Transmitter

VASP: Value Added Service Provider

55

1. INTRODUCTION

55

1.1. Background

The existing public transportation system in our country has posed troubles to the general public. There is no systematic provision of traffic routes and hardly does any vehicle arrive at a station in time. Under such circumstances people are compelled to waste a good part of their busy hours just waiting for their buses to arrive. The system, ‘Smart Bus’ seeks for a solution to this impending problem of public transportation in Nepal and focuses to make the vehicular transportation systematic, in-time and easy.

The Smart Bus system is a system design based on Global Positioning System (GPS) and Global System for Mobile Communications (GSM). The bus has an On-Board module which consists of a GPS modem and a GSM modem interfaced with microcontroller. GPS receiver identifies the location of the vehicle and the information of the vehicle’s location is sent to a web server via GSM network using SMS service. People can know the whereabouts of the vehicle by logging into a website through their mobile phone with internet accessibility.

The system is efficient, cost effective and useful in our nation’s context. It provides a real time solution to the existing transportation system.

1.1.1. Background Research

The intelligent transportation system has already been developed and implemented by the different countries. The different countries that already have implemented the system are:

·  Taipei Smart Bus System : This system consists of On-Board Technology and Bus Stop Technology. The On-Board Technology consists of GPS devices and transit control centre. The real time schedule is handled by the transit control centre. If a bus arrival event is deviant from the assigned schedule, the transit centre will send the new schedule to be displayed at bus stops and on the website.[1]

·  Singapore Bus Service Transit: The real time schedule is handled by SBS Transit (Intelligent Route Information System) service for tracking real-time bus schedule using GPS technologies. Passengers can access real-time schedule using WiFi-enabled devices and by downloading iris NextBus related apps.[2]

·  Winnipeg Transit System: Bus riders in Winnipeg can access real-time bus schedule on the Winnipeg Transit website, on their Smartphones, and via SMS text messages. Winnipeg Transit’s Open Data Web Service provides a way for developers to retrieve live information about Winnipeg Transit’s services.[3]

1.2. Objectives

The project objectives may be listed as below:

·  To be familiar with GPS and GSM technologies and techniques of logging data into the server.

·  To keep trace of vehicle location and provide the vary information to the general public.

·  To make transportation system systematic and time effective.

·  To design a system to ease traffic related problems in major cities of the country.

·  To learn to work in groups and to understand the importance of group work.

·  Another important objective, however is to use our theoretical knowledge that we have gained so far in four years of our engineering career and so forth employ the same to develop some practical or real life applications.

1.3. Methodology

Methods used include:

·  Acquiring the current position (latitude and longitude) of the vehicle using GPS Module.

·  Reading the thus acquired information about vehicle serially using microcontroller and storing it and displaying the information on LCD .

·  The information about vehicle like position, vehicle ID, Departure Place and Destination place is sent serially to the number provided by VASP using GSM Module using the AT command.

·  Extracting the message received from the VASP to display in the web page.

·  Mapping the data into a Google map using Google API.

·  Receiving the message from the Server and announcing the status of the vehicle based on the message received.

·  Replying the mobile user with vehicle current position when asked about its information.

·  Giving the message alert for the subscriber who has subscribed for a particular bus for a particular location.

2. LITERATURE REVIEW

Vehicle tracking is finding its course and is an uprising subject in navigation and wireless communication technology. Vehicle tracking and security applications using GPS and GSM technology are being invented and implemented in different geographical locations in different criteria. The use of GPS enabled vehicles has made life so easy that one can get to an unknown place with no help of others at all. Different projects concerning vehicle tracking are proposed and are implemented intended to make transportation and navigation easier, effective and systematic. So far no projects and sufficient research have been done concerning this topic in Nepal. Our project is an attempt to make something useful to make the public transportation somewhat regulated and man friendly.