Professional Documents
Culture Documents
Geofencing On The Real-Time GPS Tracking System and Improving GPS Accuracy With Moving Average, Kalman Filter and Logistic Regression Analysis
Geofencing On The Real-Time GPS Tracking System and Improving GPS Accuracy With Moving Average, Kalman Filter and Logistic Regression Analysis
net/publication/337985439
CITATION READS
1 536
2 authors:
Some of the authors of this publication are also working on these related projects:
Desing of Geofence mechanims on real time tracking system with GPS+GSM+GPRS technology View project
All content following this page was uploaded by Zeynep Özdemir on 31 January 2020.
Abstract—People throughout history have wondered their depend solely on the number of satellites. There are four
position on the world. This led to the development of Global factors that affect the performance.
Navigation Satellite Systems (GNSS). The most widely used is
the GPS (Global Positioning System) technology. Signals 1. Accuracy: Distance, speed, time difference between the
emitted from GPS satellites. Calculates your own location by measured position and actual position.
detecting GPS receivers on earth. The GPS data obtained in this 2. Integrity: Providing accurate alarm and information in
study was sent to a remote server via GSM and GPRS and unexpected and unwanted conditions
turned into a real-time tracking system. The location of the GPS 3. Continuity: System continues to operate without
device can be monitored instantly by observing the application interruption
map screen from devices such as computer and phone. This
4. Availability: The period in which the transmitted signal
monitored location has a certain delay considering the factors
such as the arrival time of the GPS data to the device and the provides three other factors and the system is running.
time the device connects to the internet. The system operates If these conditions are not sufficiently fulfilled, GNSS
with a delay of 4 - 5 seconds. In addition, the Geofence field is services will improve with support from satellite-based local
used to alert the device when it moves away from a specified
development systems. GPS is now widely used for both
location. As the Geofence area, a predetermined polygon on the
map can be used or the polygon area drawn during the military and civilian purposes. Navigation of land, air and sea
application can be used as Geofence. On the application screen, vehicles, missile guidance, finding targets, determination of
an audible warning is given when leaving the Geofence area. the position of the aircraft in limited or not, such as military
GPS does not always show the exact correct position; it has a use; animal, vehicle, infant tracking systems, cadastral
certain margin of error. Many factors affect this margin of surveys, surveys for geodetic and geodynamic purposes,
error. This causes the application to give false alarms and development of geographic information system databases.
operate with the wrong location. In order to reduce this error,
the error rate was tried to be reduced by using Kalman filter, There are 24 satellites of the United States Department of
logistic regression analysis and moving average filter. Normally Defense. Three of them are reserved. These satellites emit a
the error margin of up to 15 meters is considerably reduced by kind of radio signal. This signal contains the position and
these filters. time of the satellite. The GPS device calculates its position
with the position and time information sent by the satellites.
Keywords—GPS, GSM, GPRS, Geofence, Kalman Filter, Moving The GPS device calculates the latitude and longitude values
Average, Logistic Regression Analysis
when it sees three satellites. As the number of satellites
I. INTRODUCTION increases, the accuracy of the position information increases.
In the open air, a GPS receiver can see at least 4 and at most
Today, most people think of GPS when it comes to location
12 satellites. The satellites are placed in orbit accordingly.
service. Although GPS is known as a popular location service GPS devices produce data in NMEA standard as a result of
around the world, these two services, together with the
their calculations. This is important for the proper use of GPS
Russian alternative GLONASSS (Global Orbiting coordinates [11].
Navigation Satellite System), are part of a system called
GNSS (Global Navigation Satellite System). There are Global System for Mobile Communications is abbreviated as
different location services developed by India, China and GSM. It is the most common mobile phone network in the
European countries. Since it is the first service, it is generally world. The user can access and make calls to all countries of
known as GPS. GNSS is briefly defined as a set of satellites the world on the same line. GSM uses the cellular network as
that send signals from satellites in space and are used for standard.
global positioning. GNSS receivers, such as mobile phones,
GPRS stands for "General Packet Radio Service". GPRS is a
can detect their own position by decoding signals that are sent
mobile data technology that enables data transfer over mobile
by orbiting satellites that contain data such as positioning and
phone receivers. Uses packet-switched data transfer. Allows
timing. The higher the number of satellites that a GNSS
you to connect to the Internet. Packet-switched data
receiver receives, the higher the accuracy of the calculated
communication means that the data is separated into packet-
position, but the performance of GNSS services does not
named pieces and then reassembled according to the
978-1-7281-3789-6/19/$31.00 IEEE
sequence number. The Internet network generally works with points are located, measurement was performed with the
this technology. device. On the data obtained, error reduction process was
performed with moving average and Kalman filter.
This study was planned as a real-time tracking system. This
vehicle monitoring can be used in the follow-up of children Kalman filter is a method that can estimate the values of
or in case of loss of Alzheimer's patients. In short, the location systems in many different fields. In mathematical terms, the
is followed wherever the device is located. The methods used Kalman filter predicts the states of a linear system. Generally
in tracking systems are very different, sometimes used in GPS systems. It was also used in this study and tested
communicating via text message, sometimes only data is how much it reduces the error.
stored in the memory card.
II. RELATED WORKS
In this application, GPS data can be sent to a remote server
As the study is comprehensive, various fields and scientific
and tracked on the map. After the data sent using GPRS
studies have been utilized. Arduino and Sim908 related part
technology is saved to the database, it can be actively used in
of the embedded software, GSM and GPRS related part of the
different applications. However, it takes a certain time for the
data communication, NodeJS used part of the web software
signals received from the satellite to be received and sent to
and leaflet and map software were completed by the technical
the remote server. This delay varies between 3 - 8 seconds in
part of the project. Studies to improve the accuracy of GPS
the device we use.
data have also been handled separately.
As it is understood from the study, it consists of two parts.
In one study [1], a GPS and GSM based tracking system was
The first is to receive GPS position data using the Sim908
studied. They designed a vehicle tracking system as a
device and send the data to a server using GSM and GPRS
different and practical model. Compass sensor YAS529 and
technologies. The second is the display of GPS data via web
Accelerator sensor KXSC72050 were used. The direction of
or Android application. It is very difficult to follow a location
the vehicle is estimated and followed by SMS and GPRS. In
on the application screen. For example, it is not an effective
another vehicle tracking system study [2], GPS, GSM and
solution to monitor and monitor a child for 24 hours. The
GPRS were used. The geofence area is already defined in the
child can play for hours without leaving the park boundary.
system and is circular. When this field is exited, it is provided
In order to find solutions to such situations, the ability to
to be alerted by SMS. The entrance and exit of the Geofence
make geofence on the map screen has been added. Geofence
area gives warning in case of stopping and moving of the car.
can be briefly defined as a geographical restriction. It is a
Google Maps API is used as a base map.
system that warns when going out from a certain area. A child
can be given an example of the target to be followed and the In one study [3], a car was designed as an anti-theft system.
parking area where he plays is an example of a Geofence area. GSM and GPS module is used and the vehicle is stolen with
Parents of the child can use the devices we use on the child a vibration sensor. The system is in constant contact with the
in the form of electronic bracelets to follow up and be aware owner of the car. Likewise, the purpose of the vehicle
of the situation. As soon as the child steps out of the Geofence tracking and security system study using GPS GSM modules
area, his / her parents can be warned by SMS, voice alert or [4] is to perform real-time tracking of bus transportation
mail. Geofence is designed in two kinds. The first one is static between the cities. When the car crashes and theft reports.
geofence, the polygon area defined herein are used as Written in the article of tracking system [5], GPS and GSM
geofence. The second one is followed by the dynamic are used in the same way.
geofence and the map is used as a geofence area without
There is an improved study to follow animals in wild-life [6].
recording the polygon. The advantage of this is to make new
It is a study that can be used in endangered and prohibited
drawings at any time and actively use the work.
animals. In a project [7], a follow-up project was developed
There are many causes of errors in the GPS data. A few of to avoid getting lost while travelling. There is another study
these are weather conditions, reflections in the atmosphere, in the form of a system that prevents intruders from entering
and the reflection of the signals hitting buildings. This error [8].
rate may vary depending on the device used, the weather
There are also studies developed on Arduino. [9] In the study
conditions at the location and the density of the building.
where Telit-gl865 device and GPS click device were used,
Although the error in the data is caused by many reasons, the
the only tracking system was developed. In another study
error rate can be reduced by making corrections on the data.
developed with Sim900 device, [10] geofencing features
There are various approaches to reduce the error rate. In this were added.
study, the error was tried to be reduced by moving average
and Kalman filter. The average filter is based on the III. MATERIALS AND METHOD
mathematical average of the data received. The moving Devices, libraries, systems and algorithms used in this section
average filter, on the other hand, is used for data that travels will be introduced in general.
in a time-dependent series. For example, averaging 10 data,
including new incoming data, is estimated at the next point. A. Arduino
This results in a high reduction of the error in the data that Arduino is an electronics development board. It has its own
makes a sudden jump. Makes distribution softer. The amount processor inside. Codes are loaded and executed from the
of error reduction can be understood when the actual value of development interface via computer. The Arduino cards are
the data is known. In order to create this test medium, 3 points equipped with AVR microcontrollers from Atmel. Arduino
with known actual location were determined. Where these consists of an IDE (Integrated Development Environment),
Arduino bootloader, libraries, microcontroller called allows you to easily add modules written by other developers
AVRDude and software compiler. In this study, Arduino Uno to the project and develop faster applications. [13]
was used.
Using a library called Express.js, server creation, setup, and
B. Sim908 execution are performed. Thanks to this library, various
Sim908 has GSM and GPS modules together. Designed to settings are made automatically instead of making them one
work with Arduino and Raspberry Pi. The AT commands are by one. [14] Gulp is a Javascript task manager. It performs
given in the instruction manual are communicated. each given task in the file “Gulpfile.js ile respectively. This
automates and accelerates all the processes we need to do
before compiling. For example, one of the given tasks is to
reduce the used Javascript libraries to file_name.min.js. All
we need to do is show the path to the javascript libraries and
define the task. It reduces the operating time by automating
operations [15].
D. Leaflet.js
The leaflet is an open-source JavaScript library written to
create maps. Although Openlayers has alternatives like
Google Maps API, it is preferred because it is very flexible,
easily developed and customizable. A large number of plug-
in libraries are available from Github and can be customized
to suit your usage needs. Leaflet supports its own GeoJSON
format and other map data formats. The GeoJSON format
allows the JSON data format to be used in mapping
applications. In other words, the values that we can use on the
map such as point, polygon and line are in a certain format.
GeoJSON has added flexibility and speed to the Leaflet
library. Data can be added and processed in a single layer.
Leaflet Realtime is a library that can simultaneously display
data from a web service without refreshing the map screen.
The most important feature of the study is actually in this
library. It allows the data sent from the device to be displayed
Fig. 1. Arduino and sim908 module [12] instantly on the map.
The connections are as shown in fig-1. The SIM (Subscriber E. Kalman Filter
Identity Module) card and GPS and GPRS receivers are Kalman Filter was first discovered by Rudoff Kalman. It is a
installed. It is then integrated into the Arduino. Pin filter that is dynamic and can predict the location of the next
adjustments should be made as shown in the Fig 1. system in a system with known state space using previous
data. If there is scholastic or random noise in the system, the
The Arduino board is connected to the computer with a cable. Kalman filter works very well [16]. The real purpose of the
The Arduino IDE is loaded with the necessary code and is Kalman filter is to reduce errors in the covariance matrix. The
enabled to run. First, GPS data is received. A data set in basic Kalman filter accepts measurement results as a linear
NMEA format is obtained. This data is processed instantly system, but not many systems in the real world. For this
and sent to a remote server via GPRS. HTTP Get methods are reason, the Kalman filter has been developed and diversified.
used. Although much data was obtained, latitude, longitude, In this study, a linear Kalman filter was used.
altitude and time data were sent. Data can be sent at intervals
of 3 to 5 seconds. F. Moving Average Filter
C. NodeJS The average algorithm is to obtain a certain number of data
and divide it by the number of data. Moving average filter is
NodeJS is a runtime JavaScript platform that can be used for averaging according to filter size with the FIFO structure by
both background and foreground applications. The structure taking a certain number of data. It is a simple but effective
is asynchronous. Therefore, instead of making requests one filter.
by one, it does it in parallel. After each request, a function is
called to indicate that the request is finished and this structure G. Logistic Regression Analysis
enables real-time applications, games and instant messaging Linear regression is a statistical method for summarizing the
applications. NodeJS has been preferred because speed and relationships between binary and continuous data. Defines
performance are the most important factors in the real-time the relationship between dependent and independent
tracking system application. The GPS data from the variables. This is also used for time-varying data. Logistic
background is continuously checked and shown on the map regression is used to analyze data with one or more
in real-time. NPM (Node Packaged Modules) is a package independent variables that determine the outcome. In short, it
manager that we can easily download and install libraries. It can be thought of as a classification problem, which depends
on many variables, and the result is yes or no. As a result, find
the most suitable model. It is used in many different
problems. Provides efficient classification when working
with nonlinear data. Or find the right truth for them.
IV. RESULTS
A. System Architecture
The general operation of the system is shown in the Fig. 2.
The received GPS data was processed and sent to a remote
server. Then, it was turned into a real-time tracking system
with the location information shown on the map application. Fig. 3. Application screen using all libraries