Real-Time Object Tracking System SIM808 Arduino (Github - Com Sarehsoltani) - BSc-Thesis Report
Real-Time Object Tracking System SIM808 Arduino (Github - Com Sarehsoltani) - BSc-Thesis Report
B.Sc. Thesis
Bachelor of Science
in
Computer Engineering
Submitted by
Sareh Soltani
Conducted in
Aolab (The Academy for Amirkabir IoT Laboratory)
In recent years, IoT technology has grown significantly and has been able
to meet diverse and complex needs in various fields. One of the applica-
tions of the Internet of Things is real-time tracking. The positioning and
tracking system has provided reliable solutions to ensure the safety of people
and vehicles, and also has a significant impact on optimizing the quality of
monitoring. This system can be used for a broad range of applications such
as traffic management and vehicle tracking/anti-theft system, and finally,
traffic routing and navigation. it can be applied in many business cases,
like public transportation, so passengers can track their buses and trains by
following the vehicle account on social networks.
In this project, a system was developed to accurately determine the lo-
cation, direction of movement, and speed of moving objects at any given
time using SIM808 Module. In this system, each object is equipped with a
GPS (Global Positioning System) module that receives its location every two
minutes from the satellite and sends it to the software servers via the GSM
modem. Software servers analyze the information after receiving it. In this
part of the project, a web application was developed to process the trans-
mitted data and then store it in a database and finally convert the stored
information to visible to users. This allows you to see the speed, direction of
movement, and the object’s locations on the map. Furthermore, a heatmap
was implemented to show the frequently visited places by users.
Contents
1 Introduction 1
4 Future Work 21
5 Conclusion 22
References 23
6 �Appendix 24
i
List of Figures
ii
Chapter 1
Introduction
The concept of the Internet of Things refers to objects with a unique iden-
tity and the ability to transmit data over the network, without the need for
human interaction and intervention. Its primary purpose is to make objects
intelligent and provide a platform through which objects can send and receive
information. The Internet of Things (IoT) refers extensively to the devel-
opment of computing capabilities and network communications of objects,
devices, sensors, or any other item that is not typically considered a com-
puter. These smart objects can collect, analyze and manage data remotely
[1].
The Internet of Things is a wide range of sensors and actuators that
measure and process various environmental conditions. In recent years, IoT
technology has grown significantly and has met many complex needs in var-
ious fields. Due to the expansion of new technologies, the production of
intelligent sensors, the growth of communication technologies, and the com-
plexity of requirements, the Internet of Things has gained a lot of power. It
has led to the expansion of intelligent systems in the environment [2].
These systems must interact with each other to have a positive impact on
the environment. IoT-based technologies have different requirements com-
pared to other technologies. Typically, these systems have less memory,
power consumption, and bandwidth than other systems. Most smart sys-
tems are battery-powered and located in a remote location where they cannot
be charged continuously. As a result, the power consumption and coverage
range for these systems, especially those implemented at the macro level,
such as smart farming, smart city and home, and tracking issues, is very
important. There are several wireless communication protocols, each with
its unique characteristics.
The Internet of Things is a new communication platform for commu-
nicating between intelligent objects. The introduction of this platform has
1
provided new facilities for solving problems, such as locating and tracking
moving objects from vehicle attacks at the city, region, or country level. The
Internet of Things (IoT) is rapidly gaining access to telecommunications sce-
narios, and it is expected that the exchange of information in global resource
chains will facilitate.
Widely, Internet of Things can be used as the mainstay of pervasive
systems and the activation of intelligent environments for ease in identifying
objects and retrieving information from the Internet. From a conceptual
point of view, the Internet of Things relies on three principles related to
intelligent objects’ ability: Ability to identify, transfer and interact either
among themselves or with other users. Objects are usually classified either
individually or as a member of a category.
One of the most important issues today is the tracking of moving objects,
which refers to the immediate tracking of a specific moving object’s current
position. Moving object tracking systems is a solution to many problems,
including security issues. It is a technology used to determine the location
of an object.
One of the important applications of IoT is tracking systems that are
used in various technologies. Tracking systems were developed for the trans-
portation industry. One of the basic needs of the owners of this industry is to
check the position of vehicles. The earliest systems for locating were passive
systems that stored information in memory and could only be accessed when
a vehicle was available. These systems are not suitable for real-time applica-
tions because they need to provide information to the user immediately. For
solving this issue, active systems were created that allow the use of in-vehicle
hardware and remote tracking servers.
Today, the safety of people and vehicles has become a public concern.
The tracking system has provided reliable solutions to ensure people’s and
vehicles’ safety. It has a significant impact on optimizing the quality of moni-
toring and management of public transportation, vehicle movements, people
(children and the elderly), or It has every other moving object. Tracking
system is a technology that makes it possible to determine the exact posi-
tion and track of people, vehicles, or any other moving object using various
methods such as the Global Positioning System [3].
In addition to vehicles, tracking systems also play an important role in
remote monitoring and environmental monitoring applications. For example,
tracking animals, humans, and locating objects are some of this system’s
applications. In human monitoring, this system can be beneficial for the
elderly who have certain diseases such as Alzheimer’s and are more likely to
get lost, or for the safety of children. Families can use this system to find
the position of their elderly or child [4].
2
The system we have implemented in this project can be used in various
cases. One of the applications that can be imagined for the Internet of Things
is implementing a system that can determine the exact position and path of
each moving object at any time. In this project, we intend to build a tracking
system that can identify a moving object’s exact position and path.
In this project, our communication will be one-way in that the coordinates
of the moving object are continuously measured by the GPS module and
sent to a server. This module is continually connected to the satellite to get
coordinates. GPS data is sent to the Arduino. Finally, the GSM modem
sends this information to the software server. In this project, the software
servers analyze the information after receiving it, and we will not have a
request from the server since our communication will be one-way. In this
part of the project, web-based software will be developed to process the
submitted information, store it in the database, and finally convert the stored
information into a display for users. An application written using stored data
displays the location on a map. In this way, the object or person can be
found at the current time. In the end, the current position and direction of
the person will be displayed on the map. Another application of this system
is to obtain high-traffic locations by analyzing the collected information.
In the continuation of this dissertation, we talk about the general ar-
chitecture of the tracking system and its components. Then, we introduce
the implementation method of this system using the mentioned components.
Finally, we talk about the results of the system implementation and what
can be done in the future based on this project.
3
Chapter 2
The main goal of our project is to design and implement a system that
can determine the exact position of each moving object at any time. The
mentioned system should be cost-effective in addition to proper performance.
To design such a system, we must first identify the system requirements
and the overall architecture of the system we want. Then we use this archi-
tecture to implement the appropriate modules. In this chapter, in section
2.1, we first explain the general design of the tracking system and then in
section 2.2, we introduce the components used in this design.
4
As we have seen, the architecture of our system has four main parts. The first
part is about locating the object from the satellite using the GPS module.
The second part is related to sending the received information to the server
using a GSM modem. The third part is the development of an application
that uses the received data to display the location of the object on the map.
Figure 2.1 shows an overview of the designed system architecture and the
relationship between its parts. �For selecting the modules, it is necessary to
know the task of each section accurately and choose the desired module for
it [7].
• In the first part, we need to measure the location of the object con-
tinuously. As soon as the object moves, the GPS module consistently
receives the moving object’s coordinate from the satellite. The signal
received from the satellite is weak, so we must use an antenna to am-
plify the desired signal, and at the end, sends the amplified signal to
the Arduino board.
• In the second part, the information received from the GPS module is
sent to the server by the GSM modem.
5
Figure 2.2: Architecture of Tracking System[3]
• Arduino module
• SIM808 module
• GPS antenna
• GSM modem
6
any additional software or compiler for coding.
Figure 2.3 shows the Arduino Uno board:
7
2.2.2 Software components
2.2.2.1 Arduino IDE
The software used for programming is Arduino software, which you can see in
Figure 2.5. Using the C language, you can write the required program, and
after compiling, the generated hex code is uploaded on the Arduino. There
are different libraries that make coding easier. The program is written using
this software to receive data from satellite and send it to a mobile phone.
8
Chapter 3
Implementation and
Performance Analysis
9
Figure 3.1: Designed Tracking System
10
Figure 3.2: Performance of implemented code on Arduino [3]
Firstly, for testing the system, the GPS antenna is connected to the SIM
808 module to receive the object’s location (latitude and longitude) from the
satellite. For doing this, the Arduino IDE software is used to program the
code written on the Arduino board.
11
The flowchart 3.3 shows how GPS works:
For sending the object’s location to the user via the GSM network, SIM
808 module and the Arduino microcontroller connected to it are used. For
connecting 808 SIM module to the GSM network, we use AT commands to
program and control it.
12
The flowchart 3.4 shows how GSM works:
13
‘
14
3.2 Circuit Architecture evaluation
In this section, we explain the hardware part of the proposed system. As
mentioned in the previous sections, using GPS antenna connected to the
SIM 808 module, location information is received from the satellite every
two minutes and then sent to the server via the GSM network.
In the following figure, you can see how to connect SIM 808 module to the
Arduino.
The 808 SIM module is connected to the Arduino using a serial interface;
it has two TX and RX pins connected to the 10 and 11 Arduino digital pins,
respectively. The ground pin of this module is also connected to the ground
connection base of the Arduino board. We supply the required voltage of the
808 SIM module through a 9-volt output adapter.
3.3 Application
In the Back-end, a web service with RESTful architecture has been devel-
oped, which stores the received data in the database, and the web application
receives and displays this information.
REST is a web service architecture that uses HTTP to exchange infor-
mation between two systems. The basic idea of this architecture is to use
HTTP to establish information between machines instead of using complex
mechanisms to connect devices.
In this section, we first describe the structure of the database and how to
communicate with it. Finally, we explain the written web application that
shows the path of the object on the map.
15
3.3.0.1 Database
We have used Mongo database to store information and manage the server.
Mongo DB is a NOSQL database that runs on various operating systems, in-
cluding Windows and Macintosh Linux. It also supports most programming
languages. Mongo DB provides high performance, accessibility, scalability,
fast repeatability, and automatic sharing. Due to the NOSQL structure,
Mongo DB only stores and searches data, thus significantly increasing data
acquisition and storage speed.
The database received information from the hardware side. Then we store
this information, including latitude, longitude, time, and date.
16
If we click on any of the markers in the map that indicate the object’s position
at any time, we can see the speed of the object, time, and date in that
position. The following figure shows a view of this output:
Figure 3.8: Display the speed, time and date of movement of the object in
each location on the map
3.3.1.2 SMS
One of the unique features of the implemented tracking system is that you
can send a message to the SIM card number inserted on the SIM808 module
to get the object’s current position. After receiving the message, this module
also receives the object’s location via GPS and sends the necessary infor-
mation for tracking in response to the received message. This information
includes the latitude and longitude and speed of the object. There is also
a link attached to this message that the user can click to view the object’s
location on the map.
17
In the following figures, you can see the message sent and its response
through the designed system:
Figure 3.9: Receive the message sent by the user to receive the location
18
Figure 3-10 shows the message sent to the user.
By clicking on the received link, you can see the current position of the object
on the map.
19
3.4 Information analysis
Using the designed real-time tracking system, we were able to continuously
measure the location of the object and store this information in the database.
Another feature of this system is to get the frequently visited places of a
person in a certain period. To do this, we used the heat map. Heatmaps are
graphic and color data that enable us to identify the behavior of our users. In
this project, we implemented the heatmap using stored information, which
was the location of objects at different times. The most visited places of
a person, which are more frequent in our data set than the others, will be
visible as red areas on the map.
The designed application consists of two maps. �First shows the object’s
positions on the map, and by selecting the Heatmap option, you can view
the heatmap of these points. In Figure 3.12, you can see the high-traffic
locations of the object shown in red color.
20
Chapter 4
Future Work
The GPS antenna has a relatively high power consumption. There are two
proposed ways to reduce power consumption in this system. The first way
that can be suggested for this system is to use machine learning algorithms
to predict the object’s next move. Another way is using LoRaWAN protocol
instead of GPS to locate the object.
Another thing that can be done is to add sensors and actuators to this
system. For example, an accelerometer sensor can be used to monitor the
object’s movement, and only when it is moving, GPS information is sent to
the server, which will reduce power consumption.
A camera can also be installed on the designed system. Consequently, in
addition to the information sent through GPS, we can also use this camera’s
images to monitor the location.
As we have said, one of the features of this system was receiving the
position of the person by sending a message to the SIM card number inserted
in this system. Despite its advantages, it can create security risks for people.
Therefore, it is possible to improve the security of the desired tracking system
and specify that if it receives a message from a specified and predetermined
number, it will send the person’s location. Otherwise, no information will be
exchanged.
This system is designed in such a way that it can be customized for
different applications. For example, we can specify the permissible range
for the movement of the object. Therefore, if the object leaves the specified
range, the system will automatically contact institutions such as police and
minimize human errors.
21
Chapter 5
Conclusion
In this project, our goal was the implementation of a real-time tracking sys-
tem. Therefore, in this project, we implemented a tracking system to monitor
the position of a moving object via SMS as well as online on a map. The core
of the designed system is Arduino board and SIM 808 module. The GSM
modem is controlled using the AT commands and allows the exchange of
information using the GSM network. In this project, GPS module has been
used to find the position of the object. GPS Once every two minutes, the
object’s location is received from the satellite, and this information is sent
to the server. The server sends the received information to the implemented
web service. Finally, data is stored in the database and displayed in the
application, and we can see the path of the object on the map.
The program implemented on the Arduino is written in such a way that
it receives the location of the object using GPS every two minutes and sends
it to the server. On the server side, this information is stored in the Mongo
database. Using this information, we show the path of movement of an object
on the map. The server-side code is written so that it visits the database
every minute, and the map containing the path of the object is updated.
At the end of this project, we were able to design a real-time tracking
system. It is used in various fields, such as tracking vehicles, children and
the elderly, etc. By using it, we will be able to take the necessary actions in
the fastest possible time.
22
References
[1] M. Mukhtar, ”GPS based Advanced Vehicle Tracking and Vehicle Control
System,” International Journal of Intelligent Systems and Applications,
Feb. 2015.
[3] Md. Rahman, J.Mou, K. Tara and Md. Sarkar, ”Real time Google map
and Arduino based vehicle tracking system,” 2016 IEEE Smart Energy
Grid Engineering (SEGE), Aug. 2016.
[7] T. Agrawal and M. Qadeer, ”Tracing Path with Arduino Uno using GPS
and GPRS/GSM,” 2018 International Conference on Computing, Power
and Communication Technologies (GUCON), Sep. 2018.
23
Chapter 6
�Appendix
24
25
26
27
2. Back-end development
28
29
30
31
3. Front-end development
32
33
4. The implemented code for sending and recieving an SMS
34
35