Vous êtes sur la page 1sur 4

2010 Second International Conference on Computational Intelligence, Communication Systems and Networks

Implementation of GPRS-Based Positioning System using PIC Microcontroller

Wael M El-Medany, and Alauddin Alomary


Computer Engineering Department University Of Bahrain, 32038 Bahrain Email: wmelmedany@itc.uob.bh
Abstract This paper presents a hardware design and implementation of GPRS based positioning system using PIC microcontroller. The system is implemented using the microchip PIC 16F877A microcontroller. The system has been tested on a test board, and then a PCB (Printed Circuit Board) layout has been implemented for the final system prototype. The system provides the ability to track current position of the vehicle or its position in any specific time and date by analyzing the received data from the GPS receiver. The prototype has been tested experimentally and the results are analyzed and discussed. Keywords- GPS; GPRS; ITS; PIC; Positioning System.

Reyadh Al-Hakim, Sufyan Al-Irhayim, and Mustafa Nousif


Computer Engineering Department University Of Bahrain, 32038 Bahrain

II.

SYSTEM ARCHITECTURE

The tracking system architecture comprises three main modules: the GPS location module, the GSM delivery module, and the backend system that collects the information and displays it when requested. A. The GPS Location Module The GPS receiver unit (attached to the monitored vehicle) is built using the GM862-GPS quad band cellular modem, which combines a powerful GSM engine with a SIRF III 20-channel high sensitivity GPS receiver. The receiver uses triangulation to calculate its location. The coordinates (latitude, longitude, altitude) will be calculated at predetermined regular intervals and passed along with a time-stamp to the GSM delivery service. The GPRS Delivery System The GSM module communicates with the microcontroller to access and send this data to the server via a previously established GPRS connection. First, the unit will establish a GPRS connection with the server, and then establishes a TCP/IP socket connection with the data that is sent as IP data packets over this connection. In the event that there is no GPRS available, the GPS data is stored in the memory unit and will be sent to the server along with the real time location details as soon as GPRS becomes available again. C. The Backend System The Microchip PIC 16F877A microcontroller is the main operational unit of the tracking device. It communicates with each of the other operational GPRS delivery service units via its built-in UART interfaces. The monitoring server is integrated with a Web Portal that allows users to access the tracking device location data for analysis and display. This web-based architecture allows the common infrastructure to be leveraged by a variety of different users. The monitoring server provides the data processing to convert the GPS sensor data into locations, and it is integrated with Goggle maps to provide a visual interface for tracking the vehicle location. There are three LEDS attached to the output pins of the microcontroller to indicate the GSM signal availability, 3D-GPS signal fix is locked, and when the microcontroller sends data to the monitoring server. B.

I.

INTRODUCTION

Vehicle positioning technique currently has been applied to many popular applications, including vehicle navigation, vehicle tracking, fleet management, and location based services [1], [2], [3], [4], [5]. Recently, it has developed into a powerful and marketable package due to its low-cost and varying facilities such as Anti-theft modules, client identification and real time performance monitoring [6], [7]. The objective of this research is to design and implement a Vehicle Positioning System (VPS) based on GPRS (General Packet Radio Service) [8], [9],[10]; and GPS (Global Positioning System) [11], [12]. To design an affordable and fast system the GM862 cellular quad band module is used. GM862 has GPS and GPRS integrated together to decrease the time delay and give an accurate measurements for the real time tracking [13]. The system provides the ability to track the vehicle current position or its position in any specified time and date. It also provides information regarding the vehicle status such as speed and mileage. By monitoring these information in real-time, a person or a company will have fully updated information regarding their vehicle status. This gives the option of using this information to avoid vehicle theft, or to manage their fleets [14], [15], [16], [17]. The materials in this paper are organized as follows; tracking system architecture is presented in section two. Section three presents the hardware implementation of the Vehicle Positioning System (VPS). The results and discussion will be reported in section four. Finally a conclusion and future work is presented in section five.

978-0-7695-4158-7/10 $26.00 2010 IEEE DOI 10.1109/CICSyN.2010.76

365 366

III.

HARDWARE IMPLEMENTATION

The hardware of the system is based on Telit GM862GPS module and supported with a microcontroller by which the communication requirements are configured, activated and GPS data are analyzed, as shown in Figure 1.

Microchip's PIC16F877 Microcontroller The Microchip's PIC16F877, 40 pins 8-bit (with 8 Mhz clock) processor is used as the system controller [18]. It has 8K x 14-bit of FLASH program memory, 368 bytes of data RAM, 256 bytes of data EEPROM and 33 I/O lines. Only 6 lines of the I/O lines have been used. Two of these lines are for TxD and RxD signals of the USART of the microcontroller; the baud rate is set at 4800 bps. The third line is used for driving the ON/OFF pin of GM862. The remaining 3 lines are used to drive 3 status LEDs as follows: GSM signal LED: this led will be on when GSM signal is available; GPS signal LED: will be on when 3D GPS fix is locked; Data LED: will be on whenever the microcontroller sends data to the monitoring server. The Mikrobasic Complier [19] is used to compile the microcontroller program with BASIC syntax. A simple WIN PIC Programmer [20] is used to save the hex files into the microcontroller flash. The program size is 2359 x 14-bit and uses 188 bytes of the RAM. C. GM862 Antennas The GM862-GPS module has two 50 ohm microminiature (MMCX) antenna connectors, one for the GPS antenna and the other for the GSM antenna. The GM862GPS module is not provided with an internal LNA amplifier. The use of an active antenna is therefore important to achieve a good performance. A VSWR <= 2:1 is recommended. A Quad-band antenna for the GM862 GSM modem with a frequency range of 824 ~ 960 MHz // 1710 ~ 1990 MHz, and a GPS Antenna 3V Magnetic Mount SMA have been implemented. D. Printed Circuit Board Layout and Prototyping The layout for the printed circuit board has been designed using TraxMaker tools. Two PCB layouts were designed in order to minimize the size of the tracking device and to be able to print them using a single face PCB, where the double side PCB was not available. The two PCB layouts are connected using a ribbon cable. Figure 2 present the top side of PCB design. The prototype of the tracking system is shown in figure 3.

B.

Figure 1. Schematic Circuit

A. GM862 GPS/GPRS Module The GM862 has 50 pins formed in a MOLEX connector [13]. Out of the 50 pins, only 4 of the signal pins are required (see Figure 1). The GM862 is a GPRS + GPS module with simple AT-based communication protocol. The serial port on the GM862 is the core of the interface between the module and external hardware. Two serial ports are available on the module: MODEM serial port and GPS serial port (NMEA protocol). The MODEM serial port on the GM862-GPS is a +2.8V UART with all the 7 RS232 signals of which only 2 pins (TxD and RxD signals) are used. These 2 signals are connected to RxD and TxD signals of the USART of the PIC16F877 microcontroller. The connection is not direct, but through some level translation (+5V/+2.8V) circuit. Two cascaded RS232 Converters MAX3232 are used for level translation. The upper one (in Figure 1) converts +5V to RS232 and the lower one converts the RS232 to 3V. The third implemented pin is the ON/OFF pin. The fourth implemented pin is the STAT_LED pin. This pin is an Open Collector output where it is possible to directly connect a LED to show information on the network service availability and Call status. The remaining implemented pins are the power supply pins, +Vcc and GND. The GSM system is made in a way that the RF transmission is not continuous, it is packed into bursts and the relative current peaks can be as high as about 2A.Therefore the power supply has to be designed in order to withstand with these current peaks without big voltage drops.

Figure 2: Tracking System PCB Layout

366 367

Figure 3: Tracking System PCB Prototype

E. Flow Diagram for PIC Firmware The firmware has been written using BASIC syntax, and has been compiled using Mikrobasic complier from MIKROE Corporation. This compiler is easy, powerful, and provides many examples and tutorials. It also provides debugging capabilities for the code. WIN PIC Programmer software is used to send the hex files to the microcontroller in order to program the chip and JDM 2 is chosen as the interface type for the programmer. The flow diagram for the PIC microcontroller program is shown in figure 4, which describe the communications between the microcontroller and the GM862 module. At the initial states the controller check for the GSM MODEM operation, set the baud rate to the required baud rate, stop the MODEM flow control, and then check the GSM network registration. After creating and activating the GPRS connection, the microcontroller will request data from GPS, and then analyze the GPS data before sending them to the server. The microcontroller will calculate the difference in time and distance between current GPS data request and the last GPS data sent. Then it will decide wither to send the data or not based on comparing the calculated time and distance difference with the fixed time and distance intervals. The state of requesting and analyzing the GPS data is described in more details in figure 5, in that state the controller check to see which satellite is in view, and check for the transmission intervals to trigger the time and distance intervals to see if there is a GPS data is available or not. If GPS data is ready, it will resume the socket connection, and then send the data to the server through the GPRS network as shown in figure 5.

Figure 4. Microcontroller Firmware Flow Diagram

Figure 5. Flow Diagram for Requesting and Analyzing GPS Data

367 368

F. Local TCP Packet Listener Application Normally the tracking device waits until the GPS module is locked on the signal of at least four satellites to calculate the 3D position. The position is defined by three values; longitude, latitude, and altitude, those values are called the coordinates of the tracked position. The tracking device sends those coordinates with other information to a fixed IP address at a fixed port for specific server. The transmission of those data is done by establishing a GPRS connection using the GSM MODEM. The wireless carrier network provides wireless internet service through the GPRS connection. A TCP packet with all the essential information is sent to the monitoring server. The server has TCP packet listener application installed and running on the server. The packet listener opens a local TCP port that specifies for the GPRS packets and keeps listening until a TCP packet is received. After receiving the data, the application analyses, the data format is checked against the supposed tracker data format, and then inserted into the database based on its tracker device ID. The packet listener is written using VB.net 2005. IV. RESULTS AND DISCUSSION

REFERENCES
[1] Wei-Hsun Lee, Shian-Shyong Tseng, Ching-Hung Wang, Design and implementation of electronic toll collection system based on vehicle positioning system techniques, Computer Communications journal, Vol 31, pp. 29252933, 2008. Asvin Goel: Fleet Telematics - Real-Time Management and Planning of Commercial Vehicle Operations. Operations Research/Computer Science Interfaces Series, Vol. 40. Springer. 2007. Asvin Goel and Volker Gruhn , Fleet Monitoring System for Advanced Tracking of Commercial Vehicles, Proceedings of the 2006 IEEE International Conference on Systems, Man, and Cybernetics (SMC 2006), pp. 2517-2522, Taipei, Taiwan, 08.10.2006 - 11.10.2006. M. Ahmad, J. Iqbal, et al, Real time fleet monitoring and security system using GSM network, Proceedings of the 6th WSEAS International Conference on Simulation, Modelling and Optimization, Lisbon, Portugal pp. 498-503, 2006. Chadil, N.; Russameesawang, A.; Keeratiwintakorn, P, Real-time tracking management system using GPS, GPRS and Google earth, ECTI-CON 2008, Volume 1, pp. 393 396, 2008. Diane J. Cook, Juan C. Augusto, Vikramaditya R. Jakkula, Ambient intelligence: Technologies, applications, and opportunities, Pervasive and Mobile Computing 5, pp. 277-298, 2009. L. Figueiredo, I. Jesus, J.A.T. Machado, J.R. Ferreira, J.L. Martins de Carvalho, Towards the Development of Intelligent Transportation Systems. IEEE Intelligent Transportation Systems Proceedings, Oakland, CA, pp.25-29, 2001. S. Ni, GPRS Network Planning on the Existing GSM System, IEEE GLOBECOM, pp 1432-1438, 2000. GSMWorld. [Online]. Available: http://www.gsmworld.com/technology/faq.shtml Wael M El-Medany, GPRS-Based Remote Sensing and Climate Control System Using CMOD CPLD, International Journal of Computing, ISSN 1727-6209, Vol 8, Issue 2, pp 68-73, 2009. Garmin. What is GPS. [Online]. Available: http://www.garmin.com/aboutGPS/index.html US Air Force Fact Sheet: Global Positioning Systems Wing, Los Angles Air Force Base, Available: http://www.losangeles.af.mil/ library/ factsheets/factsheet.asp?id=5311 www.telit.co.it/data/uploads_EN/products/1vv0300728_GM862 GPS_Hardware_User_Guide_r6.pdf Muhammad Ahmad, Javaid Iqbal, Qurat-ul-ain, Sumaira Ghazal, "Real Time Fleet Monitoring and Security System using GSM Network", Proceedings of the 6th WSEAS International Conference on Simulation, Modeling and Optimization, Lisbon, Portugal, September 22-24, pp. 498-503, 2006. Aloquili, O, Elbanna, A, Al-Azizi, A, Automatic vehicle location tracking system based on GIS environment, Software, IET Volume 3, Issue 4, pp. 255 263, 2009. Hapsari, A.T., E.Y. Syamsudin, and I. Pramana, Design of Vehicle Position Tracking System Using Short Message Services and its implementation on FPGA, . Proceedings of the Design Automation Conference, 2005 (ASP-DAC 2005), Asia and South Pacific, Vol. 2, pp. D19-D20, Shanghai, China, 2005. Deblauwe, N.; Ruppel, P, Combining GPS and GSM Cell-ID positioning for Proactive Location-based Services, Fourth Annual International Conference on Mobile and Ubiquitous Systems: Networking & Services, Page(s):1 7, Aug. 2007. http://www.microchip.com http://www.mikroe.com/pdf/mikrobasic/mikrobasic_manual.pdf http://www.qsl.net/dl4yhf/winpicpr.html

[2]

[3]

[4]

[5]

[6]

[7]

In order to test the vehicle tracking system, the tracking device prototype was installed in a car by connecting the power jack with a 12V power from the car battery, then placing the GSM and GPS antennas. By looking at the packet listener which is installed on the monitoring server, two received packets are identified. The vehicle position estimation is excellent as well improving the precision of the GPS system. Using the website interface, the position can be viewed on the Google maps along with car information such as speed and coordinates. Also, the time interval of 1 minute can be noticed from the UTC time difference. The prototype has been tested experimentally and the results are analyzed. The experiments are conducted in different areas on Kingdom Of Bahrain using Google maps. The cost is much lower compared to other tracking systems in the literatures. Free Google map reduces the cost for the individual user and also for the small business owner. V. CONCLUSION

[8] [9] [10]

[11] [12]

[13] [14]

[15]

In this paper we have presented a GPRS based positioning system with an accurate localization has been implemented using PIC16F877 Microchip. The combination of the GPS and GPRS provides continuous and real time tracking. The system provides the ability to track current position of the vehicle or its position in any specific time and date by analyzing the received data from the GPS receiver. The system also provides information regarding the vehicle status such as speed, mileage, and driver performance. The tracking device can be adjusted with reference to the time intervals of data transmission.

[16]

[17]

[18] [19] [20]

368 369

Vous aimerez peut-être aussi