v61 14
v61 14
91
World Academy of Science, Engineering and Technology 61 2010
92
World Academy of Science, Engineering and Technology 61 2010
IV. IN-VEHICLE UNIT SOFTWARE DESIGN This routine accepts the string containing “AT” command
input in its parameters and sends this string character by
Microcontroller is acting as Central Processing Unit for In- character to module. GM862-GPS accepts carriage return
Vehicle unit. All operations of the In-Vehicle unit are to be (‘\r’) as a command terminating character. As this character
controlled by the microcontroller. Microcontroller needs is received it sends back the response to microcontroller.
instructions to operate the whole system. These instructions Figure 3 shows the flowchart
are provided to microcontroller by writing the software into As shown in the flow chart routine checks each character
microcontroller’s flash memory. It reads the software of string, if the character is not null, it will check the transmit
instruction by instruction and performs the action as required buffer contents. If transmit buffer is empty it will write new
by instruction. Complete software is broken down into small character into the buffer. Transmit buffer is a hardware
modules as shown by the Figure 2. register of UART. As soon as a 8-bit data is written into the
transmit buffer, UART hardware transmits that character at
the specified baud rate. Each character of command string
will be sent in this way. When null character is found, it
specifies end of string and routine terminates by sending
carriage return to the module. Response received from the
module will be handled in another subroutine.
B. Subroutine- Startup
Startup routine is executed only when device is powered
on. It initializes all hardware of the In-Vehicle unit and
configures GM862-GPS. It performs various tests to ensure
the GM862-GPS is working properly and is ready to use.
Figure 4 shows the flowchart.
Fig. 2 Breakdown of In-Vehicle software
93
World Academy of Science, Engineering and Technology 61 2010
94
World Academy of Science, Engineering and Technology 61 2010
95
World Academy of Science, Engineering and Technology 61 2010
name and password for current GPRS context. Commands are port number and IP address/host name of Tracking server
used are AT#USERID=payandgo and respectively. If command returns the response CONNECT;
AT#PASSW=password. Next step configures the TCP/IP connection is accepted. Data can be sent now. After getting
stack. It basically sets the minimum packet size, data sending connection, socket is suspended using escape sequence +++ to
timeout and socket inactivity timeout. Command used for bring module in command mode. Socket remains connected
configuring TCP/IP stack is AT#SCFG=1,1,140,30,300,100. while it is suspended. When GPRS connection is alive,
First parameter of command is connection identifier; next module can’t accept AT commands and GPS data can’t be
parameter is context identifier for which stack is being read from module. Once module is in command mode this
configured. 300 is the minimum number of bytes that will be subroutine calls the routine Read GPS data which provides
sent in one packet. Next parameters are inactivity timeout, the information string that is to be sent to Tracking Server.
connection timeout, and data sending timeout. Next step of Next step is to read I/O ports of microcontroller to get
the subroutine is configures the firewall settings. It allows vehicle’s door and ignition status. Information string received
certain computers to connect to module. In this case server IP from Read GPS data subroutine is appended with status of I/O
address will be provided to firewall so that Tracking server ports. Socket connection is resumed and information is sent to
can connect to In-Vehicle unit. Command used for firewall Tracking server on this socket. If In-Vehicle unit is
settings is AT#FRWL=1,”server ip”, subnet mask. Server IP configured for continuous transmission of vehicle information
address will be the IP address of Tracking server and subnet after regular intervals, all above steps are repeated otherwise
mask can be provided to allow access to range of computers. module waits for incoming requests from Tracking server. If
Last step is activate current GPRS context. Command is location request is received above steps are repeated and if
AT#SGACT=1, 1. First parameter is context id to be any other command is sent by the server according action is
activated and next parameter is status i.e. 1 for activation and taken. Server can send request for vehicle shutdown,
0 for deactivation. changing the data transmission from GPRS to SMS or
changing the continuous transmission to polling or vice versa,
G. Subroutine-Send Information Using GPRS restart the In-Vehicle unit. This subroutine ends only when
When In-Vehicle unit is configured to send information In-Vehicle unit is restarted by Tracking server.
using GPRS, all activities of In-Vehicle unit are controlled by
this subroutine. H. Main Routine of In-Vehicle Unit
Main routine just calls the subroutines described in
previous sections. With start of main routine call is made to
Startup routine that initializes all peripheral and In-Vehicle
unit configurations. It checks for stored configuration to
decide whether data transmission should be through GPRS or
SMS. If configuration says for GPRS, call is made to GPRS
configuration routine and then GPRS data sending routine is
run. If configuration is for SMS, configuration is done and
In-Vehicle unit starts sending the vehicle information to
Tracking server via SMS either continuously after regular
intervals or it waits for commands from Tracking server as
SMS. GM862-GPS is configured in such way that whenever
new SMS arrives, and indication is received by
microcontroller with message identifier. This message is read
by microcontroller and corresponding action is performed as
shown in Figure 10.
All subroutines are implemented in C language. Compiler
used to generate machine language code for PIC18F248 is
CCS PICC.
Fig. 9 Flow chart of subroutine Send Information using GPRS V. TRACKING SERVER
Figure 9 shows the flowchart for this subroutine. In order to Tracking server maintains all information received from all
send data over IP network application needs an interface to In-Vehicle units installed in different vehicles into a central
physical layer. This interface is named as socket. This database. This database is accessible from internet to
subroutine starts with opening socket for currently configured authorized users through a web interface. Authorized users
TCP/IP stack. Command used to open socket for configured can track their vehicle and view all previous information
embedded TCP/IP stack is AT#SD=1, 1, 6534. First stored in database.
parameter is connection identifier of TCP/IP stack, 2nd is Tracking server has a GSM/GPRS modem attached to it
protocol i.e. 0 for TCP and 1 for UDP. Next two parameters that receives SMS from In-Vehicle units and sends those
96
World Academy of Science, Engineering and Technology 61 2010
messages to the server through serial port. Tracking server B. Database Design
saves this information into database. Database is designed to store all received vehicle
information, information about In-Vehicle units and users of
the system. Information to be stored in the database is
� Information about users of the system
� Information about vehicles
� Information about received from vehicles
C. GM862-GPS Interface Board for Tracking Server
GM862-GPS is GSM/GPRS modem that was used in In-
Vehicle unit. The same modem is used on server side to
exchange information with In-Vehicle units through SMS.
Vehicle information sent using SMS on GSM network is
received by this modem. Tracking server can also send
commands for In-Vehicle units using this modem. Same
interface board is used on this side. GM862-GPS interface
board is connected to the serial (COM) port of server. Server
can communicate with modem using AT commands. To send
and receive data using this modem a software is required that
can send AT commands to module.
97
World Academy of Science, Engineering and Technology 61 2010
F. Software Flow
Figure 12 shows the flow chart of main program. Main
program listens for SMS and handles all communication with
In-Vehicle units using SMS. It creates a separate thread for
listening to TCP/IP connections, which receives incoming
connections from In-Vehicle units and creates separate thread
for each incoming connection, which allows any number of
In-Vehicle units to connect to server. Fig. 13 Results of execution of Startup routine
VI. SYSTEM TESTING AND RESULTS When In-Vehicle unit is powered on it executes Startup
System design needs to be verified by testing after routine. It first reads and displays the existing configuration
integration of all components of the system. PCB designed for of the system. In next step microcontroller is configuring the
In-Vehicle unit and server side was assembled. After GM862-GPS. It first tests the communication interface by
integrating all the components, system was tested. sending “AT” command. GM862-GPS responded with “OK”
message which shows that interface is working. +CPIN:
A. Testing In-Vehicle Unit (SMS Configuration) READY response shows that SIM card is ready and +CREG:
GM862-GPS interface board was connected to 0, 1 response shows that module is connected to network.
microcontroller board through a serial cable.
98
World Academy of Science, Engineering and Technology 61 2010
Communication software for GM862-GPS following results the overall size of In-Vehicle unit and it will also reduce the
were observed. number of components so will the cost.
REFERENCES
[1]. G. T. French (1996) Understanding the GPS. 1st Edition. Bethesda,
GeoResearch Inc.
[2]. J.B. TSUI (2000) Fundamentals of Global Positioning System
Receivers. 1 st Edition. John Willey & Sons Inc.
[3]. GPSImages[online:]
http://www.gpsvehiclenavigation.com/GPS/images.php
[4]. R. Parsad, M. Ruggieri (2005) Applied Satellite Navigation Using
GPS, GALILEO, and Augmentation Systems. London, ARTECH
HOUSE.
[5]. R. Steel et al (2001) GSM, cdmaOne and 3G Systems. Chichester,
John Willey & Sons Inc.
[6]. T. Halonen et al (2003) GSM, GPRS and EDGE Performance. 2 nd
Edition. Chichester, John Willey & Sons Ltd.
[7]. GPRS ( General Packet Radio Service), HSCSD &
EDGE[online:]http://www.mobile-phones-uk.org.uk/gprs.htm
[8]. Telit Wireless Solutions (2008) GM862-GPS Modem
[9]. Microchip (2007) PIC18FXX8 Datasheet
Fig. 15 Logs of Tracking Server [10]. Transportation District's Automatic Vehicle Location
System[online:]
C. Web Interface Testing http://www.itsdocs.fhwa.dot.gov//JPODOCS/REPTS_TE/13589.htm
Since server is setup on the local machine. Website was l
[11]. Vehicle Tracking Systems Overview [Online:]
opened in internet explorer. After logging to the website it http://www.roseindia.net/technology/vehicle-
displayed the page as shown in Figure. tracking/VehicleTrackingSystems.shtml
[12]. Telit Wireless Solutions (2007) GM862-GPS Hardware user guide.
1vv0300728 Rev. 8 - 20/09/07
VII. CONCLUSION
The results presented in this paper contain execution of
Startup routine, execution of SMS Configure routine, Logs of
Tracking Server and Pointing out current location of vehicle.
For vehicle tracking in real time, in-vehicle unit and a
tracking server is used. The information is transmitted to
Tracking server using GSM/GPRS modem on GSM network
by using SMS or using direct TCP/IP connection with
Tracking server through GPRS. Tracking server also has
GSM/GPRS modem that receives vehicle location
information via GSM network and stores this information in
database. This information is available to authorized users of
the system via website over the internet. Currently In-Vehicle
unit was implemented with two boards. Microcontroller board
was externally connected to GM862-GPS interface board.
Single board can be designed to incorporate Microcontroller
circuitry on the GM862-GPS interface board. It will reduce
99