0% found this document useful (0 votes)
34 views

Designand Implementationof Children Tracking Systemusing Io T

The document describes a children tracking system using IoT that consists of a child module and parent module. The child module uses a Raspberry Pi Zero Wireless with a GSM/GPS module to determine the child's location in real-time and send it to a Firebase database in the cloud. The parent module is a mobile app that receives the child's location from the database and displays it on a map. The system sends an alert to the parent if the child leaves a preset safe area and shows the path from the parent's location to the child's location.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Designand Implementationof Children Tracking Systemusing Io T

The document describes a children tracking system using IoT that consists of a child module and parent module. The child module uses a Raspberry Pi Zero Wireless with a GSM/GPS module to determine the child's location in real-time and send it to a Firebase database in the cloud. The parent module is a mobile app that receives the child's location from the database and displays it on a map. The system sends an alert to the parent if the child leaves a preset safe area and shows the path from the parent's location to the child's location.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/336836612

Design and Implementation of Children Tracking System using IoT

Article in Al-Nahrain Journal for Engineering Sciences · October 2019


DOI: 10.29194/NJES.22030172

CITATION READS

1 980

1 author:

Sama S. Samaan
University of Technology - Iraq
10 PUBLICATIONS 26 CITATIONS

SEE PROFILE

All content following this page was uploaded by Sama S. Samaan on 15 July 2021.

The user has requested enhancement of the downloaded file.


Al-Nahrain Journal for Engineering Sciences NJES 22(3)172-179, 2019
http://doi.org/10.29194/NJES.22030172

Design and Implementation of Children Tracking System using IoT


Sama Salam Samaan1

Abstract
Author affiliation: In the past few years, all over the world, crime against children has
1) Computer Engineering been on the rise, and parents always worry about their children whenever
Department, University of
they are outside. For this reason, tracking and monitoring children have
Technology, Baghdad-Iraq.
[email protected]
become a considerable necessity. This paper presents an outdoor IoT
tracking system which consists of a child module and a parent module.
Paper History: The child module monitors the child location in real time and sends the
information to a database in the cloud which forwards it to the parent
Received: 17th March 2019 module (represented as a mobile application). This information is shown
Revised: 23th April 2019 in the application as a location on Google maps. The mobile application
is designed for this purpose in addition to a number of extra functions. A
Accepted: 17th Sep. 2019 Raspberry Pi Zero Wireless is used with a GSM/GPS module on shield
to provide mobile communication, internet and to determine location.
Implementation results for the suggested system are provided which
shows that when the child leaves a pre-set safe area, a warring message
pops up on the parent’s mobile and a path from the current parent
location to the child location is shown on a map.
Keywords: IoT, Database on the Cloud, Firebase DB, Raspberry Pi Z W, GSM
module, GPS module, Python, Android Application.

‫تصممي وتنفيذ نظام مراقبة لالطفال بأس تخدام انرتنت الاش ياء‬
‫سام سالم مسعان‬
:‫اخلالصة‬
‫ شلكت اجلرامئ حبق الاطفال ارتفاعا ملحوظا يف مناطق خمتلفة من العامل مما‬،‫يف الس نوات القليةل السابقة‬
‫ أصبحت مراقبة وتعقب الاطفال ذات‬،‫ لهذا السبب‬.‫يشلك سببا لقلق الوادلين لكام اكنو خارج املزنل مع الاطفال‬
،‫ النظام املقرتح يتكون من جزئني‬.‫ هذا العمل يقدم نظام تعقب لالطفال بأس تخدام انرتنت الاش ياء‬.‫امهية كبرية‬
‫ اجلزء اخلاص ابلطفل يراقب موقع الطفل ابلزمن احلقيقي ويقوم‬.‫الاول يكون مع الطفل واجلزء الثاين مع الوادلين‬
‫بأرسال هذه املعلومات اىل قاعدة بياانت يف السحب واليت تقوم بأرسالها اىل الوادلين (اجلزء الثاين) واملتثل بتطبيق‬
‫ مت تصممي تطبيق للهاتف اذليك‬.‫ هذه املعلومات تظهر َكوقع عىل تطبيق خارطة كولك‬.‫مثبت عىل الهاتف اذليك‬
Raspberry Pi Zero ‫ مت اس تخدام‬.‫واذلي يوفر مجموعة اضافية من الوظائق فضال عام هو مذكور انفا‬
‫ اظهرت نتائ التنفيذ‬.‫ لتوفري اماكنية االتصال املتنقل والانرتنت ولتحديد املوقع‬GSM/GPS ‫ مع‬Wireless
‫ فأن رساةل تنبيه‬،‫للنظام املقرتح انه عندما يصبح الطفل خارج املنطقة الامنة واحملددة سابقا من قبل الوادلين‬
‫سرتسل اىل هاتف الوادلين كام س يظهر عىل خارطة كولك املسار الواجب سلكه من موقع الوادلين احلايل اىل موقع‬
.‫الطفل‬
1. Introduction the Raspberry Pi and it can only be programmed
Children tracking system is used to assure parents using Arduino or C/C++ while the Pi has the entire
that their children are safe from suspicious actions or Linux software stack available and it can be
loss (J. Mohan, 2019). The information related to the programmed using a variety of languages.
child location is sent to a database in the cloud in real To provide an overview of earlier works, some
time and this location is sent directly to an application researches presented by diverse authors are reviewed:
which is set up in the parent’s mobile and this • (Shatha K. Jawad et al., 2009) they designed a
location is shown on Google map. system to work indoor or outdoor. GPS is used for
Compared to Arduino, Raspberry Pi connects outdoor distance computation, while for indoor
easily to the internet. Arduino is not as powerful as

NJES is an open access Journal with ISSN 2521-9154 and eISSN 2521-9162
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License

172
NJES 22(3)172-179, 2019
Samaan

distance computation; the RF signal amplitude 2. System Design


alteration is used. This section describes the conceptual design of
• (Aswathi Dileep et al., 2015) includes a campus, the Children Tracking System as shown in Fig.1. The
a child module and a parent module. When the child system consists of two parts, the child module and
is out of the campus, the child module will send an the parent module. The child module consists of a
alert message to the parent module. A Raspberry Pi Zero - Wireless with a GSM/GPS
microcontroller ATMEGA 162 is used with GSM module. The parent module is represented by an
and GPS module which helps to track the child application running on an android mobile. The child
movements. movement is tracked by the GPS module and the
• (P. SANTHA RAJ and V. ANURADHA, 2016) location is sent in real time to Firebase database on
they designed a system which contains a child module the cloud which forwards it to an application set up
and two receiver modules for obtaining the on the parent’s mobile phone. All this is done via
information about the missing child on periodical Internet using 3G service which is available in the
basis. ARM7 microcontroller, GPS, GSM and Voice GSM module. The Firebase Real-time Database is a
circuit is contained in the child module and the NoSQL, cloud-hosted database. Data is stored as
receiver module includes an Android mobile phone JSON, synchronized and distributed in real-time to
application for the parent and the other as each connected client. When an app is built, all of the
monitoring database in the school control room. clients will share one Real-time Database instance and
• (Mustafa Saeed et al., 2016) they used automatically receive updates of the newest data.
fingerprint verification as tool for children Data remains available when the app goes offline. It
identification. The proposed technique sends SMS is free, easy to use and implement.
though HTTP to the parent.

Real-time data Real-time data

Raspberry Pi Z W Firebase DB Mobile App


Child Module Parent Module
Figure (1): Conceptual Design of the Children Tracking System

3. The Child Module The device’s main storage which contains the OS files
3.1 The Hardware Part (image file), the uploaded code and a log of the
The child module shown in Fig.2 consists of the device’s routes.
following hardware parts: • External microphone and Speaker
• Raspberry Pi Zero - Wireless Used to initiate calls with the device or just to hear
The Raspberry Pi is a common Single Board the device surroundings.
Computer (SBC). It is a complete minicomputer • Battery and Charger
packed into a single board. The introduction of the With many options for outdoors and portable
Raspberry Pi Zero permits the embedding of an Raspberry Pi projects, it’s important to have a flexible
entire computer in smaller projects like the one power solution which helps the Raspberry Pi to run
proposed in this paper. The Raspberry Pi Zero W has outdoors, whatever the project. In this project we use
all the functionality of the original Pi Zero, but comes a power bank (5V).
with added GSM/GPS Raspberry pi modular. The Pi
must be able to use both the GPS and GSM
simultaneously. The modular should be connected to
the pi with no USBs. The Raspberry pi hat/modular
receives AT-COMANDS from the raspberry pi
through IO pins and responds with the appropriate
data (a map location, SMS messages, or call events).
The extension board shown in Fig.2 (b) is simply
plugged onto the GPIOs of the Raspberry Pi. The
RPI Expansion has a SIM card holder.
• SIM Card
We can connect our Pi to the internet through
Ethernet or Wi-Fi.
• SD card
(a)

173
NJES 22(3)172-179, 2019
Samaan

3.2.1 Cycle Part


It is a shell script (bash file) which contains the
essential Linux commands to run the Python codes in
specific time slots and to manage when to turn on
internet connection and when to turn it off. This
cycle was made duo the lack of multiple physical
serial ports in Raspberry Pi; since it has only one that
can run only one task at a time. The internet
connection through 2G cellular networks on the
GSM board uses the serial port to transfer data from
Raspberry Pi to the GSM. On the other hand, to
make use of the GPS, it must communicate with the
Raspberry Pi through the serial port, so now we have
a problem of the usage of that port. As a result, we
divide time between these two processes; first we use
(b) the GPS to get coordinates and save them on the
device storage in a shared file that can be accessed by
other parties, then turn the GPS off, start the PPP
(Point-to-Point Protocol) to establish a direct
connection between the Raspberry Pi and a cellular
tower in order to have an internet connection. If the
connection is established, we start running the
firebase code to send the data to the firebase
database. After sending the data, the PPP connection
is turned off, and the GPS code is started again to get
new coordinates. If we couldn’t establish the internet
connection, the SMS part starts by sending the data
through an SMS message directly to the phone. It
(c) takes approximately 3 minutes to finish one cycle.
Figure (2): The Raspberry Pi Z W Child Module The cycle is shown in the Fig.4.
3.2.2 GPS Part
3.2 The Software Part Using Python to write the GPS code, the
The child module has the following software parts: Raspberry Pi communicates with the GPS modular
• Raspberry Pi Zero W Operating System by AT commands. First, we initialize the modular to
The preferred choice for running the Raspberry start reading coordinates and send them through the
Pi Zero W as a computer is Raspbian, which is the serial port to Raspberry Pi. It sends the latitude,
Pi's official operating system. Raspbian, which is longitude and altitude of the Raspberry Pi. After
Linux based, is a custom-version of Debian that has receiving the data, if it is valid, the data will be saved
been optimized to run on the Pi's hardware. It is used in a shared file on the storage of the Raspberry Pi; in
to run the uploaded code and send/receive our case it is the SD card. The code will run for a
commands and data to the GSM/GPS modular fixed period of time (in our case for 60 seconds) to
through GPIO pins. ensure the data reading operation is completed. After
• The uploaded code that, the GPS code exits, and the cycle continues to
The code is uploaded into the Raspberry pi SD the next Part. Another job for this part is when
card. This code is written in Python. It receives the receiving the data string, it would also include the
child location from the GPS modular (longitude and SIM card status, if there is any received call, it will be
latitude) and forwards it directly to the Firebase detected here. We made the device answer the calls
database. only if they were from the parents' phone numbers.
The reason behind using Python is that it is an 3.2.3 PPP Part
essential programming language hosted on the Point-to-Point Protocol (PPP) is a data link layer
Raspberry Pi. It is a robust language that's easy to use (layer 2) communications protocol used to establish a
and it allows the binding of the project to the real direct connection between two nodes. In this work,
world. A Flowchart that describes how the system is we use Linux as OS so it’s easy to setup and
working is shown in Fig.3. configure the OS to use PPP as the main traffic gate
We divide the code into serval parts that run for all the packets that leave the Raspberry Pi. After
through a cycle, as follow: that, we have two simple commands to turn it on and
• Cycle Part off, we put them in the cycle code, it’s the one that
• GPS Part controls the connection as we mentioned before.
• PPP Part
• Firebase Part
• SMS Part

174
NJES 22(3)172-179, 2019
Samaan

This part of Raspberry Pi code is responsible of


Start reading the data from the shared file, then
establishing a connection with the firebase database
and uploading the data to store it there. In order to
establish the connection with the firebase we need a
database URL, API Key, authentication Domain and
The parent set the Safe storage Bucket, all these essential info are supplied in
Zone in their mobile the code with config variable, then we use a library
phone app named Pyrebase to manage the connection and the
process of uploading the data. After the uploading of
data is done, the code exits, and the cycle continue to
the next part.
3.2.5 SMS Part
Using GPS, the child SMS part is created as a backup plan if there is a
module monitors the failure in the process of connecting the device to the
child location in real time internet. It sends the data only if the device is outside
the safe zone. In an earlier stage, it receives the
coordinates and the radius of the safe zone from the
firebase, so it can calculate the distance between the
current location of the device and the safe zone and
The child current location is sent tells if it's inside or outside the zone. Also, it saves the
to the Firebase DB in the cloud & last known location of the device and sends it if the
forwarded to the app GPS signal is lost within a specific period. In our
scenario it is set to for 2 minutes. This feature can be
enabled or disabled by the parent from the mobile
application, in addition to setting the timeout period.

The current location is 4. The Parent Module


compared with the We developed an android application to represent
the end user interface. It contains the essential
Safe Zone Area
elements to monitor and control the device, register
child info, and set the safe zone location and radius.
We will take a deeper look on the app activities. Each
activity in the app represents an individual interface
layout. The activities are as follows:
• Register device activity
• Enter child info activity
Yes
Out of the • Dashboard activity
Safe Zone
• Map activity
Area?
• Control activity
We use Kotlin as the programing language and
XML to design the interfaces' layouts. All of that is
done using the Android Studio IDE.
A warning message is
No popped up in the parent 4.1 Register device activity
mobile phone It’s the first activity that shows up to the user
when it’s the first they run the application. The user
The app will show the enters the device ID and the phone number that is
location as a marker in associated with the device, it checks the device ID, if
Google map with a direction it is a valid device, it continues to the next activity
to reach the child (the child info activity). Each device has its own
unique ID, to distinguish it between the devices in
the database. If the device's ID was already entered
by another user (parent), the user is asked if they
want to retrieve the child data from the firebase
End database, if they answered with "yes", then it would
go to the dashboard activity, if "no", it would go to
the child info activity. This activity layout is shown in
Figure (3): Flowchart that describes how the system
Fig.5.
is working
3.2.4 Firebase Part

175
NJES 22(3)172-179, 2019
Samaan

Figure (4): Raspberry Pi Code Cycle

4.2 Enter child info activity a notification will be sent to the phone. If the device
In this activity the user enters the child's is still outside, with each data change the notification
information, like the name, age and gender of the will refresh itself. This process will keep working in
child. After the data is entered, it is saved into two the background even if the app isn’t running in the
locations: the first location is the phone memory foreground. The "add new child" button will
(local), and the second location is the firebase navigate the user to Enter info activity to add a new
database (cloud), so that if there is a second user (the child. The "Make call" button is responsible of
other parent) they will have the same data straight making a call between the parent's phone and the
from the firebase database without the need to re- device. The parent can also mute the mic while
enter the data. The activity layout is shown in Fig.6. calling so they can listen to the surroundings of the
4.3 Dashboard activity child without gaining the attention of anyone who is
This is the activity that contains the main near the child. Because of Raspberry Pi's lack for a
elements to control the device functions; it also second serial port (as we mentioned in Cycle part),
shows the child info in the top section of the layout. the call will be detected and answered only in the
The main functions it provides are: GPS part. The "Send alarm" button was created so
• Shows the child info that if the device was lost within a short range or
inside a building (like when you can't find a remote
• Add new child – button
controller), and its GPS coordinates can’t show its
• Show next child info – button specific location, so when the device receives this
• Make a call to the device it is associated with – action it starts making a noise so that the owner can
button find it. The noise will stop after the user pushes a
• Send alarm – button physical button on the device indicating that they
• Map – button found it. The "Battery" icon shows the battery
• Control – button percentage of the device, so if the battery goes low, it
• Battery percentage notifies the user to charge the device. The Dashboard
As a start, this activity (in the background) starts activity is shown below in Fig.7.
establishing a connection with the Firebase database, 4.4 Map activity
and starts listening to data changes. While the device This activity is responsible for showing the
is sending coordinates to the database, the device's location on the map; we used Google maps
applications receives these coordinates, starts services for this purpose. The user can set a safe zone
measuring the distance between the device and the simply by clicking on any location on the map and a
safe zone coordinates (safe zone will be discussed in red circle will be drawn on it, there is also a bar on
map activity). If the device is inside the safe zone, the top to specify the radius of the safe zone circle.
nothing will happen, but if it is outside the safe zone, Once that is done, the circle will be saved on the

176
NJES 22(3)172-179, 2019
Samaan

device memory (local), and on the Firebase database


(cloud), so that the other users that are connected to
the same device can receive the safe zone changes.
Let’s consider the following scenario: the child goes
to school, the parent changes the safe zone from
home area to school area, if the other parent didn’t
know about this change the application will consider
the child is out the safe zone (home area). Because of
that we made the safe zone change on both devices in
real time.
The map activity gives us a new option to
consider, we called it nearby area (yellow circle).
When you and your child are out, you don’t have to
change the safe zone each time to enter a new area;
the app will keep track of the phone location and
calculate the device location for you. If the device is
within 10 meters away from the phone, even if it is
outside the safe zone (red circle), the warning
notification will not be sent.
The map activity layout consists of a few buttons to
make it easy to track each marker on the map, they Figure (4): Register Device Activity
are:
• Mobile loc. To zoom at the mobile's current
location.
• Zone loc. To zoom at the safe zone (red circle).
• Tracker loc. To zoom at the device's current or
last location.
• Get route is created to draw a path between the
mobile's current location and to the tracker's
(device) location, to make it easy to track the
child.

To distinguish between the current location of the


device and its last known location, we made a status
indicator label at the top of the map, it would show
“Live” if the device is sending its location and
“Offline” if the device stops sending its data in a few
minutes (specified period). The map activity layout is
shown in Fig.8 to Fig.11.
4.5 Control activity
Also called the setting activity, is created to set a
number of values in the system, for instance, the
timeout of SMS message, enabling and disabling the Figure (5): Enter Child Info Activity
system and setting the battery warning threshold.
4.6 Firebase Database
Firebase is a Backend-as-a-Service — BaaS —
which developed into a next-generation app-
development platform on Google Cloud Platform.
It’s a Real-time Database. When the device uploads a
new data message to the firebase database, it
forwards this data to the application instantly, the
data message form is shown in Fig.12. The first three
values represent the time of sending the message, and
the last two values represent the latitude and the
longitude. The safe zone structure shown in Fig.13
and the child info is stored as shown in Fig.14.

Figure (6): Dashboard Activity

177
NJES 22(3)172-179, 2019
Samaan

Figure (7): Child Notification Alert Figure (9): Child Out of Safe Zone Area

Figure (8): Identifying Safe Zone Area Figure (11): Path from Parent to Child

Figure (12): The Data Message Form

Figure (13): The Safe Zone Structure Figure (14): The Child Info

178
NJES 22(3)172-179, 2019
Samaan

5. Conclusions
In this paper, an IoT children tracking system is
developed. The implementation originally focuses on
monitoring a child and sending its location to the
Firebase database which forwards this information in
real time to an application which is created for this
purpose and is set up in the parent mobile phone.
The parent will be notified if the child has moved
outside a specific area (Safe Zone Area). In addition
to tracking the child, the app provides a number of
services. The designed system allows the parent to
monitor multiple children at the same time. This
research shows that GSM/GPS tracking technology
is a practical approach for monitoring and tracking
children with the help of Google database service,
Firebase. Except the Internet fee, there is no cost
associated with the presented service.

6. References
1. Shatha K. Jawad, Al-Gawagzeh Mohammed
Yousef and Balkiest Essa Al-Shagoor, "A
Multipurpose Child Tracking System Design and
Implementation", International Journal of Soft
Computing Applications, ISSN: 1453-2277 Issue 4
(2009), pp.57-68.
2. P. Santha Raj and V. Anuradha, "Design and
Implementation of Children Tracking System using
ARM7 on Android Mobile Terminals", international
Journal of Scientific Engineering and Technology
Research, ISSN 2319-8885, Vol.03, Issue.21,
September-2014, Pages:4327-4332.
3. Loganathan.M, Aswathi Dileep and Kamatchi.K,
"Child Tracking System Based on GSM ",
International Journal of Innovative Research in
Science, Engineering and Technology (IJIRSET),
Volume 4, Special Issue 4, April 2015.
4. Rita H. Pawade and Arun N. Gaikwad, "Android
Based Children Tracking System", International
Journal of Science, Engineering and Technology
Research (IJSETR), Volume 4, Issue 6, June 2015.
5. Shubhangi P. Mankar, Monali Pawar and Manisha
Shinde, "Child Tracking System based on GPS
System", International Journal on Recent and
Innovation Trends in Computing and
Communication (IJRITCC), Volume 4, Issue 4, April
2016.
6. A. Saranya, C. Venkatesh and S. Selva Kumar,
"Design and Implementation of Automatic Child
Monitoring (ACM( System Using Wireless Network",
International Journal of Computer Science and
Mobile Computing, IJCSMC, Vol. 5, Issue. 4, April
2016, pg.356 – 363.
7. Maria Clenisha, Sandra, A Pio Sajin and B Baron
Sam, "Survey on Automated Child Monitoring
System Using Image Processing", International
Journal of Pure and Applied Mathematics, Volume
118, No. 24, 2018.
8. J. Mohan, B.Ragul, M. Saravanakumar, Mrs. V.
Hemalatha and Dr. P. Gomathi, "Enhancement Of
Smart Child Monitoring System", International
Research Journal of Engineering and Technology
(IRJET), Volume 06, Issue 02, Feb 2019.

179

View publication stats

You might also like