Offline Vehicle Tracking and Visualizing on Digital Maps

Tracking mobile objects has always attracted people’s interest and over time it has become a necessity to keep records of them. Various solutions have been developed to meet this need. In particular, the development of GPS and digital mapping system has contributed greatly to these solutions. The developed methods can be divided into two main categories as online and offline systems. Although the online systems provide advanced features, production and operating costs are quite high and have regular expenses. In this study, we propose a microcontroller based offline vehicle tracking system. The proposed system offers a practical, low cost and high capacity approach for vehicle tracking systems. The proposed system calculates the vehicle’s position and speed according to the signals gathered from GPS satellites and records them to an SD card continuously. The stored data, then, can be transferred to a computer easily whenever needed and the routes that the vehicle followed can be tracked on a digital map using google earth. Besides, some visualization technics like coloring routes with regards to time or speed intervals can be used for advanced analyses of the data. The proposed system allows the GPS data to be recorded as long as 3 months on a 4 GB SD card continuously.


Introduction
The free, open, and dependable nature of GPS has led to the development of hundreds of applications in such areas as marine, aviation, agriculture, environment, space, surveying, mapping, public safety, disaster relief, recreation, timing, rail, roads and highways.Although tracking systems was first developed for fleet management and shipping systems, today it is used in many areas of daily life [1], [2].Vehicle tracking systems used today are generally online systems.That is, the information like location and speed of the vehicle are sent to a management center in real time.Online systems depend on GPRS or SMS technology to communicate with a management center or a central server.Despite the many advantages of this system, they have some regular expenses beside the initial setup costs.These expenses involve monthly subscription fee per vehicle for GPRS services, server and management center operating and maintenance fees, domain name fees and server hosting costs.Moreover, if these services are not owned by self, it is needed to subscribe such services and pay subscription fee monthly for each vehicle to be tracked.In case of GPRS or generally internet connection loss, there might be data loss if the device on the vehicle does not have a local storage unit.There might some cases that real time tracking of the vehicles is not essential and having past records might be sufficient.For example, for a school bus debates about following route, timing and obeying speed limits can be illuminated by examining previous records.Similarly, a company can use recorded past data to check its vehicles routes, departure and arrival times and to estimate amount of fuel consumption.This data may also be used as evidence in case of accident or a crime.For such cases, there is no need for real time or online tracking systems and having just an offline tracking record is sufficient.In this study, a practical and low cost solution is proposed as an alternative to real time or online tracking systems.For this purpose, an offline tracking system which records the data received from GPS satellites to a pluggable SD card is developed.Then, the recorded data can be transferred easily to any computer when needed and can be monitored on a digital map using google earth.Since the GPS data is recorded directly on SD card as standard NMEA format, there is not a dependency to any special or commercial software to monitor the data on a digital map.Any software able to monitor GPS data can be used.In this study google earth is used to visualize the users route on digital maps.

Global Positioning System
The Global Positioning System (GPS) is a satellite system that provides users with positioning, navigation, and timing information.The GPS system was created by US.Department of Defense and has been available to civilians since 1980.Generally, it is used to track and navigate the mobile objects.The GPS system consists of three segments: The space segment, the control segment, and the user segment.
 The space segment basically consists of 24 satellites that travel around the earth two times a day.The arrangements of the satellites on 6 planes allow at least four of them to be visible by receivers from any point on the Earth. The control segment consists of ground stations which track the satellites, monitor their transmissions and send command and data to keep them in their orbits. The user segment is composed of military and civilian applications.The military services use L2 frequency and have a more precise positioning and timing capability than the civilians.[3], [4].

System Design and Implementation
The designed system is described in detail in this section.Block diagram of the designed offline tracking system is shown in Figure 1.The three main parts of the system are GPS module, microcontroller and data storage.The GPS receiver module's function is to calculate the vehicle position according to information received from GPS satellites.The microcontroller processes the data obtained from GPS receiver module and selects desired NMEA sentences.This data is stored to a pluggable SD card.Whenever needed, SD card can be plugged in a computer to monitor the data on a digital map.All components in the circuit require a 3.3V voltage source.The device includes a voltage regulator on board and vehicle's battery or a separate battery can be used as a power supply.

GPS Module
The GPS module is used to get the current position and speed of vehicle.In this study, LINX RXM-GPS-SR receiver module (shown in Figure 2) is used for getting latitude, longitude, altitude, date and time information.Small dimensions (25.2mm-12.4mm-11.9mm)and low cost of this device is the major reasons for selecting the module.It has an integrated antenna and direct serial interface to communicate with host device.The update rate of the module is 1Hz and position accuracy is less than 10 meters.
The module is based on the SiRFstar III low power chipset.The module's high-performance RF architecture allows it to receive GPS signals that are as low as -159dBm [4].Although there would be device specific communication protocols, NMEA is a standard protocol supported by all GPS receivers.There are several NMEA sentences as GGA, GLL, GSA, GSV, RMC and VTG.These sentences include some common and some sentence specific information [4].
In this study, RMC sentence is used because it includes all the information required for this application.A sample RMC sentence and message format is as follows: $GPRMC,053740.000,A,2503.6319,N,12136.0099,E,2.69,79.65,100106,,,A*53 Description of the sample RMC sentence is seen in Table 1.

Microcontroller
In this project, PIC18F4620 microcontroller is used.PIC18F4620 has built in UART and SPI hardware for serial communication and has a wide range of operating voltage (2-5.5V)[5].In this study, both GPS receiver and SD card module requires 3.3V power supply.A microcontroller capable of operating at 3.3V simplifies the circuit design and reduces the number of power supplies required.The microcontroller has two main tasks.First one is to get NMEA sentences from the GPS receiver.The microcontroller communicates with GPS receiver through RS232 serial communication protocol.The GPS receiver sends 6 different NMEA sentences every second.Microcontroller receives all these sentences and selects the desired ones.
The second task of the microcontroller is to store the selected NMEA sentences to an SD card.The microcontroller uses build in SPI hardware to communicate with SD card.The data is written to a text file in a FAT formatted SD card (Figure 3).

Start Initialize SPI and UART
Is SD card ready?
Is GPS data received?
Record data to text file on SD Card

Storage Unit (SD Card)
Secure Digital (SD) is a non-volatile memory card format developed by the SD Card Association (SDA) for use in portable devices.SD cards are available in a wide range of capacity and speed classes.SD cards are preferred due to their high capacity and small size.SD cards used in this project needs to be formatted as FAT or FAT32 file system.While FAT file system is used in SD cards up to 2 GB capacity, FAT32 file system is used in SD cards up to 32 GB capacity [7], [8].

Digital Maps
Digital maps are becoming increasingly widespread.Especially, the development of the GPS system has contributed greatly to the development and widen the usage areas of digital maps.Most of the information that comprise digital maps is satellite images as well as street level information.Digital maps have the advantage of being updated through synchronization with updates from company servers [9].There are many digital maps used today.But most well-known and widely used maps are google map and google earth.Google maps are mostly used for navigational purposes while google earth is used exploring the world in a more detailed 3D maps.Although there are many common features between google earth and google maps, the main difference is that google earth is a desktop application and google maps is an online web application.Google earth is used in this study, since it can examine the GPS data directly.

Results and Discussion
The prototype device prepared for offline tracking is given in Figure 5.The dimensions of the device are 45mm x 65mm x 25mm.In order to test the designed system, the device is put into a vehicle and two different routes were followed in Ankara.Meanwhile, the device collected and recorded the GPS data to an SD card.The obtained data were transferred to a computer just by simply copying the GPS data file and the paths followed are imported to google earth and displayed on a digital map (Figure 6).Various digital map types can be used to monitor and analyze the GPS data.Google earth is a simple and easy to use digital map monitoring tool and can be used to display tracking data like followed route, speed of the vehicle, time and date without need to any conversion.A digital map image as shown in Figure 6 is generated by simply importing the row data to google earth.
Displaying row data on google earth is easy and practical, but in some cases, it might be necessary to make it more user friendly and understandable.For example, it might be necessary to examine whether a school bus exceeded speed limits, followed its route, or arrived to children's home on time.In these cases, coloring the routes according to speed or time intervals might be useful.It is possible to convert row GPS data to KML format and display it in a better understandable manner.KML (Keyhole Markup Language) is used for formatting 2-D and 3-D geodata for display in earth browsers.
In this study, in order to make detailed analyses of GPS data, GPS Visualizer is used to convert GPS data to KML format and GPS data is colored according to time and speed intervals.By organizing KML file using GPS Visualizer, the tracked route of the vehicle can be highlighted in different colors according to time or speed intervals [10].In Figure 7, the followed routes are drawn according to time intervals.In the figure, red, yellow, green, blue and purple points represent the time interval between 12.05-13.30,13.30-14.45,14.45-16.21and 16.21-17.46.For school bus example, highlighting routes according to time intervals enables observers to easily determine the location of the school bus in a specific time interval.Besides, the observer can mark on a data point in order to check speed and location of the user in terms of latitude and longitude.Another way for detailed analysis of the followed route is visualizing the data in terms of speed of the vehicle.In this visualizing type, data is highlighted in different colors according to speed intervals.In Figure 8, the followed routes are colored according to vehicle's speed.Five different speed intervals are highlighted in five different colors.The speed intervals can be set easily by observers.Considering school buses, compliance with speed limits is one of the most important issues.This visualizing technique enables observers easily determine the routes at which the speed limits are exceeded by the drivers.Another important issue with the offline vehicle tracking systems is data storage capacity.Data storage capacity of the designed system depends on the SD card used.It is a removable media and can be replaced with a higher capacity SD card according to the needs.By using a 4 GB SD card in this study, the system is able to save 6 types of NMEA sentences data for at least 3 months.

Conclusions
Safety is becoming an important requirement in growing and crowded cities. Tracking systems are getting essential tools for traffic safety.Especially for safety and deterrence purposes continuous recording of vehicles movement is a requirement and offline tracking systems are useful and suitable tools for many applications.In this study, an offline vehicle tracking system was designed and implemented that can be used to record continuously the movement times, speeds and routes of vehicles.
In this context, a circuit was designed to save the GPS data to a storage unit and the routes of the tracked vehicle were visualized on Google Earth.Offline vehicle tracking systems offer low cost and convenient solution for situations where real time monitoring is not vital.Besides, the proposed system has several advantages such as low hardware costs, high storage capacity.Moreover, the system does not need constant periodic fees.Presence of such a tracking system on the car will also create a deterrence on the driver.School buses can be thought as good candidate users of this project.In this way, in an unexpected situation, observers easily check whether or not the drivers changed the predetermined route, or the drivers exceeded the speed limits.In terms of system cost, the proposed offline tracking system has superior advantage compared to online tracking systems.Since map viewing application is free, cost of the system only consists of hardware components.Besides, there is no software fee or update fees.Moreover, it does not occur additional expenses for SMS or internet connection.Because of small dimensions, low power requirements, and high storage capacity, the designed vehicle tracking system can be adapted to other objects or living things, such as cyclers, pedestrians or animals in the nature.
The proposed system can incorporate with the existing navigation systems as an additional feature.Moreover, the system can be implemented to the vehicles during their production.Dimensions of the module can be minimized by using micro SD cards and surface mount components.

Figure 1 .
Figure 1.Block diagram of the designed offline vehicle tracking system.

Figure 2 .
Figure 2. LINX RXM-GPS-SR receiver moduleGPS module transfers data using NMEA 0183 standard.Although there would be device specific communication protocols, NMEA is a standard protocol supported by all GPS receivers.There are several NMEA sentences as GGA, GLL, GSA, GSV, RMC and VTG.These sentences include some common and some sentence specific information[4].In this study, RMC sentence is used because it includes all the information required for this application.A sample RMC sentence and message format is as follows: $GPRMC,053740.000,A,2503.6319,N,12136.0099,E,2.69,79.65,100106,,,A*53 Description of the sample RMC sentence is seen in Table1.

Figure 5 .
Figure 5.The prototype of the designed system

Figure 6 .
Figure 6.Google Earth screenshot of followed routes

Figure 7 .
Figure 7. Google Earth screenshot of colored routes according to time intervals

Figure 8 .
Figure 8. Google Earth screenshot of colored routes according to speed intervals

Table 1 .
Description of an example RMC sentence