0% found this document useful (0 votes)
111 views15 pages

Accident Detection and Smart Rescue System Using Android Smartphone With Real-Time Location Tracking

This document summarizes a research paper that proposes a system called SOSafe to detect vehicle accidents using Android smartphones and notify emergency services. The system would use a smartphone's sensors like accelerometer and GPS to detect if an accident occurs. It would then send an alert to nearby emergency responders with the victim's real-time location to reduce response times. This could increase survival rates by getting medical help sooner. The full paper describes the system's design and architecture, technologies used like Android and sensors, a review of related work, and test results showing it can detect accidents reliably and notify responders.

Uploaded by

Khalifa Moiz
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)
111 views15 pages

Accident Detection and Smart Rescue System Using Android Smartphone With Real-Time Location Tracking

This document summarizes a research paper that proposes a system called SOSafe to detect vehicle accidents using Android smartphones and notify emergency services. The system would use a smartphone's sensors like accelerometer and GPS to detect if an accident occurs. It would then send an alert to nearby emergency responders with the victim's real-time location to reduce response times. This could increase survival rates by getting medical help sooner. The full paper describes the system's design and architecture, technologies used like Android and sensors, a review of related work, and test results showing it can detect accidents reliably and notify responders.

Uploaded by

Khalifa Moiz
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/ 15

(IJACSA) International Journal of Advanced Computer Science and Applications,

Vol. 9, No. 6, 2018

Accident Detection and Smart Rescue System using


Android Smartphone with Real-Time Location
Tracking
Arsalan Khan, Farzana Bibi, Muhammad Dilshad,
Haider Ali
Salman Ahmed, Zia Ullah
Department of Pharmacy (Pharm-D)
Department of Computer Science and Software Engineering Sarhad University of Science and Technology, Peshawar,
Al-hamd Islamic University, Islamabad, Pakistan Pakistan

Abstract—A large number of deaths are caused by Traffic country. Furthermore, the data shows that deaths per accident
accidents worldwide. The global crisis of road safety can be seen are 55 per cent around the country [3].
by observing the significant number of deaths and injuries that
are caused by road traffic accidents. In many situations the The most likely reason for an individual's death in an
family members or emergency services are not informed in time. accident is lack of the first aid provision that is because of
This results in delayed emergency service response time, which emergency services not receiving information about accident in
can lead to an individual’s death or cause severe injury. The time. Emergency response time is extremely vital when it
purpose of this work is to reduce the response time of emergency involves incidents involving vehicle accidents. Analysis shows
services in situations like traffic accidents or other emergencies that if we decrease just 1-minute in accident response time that
such as fire, theft/robberies and medical emergencies. By can increase chances of saving an individual’s life up to six
utilizing onboard sensors of a smartphone to detect vehicular percent [4]. In order to reduce response time, implementation
accidents and report it to the nearest emergency responder of enhanced traffic technologies would be necessary, which
available and provide real time location tracking for responders will help scale back response time and therefore reduce
and emergency victims, will drastically increase the chances of fatalities.
survival for emergency victims, and also help save emergency
services time and resources. The purpose of this research is to design and implement
such an automated system that uses smartphone to detect
Keywords—Traffic accidents; accident detection; on-board vehicle accidents and report it to the nearest available
sensor; accelerometer; android smartphones; real-time tracking; responders to help counter these emerging problems and
emergency services; emergency responder; emergency victim; reduce casualties as much as possible. The detection system
SOSafe; SOSafe Go; firebase would help reduce fatalities due to vehicle accidents by
decreasing the response time of emergency services. The
I. INTRODUCTION
system will also provide other emergency services like Fire
The number of deaths due to traffic accidents is very high. Brigade, Police Department and Medical emergency services.
Looking at the number of deaths and injuries due to road traffic
accidents shows the global crisis of road safety. Nearly 1.3 In this work we are utilizing android smartphone to detect
million people are killed every year and about 50 million accidents and report it to the nearest available emergency
injured worldwide due to road accidents, which averages to responders with the exact location of victims in emergency. On
3,287 lives lost every day. More than 50 percent of road traffic an emergency responder side, the system will inform
deaths affect young adults between the age of 15-44. Around responders about the incidents that occur near to them and
400,000 individuals under the age of 25 dies in road traffic provide them with real time tracking of emergency victims on
accidents every year. Even in countries with very good road a Google map. This will help emergency responders keep track
safety measures, the number of road accident deaths is getting of victim’s location and rescue them as soon as possible.
higher every year [1]. More than 90% of road traffic deaths This paper is organized as follows: Section II describes the
occur in middle-income countries. In low-income countries the related works that has been done in the field, Section III
figure is even higher. presents various technologies that are utilized in our system,
In Pakistan the last 10 year of statistics shows that an Section IV describes questions related to this work, Section V
average of 15 individuals lost their lives due to traffic accidents presents the architecture and implementation of the proposed
daily. According to data from Pakistan Bureau of Statistics on system, Section VI presents front end design of the proposed
traffic accidents in Pakistan from 2004 to 2013 [2], the overall system, Section VII presents backend design of the system,
deaths in road accidents are about 55 percent, which according Section VIII describes performance results and tests performed
to the specialists is very high. According to the data, total of the proposed system, Section IX presents contributions of
51,416 individuals died in 97,739 road accidents across the this work and finally the last Section X is the conclusion and
future work for the proposed system.

341 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

II. RELATED WORK developing our system. From analysis we found that these
Using smartphones to identify road traffic accidents is not a systems can play a very important role in saving human lives.
new subject. There are completed algorithms for systems A new system is to be developed based on unique features that
which utilizes accelerometer as well as GPS to detect vehicle will help counter emergencies.
accidents using smartphones to detect accidents dates back to III. TECHNOLOGIES UTILIZED
2011. Because there is already a lot done on this subject, what
we decided to do was to develop a complete system that is A. Smartphones
more reliable and have much more functionality than the Smartphones are mobile phones that have considerably a lot
existing ones, designed for the ongoing project in mind. of functionality than a regular mobile phone. they're mobile
In [5] the authors developed a system which used Android computers. Smartphones are powerful and versatile as a result
smart-phones and ODB-II connection in a vehicle. When the of built in sensors, powerful processors, multiple network
system detects an accident, will sends an SMS to emergency interfaces and a high amount of memory for such small
contacts specified by the user, SMS will contain information devices.
about the accident and also a call to the emergency services is B. Android
made automatically. All modern vehicles have ODB-II
connection installed which transmits data about the vehicle in Android is a Linux kernel based open-source mobile
real-time such as acceleration, oil pressure, speed, etc. For the operating system which was developed by Google for phones,
system to work a vehicle must support OBD-II standard. In US tablets, watches, TVs, cars and other electronic devices [10].
and this standard is necessary since 2001, European countries Being open-source, everyone has full access to the Android
have also implemented a version of this standard, so vehicles in source code, with one restriction, it cannot be used for personal
the US and in Europe can use this system and is not available profit or any financial gain. It is the most popular mobile
to all vehicle in other countries. Other than that, upgrading and operating system.
maintenance of this system is very expensive process [6]. Android alternatives include iOS by Apple, Windows
In [7], the authors at the University of Baghdad Iraq Phone, BlackBerry, Symbian and a few others. We chose
developed a system which made use of the accelerometer, GPS Android as it is the operating system that have the most
and microphone to detect accidents. Upon detection of an programming experience with. Android’s market dominance
accident sends an emergency notification to the web server and and cheap application release costs were also deciding factors.
also sends an SMS to the emergency contacts, emergency C. Android Studio
responders have to access the web server to find out about an Android Studio is the primary Android IDE (Integrated
accident. Their system made use of the same sensors and Development Environment). It provides an Android developer
hardware that the algorithm presented in this research work all the necessary tools to develop an Android application. More
makes use of, except for a few features. The main issue with specifically, it allows writing code with auto-completion tools,
this system is that the notifications are sent to a web server and debugging, testing [11], running the code on a physical or a
responders needs to check the web server for accident virtual device and setting programming related or visual
notification, there is no system for individual responder that preferences. Java and XML are the only languages required to
responds to the emergency to track victim’s location and also create Android applications with Android Studio [12]. Android
the system lacks the functionality to send emergency Studio does not have any alternatives worth considering. It is
notification to the nearest emergency center in case there is possible to develop Android applications with Eclipse by using
more than one emergency center in the area. the Android Developer Tools plugin, but it is no longer
In [8], the authors developed a system called WreckWatch supported by Google [13].
which involves reading data from the accelerometer and
D. Java
acoustic data from the microphone to detect accidents. If an
incident has occurred, the application contacts nearby Java is a class based general-purpose, object-oriented
emergency services and provides GPS-coordinates of accident programming language [14]. It is a high-level, strongly typed
location. language with garbage collection that incorporates concepts
from several languages including C and C++, but it is not
In [9], the authors have developed an android application entirely the same. For example, Java does not allow writing
that uses accelerometer sensor to detect accidents. After unsafe code that might cause vulnerabilities and unexpected
sensing the accident, application automatically sends a voice behavior. The main building blocks of a Java application are
message to 108 ambulance emergency response service that is classes, interfaces and packages.
running in India. The issue is that this system is for specific
emergency response services, only applicable in India. Also, E. Accelerometer
the system is prone to increased false positives because there is An accelerometer works by detecting proper acceleration
no filter in place to verify if an accident detected by the affecting the accelerometer to determine the G-forces affecting
smartphone is a real accident or just false alarm due to the accelerometer [15]. Proper acceleration means acceleration
dropping smartphone, etc. that is relative to free-fall [16]. An object in free-fall would as
In this study we looked at various technologies and existing such have no acceleration affecting it while an object at rest on
systems providing us with broad analysis and helped us in the surface of the earth would experience an acceleration of
9,81 m/s2 upwards due to the surface pushing the object

342 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

upwards to negate gravity. Accelerometers in smartphones objects, it automatically supports a large collection of response
bases their functionality on micro-electromechanical-systems types, including converting JSON objects into Plain Old Java
(MEMS), which measure electric currents based on Objects. Alternative of Retrofit is Googles Volley [25], which
compression of a seismic mass, often silicon, caused by is also a HTTP library, for our system we chose Retrofit
acceleration [17]. because it is light weight and has more documentation.
F. Google Play Services L. Backend as a Service
Google Play services provide application developers a Backend as a Service (BaaS) is a hosted backend that has
comprehensive set of useful features, for example, Maps and been premade for developing a web or mobile application.
Google+ sign-in. The services include the Google Play services Developers do not have to write any or much backend specific
client library and the Google Play services Android Package code. It has all the necessary features of a backend and even
Kit. The client library makes it possible to access any feature more features such as Facebook and Google sign-in integration
with a user’s account and deals with different issues that may and cloud messaging are common. The features can be
occur when using the services. The Android Package Kit accessed by documented APIs that simplify the application
communicates with the client library and provides access to a development process.
specific service when necessary. The use of Google Play
services is a must when using Firebase. Important M. Firebase
functionalities in Smart Rescue System, for example, viewing Firebase is one of many implementations of the BaaS
on a map and obtaining a user’s location also rely on the model. Like other BaaS implementations, Firebase provides
services. storage, push notifications, user authentication and a database.
Other than the basic BaaS features, Firebase also give a test lab
G. Google Location API that permits testing a Firebase connected application with
The Google Location Services API [18] is part of Google different configurations and devices. A feature that makes
Play Services, provides a more robust, high-level framework Firebase different from other BaaS implementations is the real-
that automatically chooses a suitable location provider and time database. When new data is added to the database, it
power management. Location Services also provides new becomes accessible instantly to all the users of the application.
features like activity detection which is not provided by
framework API. Developers should consider using Location N. Firebase Cloud Messaging
services API if they are using framework API and also if they FCM (Firebase Cloud Messaging) is another adaptation of
are making their apps location –aware. GCM (Google Cloud Messaging). It is a cross-platform
messaging solution that allows us to reliably deliver and
H. Android Google Map API receive messages without any cost. Using FCM, we can send
The Google Maps Android API is a service which is part of notification messages in order to re-engage users. [26].
the Google Play services library. Allows access to Google
Maps server automatically, displaying map, downloading data, O. GeoFire
and map gesture response. It also allows to add markers, GeoFire is an open-source library for Android/Java that
polygons, and basic map overlays, and to transition the user's allows us to save and query a set of keys according to their
context of a specific map area [19]. geographic location. At its core, GeoFire simply saves
locations with string keys. Its main advantage however, is that
I. Google Places API Web Service it allows querying key in a specific geographic area in real
The Google Places API Web Service is a service which time [27].
returns information about places like locations, geographic,
establishments and prominent points of interest using HTTP IV. RESEARCH QUESTIONS
requests [20]. The main alternative of Google Places API is Sr.no Research Questions Motivation
Foursquare Venues. In free version Google Places allows What are the benefits of
This question will elaborate the
150000 queries per day [21] and Foursquare Venues allows 1 pros and cons of accident detection
such system?
120 000 queries per day [22]. These two services are mostly system.
This research aims to provide a
similar, we chose Google Places API because we were more What are the research complete system for both
familiar and experienced using it. 2
contributions? emergency victims and emergency
responders.
J. Google Directions API
The Google Directions API [23] is a service that uses V. SYSTEM OVERVIEW
HTTP request to calculate distance between locations. When The designed system consists of:
calculating directions, the API returns the most economic
routes. The API decides which route is most efficient on the  SOSafe: An android application for emergency
basis of travel time, number of turns, distance, etc. victims.
K. Retrofit  SOSafe Go: An android application for emergency
Retrofit [24] is a type-safe HTTP client for Android and responders.
Java, provided by Square. Retrofit makes it easy to  Firebase: as Server, Database, File Storage, Cloud
communicate with a web server and get back data, as java Messaging, Auth.

343 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

A. Used Services location and will send an alert notification to the nearest
a) Google Play services emergency responder (containing victim’s location) using
FCM. SOSafe will also send SMS to the emergency contacts
b) FCM (Firebase Cloud Messaging) services. containing location of the victim. When emergency responder
c) Firebase Realtime Database accepts the request sent by victim, SOSafe will show real time
d) Firebase Authentication location tracking of responder to the emergency victim on a
e) Firebase Storage Google map. SOSafe will also provide details about responders
(name, vehicle number, phone, etc.).
f) Google API Client
g) Google Maps API In case of other emergencies users can select the type of
emergency he/she is in (Fire, Ambulance, Police), then by
h) Google Location API
pressing panic button the system will search and notify nearest
i) Google Direction API responders available for the selected type of emergency.
j) Google Places API
2) SOSafe Go
k) Retrofit
The system also consists of an application for emergency
B. Use Case Diagrams responders. Responders will be able to select the type of
emergency services they provide and other information related
1) SOSafe
to it. This application will show emergency notifications that
are sent by emergency victims and provide real time location
tracking of their locations. In case of medical emergencies, the
system will also guide responders to a nearest hospital from
emergency location.

Fig. 1. SOSafe use case.

0 shows the Top-Level Use Case of SOSafe, which


indicates the user’s full interaction with the system. It shows
the user is firstly registering himself, user can then log in to the
system using firebase email and password authentication.
He/she can view/update his profile at any time after Fig. 2. SOSafe go use case.
authenticated. The user can turn on Automatic Monitoring
which will register an accelerometer service running in the Fig. 2 shows the Top-Level Use Case of SOSafe Go, which
background, it can now detect all kinds of jerks produced by indicates the emergency responders’ full interaction with the
the user on his/her smartphone and correctly differentiate system. It shows the responders firstly registering themselves,
between accidents and normal routine jerks. responders can then log in to the system using firebase email
and password authentication, responders can view/update thier
Upon detecting the right accidents, the system will generate profile at any time after authenticated. Emergency responders
an alert containing an alarm sound on the emergency victim’s can then receive emergency requests from emergency victims
phone. users will be able to cancel sending alert to emergency using FCM.
responders in case of false alert (accident didn’t occurred)
under 15 seconds. SOSafe will get victim’s location using When SOSafe Go receives emergency requests, an alert
Google Location API and save it to firebase real time database, with sound and vibration triggered will be shown with location
then search for nearest emergency responders from victim’s of the emergency. When requests are accepted by the

344 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

responders, responders will be able track the location of SOSafe GO will guide responders to the nearest hospital from
emergency victims in real time on a Google map with shortest emergency locations by utilizing Google Places and Google
route to location of emergency victims using Google Directions API.
Directions API. SOSafe Go will also show details about
victims (name, address, blood group, etc.) when emergency C. Activity Diagram
victim is rescued, if victims are in need of medical assistance 0 is showing the sequence of activities held in the system.

Fig. 3. Overall system activity diagram.

345 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Fig. 4. System sequence diagram.

D. Sequence Diagram also deal with unexpected scenarios like when there is no
In 0, sequence diagram shows the sequence in which responder available and avoiding false positive.
emergency victims’ application, Firebase and responders’ F. Algorithm for Accident Detection
application are performing their work.
Algorithm that uses on-board accelerometer sensor of a
E. Firebase as Backend smartphone to detect accidents was developed for our system
The brain of the whole system is Firebase. Firebase in this research work. The question is that what to do with the
Authentication is used to authenticate users by Email and values that are being generated by the accelerometer sensor and
Password. Firebase Authentication also provides a number of setting a threshold value that will trigger the accident alert.
Authentication API’s like Google, Facebook, GitHub, etc. All Accelerometer delivers acceleration values for each of the three
information about emergency victims and emergency axes. Accelerometer values are based on (1).
responders (availability, location. etc.) are stored at Firebase ∑
database. Information about emergency requests sent from ( )
emergency victims’ side is also stored and is processed by
matching attributes of the request to a nearest emergency
responder available. A notification message about emergency Equation (1) shows that the acceleration values that an
request is then sent to the available responder through FCM. accelerometer sensor ( ) generates is force ( ) divided by
Firebase is used to store real time location data, using GeoFire mass (m) which is affected by gravitational acceleration (-g).
library for Firebase. Firebase Cloud Messaging is used to Acceleration for each axes (ax, ay, az) is derived based on (1).
exchange data and send notifications between emergency
victim’s app and emergency responder’s app. The system will Now we will use Pythagorean Theorem to derive values
from accelerometer as shown in (2).

346 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

By using the value of (a) we can calculate the value of g-


force (gravitational force). Equation (3) shows how g-force is
calculated.

Equation (3) shows that g-force value is calculated from


acceleration (a) divided by gravitational acceleration (G). G-
force value will be approximately 1 if smartphone is resting on
a table and will exceed 1 if the device is moving. Accidents can
be detected by checking if g-force value exceeds a specified
threshold, which in our system will be 4g, which then will
generate an emergency alert.
G. Avoiding False Positives
Since accident detection system that uses smartphone can
dispatch emergency services, it is necessary to avoid false
alerts. Differentiating between accidents that occurred versus
dropping your phone or sudden stop is relatively hard due to
smartphone mobility. If the system cannot analyze and avoid Fig. 5. Log in screen (SOSafe).
false positives precisely, but can make it meaningless by
wasting emergency services resources on false incident reports.
We have added some features to improve our systems
reliability, accuracy and avoid false positives.
1) Acceleration filter prevents false positive:
SOSafe will not trigger emergency event if the G-force
value is below 4g. This value can detect accident but will avoid
triggering emergency event on dropping a smartphone or
sudden stop.
2) Count down timer alert to prevent false positive:
In case the system detects an accident, the system will
generate a countdown alert dialog with sound and vibration for
15 sec. in case of false alert (accident didn’t occur) the user
will be able to cancel sending emergency alert to emergency
responder under 15 secs. This will help in reducing false
positive, as the user will be able to cancel sending an
emergency notification in case of false event.
VI. FRONT END DESIGN
A. SOSafe
Fig. 6. Sign up screen (SOSafe).
Emergency victims’ side application SOSafe is developed
in Java programming language using Android Studio as IDE. Fig. 5 shows log in screen of SOSafe, users can use email
This prototype application is developed for android operating and password that they used to register, to log in to the system.
system having a minimum API level 17, and target API level After users logs in to the system, they will be able to use all
26. The application is fully working and implemented on the system features.
Android smartphone.
Fig. 6 shows sign up screen of SOSafe, users provides
email, password and other details (name, phone and blood
group) in order to register. After registration all information
will be saved at Firebase database.

347 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Fig. 9. Panic button (SOSafe).


Fig. 7. Navigation drawer (SOSafe).

Fig. 10. Auto monitoring/auto accident detection (SOSafe).

Fig. 8. Home screen (SOSafe).


Fig. 9 shows Panic Button feature of SOSafe, users can
select the type of emergency service and press “Request
Fig. 7 shows navigation drawer of SOSafe, users can view Emergency” button to manually send an emergency request to
history of previous emergencies, update their information, add selected emergency service responder near to them.
emergency contacts numbers, change password and sign out. Fig. 10 shows, users of SOSafe can turn on “Automatic
Fig. 8 shows home screen of SOSafe, user can turn on Auto Monitoring”, the system will register an accelerometer service
Monitoring for automatic accident detection or send emergency running in background; it can now detect accidents.
request manually.

348 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Fig. 11. Panic button alert dialog (SOSafe).


Fig. 13. Responder details (SOSafe).

Fig. 12. Accident detected alert dialog (SOSafe).

In Fig. 11, when user of SOSafe presses the panic button,


the system will present an alert dialog to confirm the action
before sending an emergency request to responder, this will
help in situations when panic button is pressed accidently. Fig. 14. Real time tracking of responder (SOSafe).

In Fig. 12 when SOSafe detects an accident, will present an Fig. 13 shows, when an emergency request sent by
alert dialog with a 15 sec count down timer, in case of false emergency victim is accepted by emergency responder,
alert the user can abort sending request by pressing “Cancel” SOSafe will show details about that responder to the victim.
button. If there is no response from the user in 15 sec, it will be
considered as an actual accident and the system will send an In Fig. 14, SOSafe will show real time location of
emergency alert to the nearest emergency responder and also to emergency responder on a Google map to the emergency
the emergency contacts. victim.

349 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

B. SOSafe Go
Emergency responders’ side application SOSafe Go is
developed in Java programming language using Android
Studio as IDE. This prototype application is developed for
android operating system having a minimum API level 17, and
target API level 26. The application is fully working and
implemented on the Android smartphone.

Fig. 17. Home screen (SOSafe Go).

Fig. 15. Log in screen (SOSafe Go).

Fig. 16. Sign up screen (SOSafe Go).


Fig. 18. Navigation drawer (SOSafe Go).
Fig. 15 shows log in screen of SOSafe Go, emergency
responder can use email and password that they used to Fig. 17 shows home screen of SOSafe Go, responders can
register, to log in to the system. After emergency responders turn on the switch to go Online, responders can now receive
logs in to the system, they will be able to use all system emergency requests sent by emergency victim.
features. Fig. 18 shows the navigation drawer of SOSafe Go,
Fig. 16 shows sign up screen of SOSafe Go, emergency emergency responders can view history of previous
responder needs to provide email and password and name in emergencies, update their information, change password, and
order to register. After registration all information will be select the type of emergency services they provide, e.g. Fire
saved at Firebase database. Brigade, Police Department or Ambulance.

350 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Fig. 21. Real time tracking of victim (SOSafe Go).

Fig. 19. Emergency alert screen (SOSafe Go).

Fig. 22. Nearby hospital route (SOSafe Go).

In Fig. 21, SOSafe Go will show real time location of


emergency victim on a Google map to the emergency
responder.
In Fig. 22 shows, upon rescuing emergency victim, if the
victim is in need of medical assistance, SOSafe Go will guide
emergency responders to the nearest hospital from emergency
location.
VII. BACK END
Fig. 20. Victim’s details (SOSafe Go). In our proposed system we used only cloud-based server
Firebase for data storage, user authentication, file sharing,
In Fig. 19, when SOSafe Go receives an emergency location sharing and push messaging. Here we will discuss
request, the system will show an emergency alert screen to the how firebase is utilized in our system.
responder with sound and vibration turned on. Emergency
A. User Authentication
responder can press “Navigate” button to get direction to the
emergency location. 1) Registration
In case of registering to the system user has to provide
Fig. 20 shows, when an emergency request by emergency name, email address, password, phone, etc. Once user is
victim is accepted by emergency responder, SOSafe Go will registered into the system a passive user id will be generated
show details (name, phone, blood group, and address) about and this id will always be used to identify user and access
that emergency victim. backend.

351 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Fig. 23. User authentication database snapshot.

2) Log In 3) Tokens
User has to provide email and password to login. Once the Is an id issued by Firebase Cloud Messaging connection
user is logged in, it is not necessary to login every time unless servers to client applications allowing it to receive messages.
user is logged out. The firebase authentication system provides Tokens will be used to send notification messages to both
the user id which is synced with a device token that matches responder and victim. Fig. 26 shows the node in Firebase
the user authenticity. Fig. 23 shows registered users, these database where tokens for each user will be saved.
users are authenticated and can log in to the system to use all
system features.
B. Real Time Database
1) Responders
Fig. 24 shows the node in Firebase database where real time
location data of responders currently online will be saved.

Fig. 26. Tokens database snapshot.

4) RespondersInformation:
In Fig. 27, when SOSafe Go user signs up, all information
about that responder will saved under this node in Firebase
database. It will contain details about responders like, name,
email, phone, emergency service type, vehicle number, history,
etc.

Fig. 24. Online responders database snapshot.

2) PickupRequest
In Fig. 25, this node in Firebase database will contain
emergency requests that are sent by emergency victims, with
their location. Each request will be created with a separate
child node using the id of victim that sent the request.

Fig. 27. Responders information database snapshot.

5) VictimsInformation
In Fig. 28, when a SOSafe user signs up, all information
about that user will saved under this node in Firebase database.
It will contain details about victims like, name, email, phone,
Fig. 25. Emergency requests database snapshot. blood group, history, etc.

352 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

emergencies, the system also provides functionality to send


request to the desired emergency service.
From emergency responder’s point of view, the application
will show the location of the emergency that occurs near to
them, this will help in reducing response time, so that they will
be able to track victims in real time and rescue them as soon as
possible, resulting in a more efficient usage of emergency
services resources.
We conducted some tests by dropping a smartphone from
height of 10, 15, 30 and 40cm and recorded the g-force values
which can be seen in Table I.
We also mounted the smartphone in a car and recorded g-
force value during sudden brakes while driving. Due to limited
resources and lack of vehicle crash test labs in Pakistan we
were not able to test our system by conducting a real vehicle
crash test, but the tests we have done by applying sudden
Fig. 28. Victims information database snapshot. brakes in a vehicle, are somewhat close. The results can be
seen in Table II.
6) History
In Fig. 29, this node in Firebase Database will contain TABLE I. G-FORCE DURING FREE FALL
information about previous emergencies that each responder
Height Max Min Average
has successfully responded to. It will contain victim id,
responder id, location, destination, time, etc. for each 10 cm 2.484621402 1.126285167 1.805453284
emergency. 15 cm 2.568356721 1.201817380 1.885087050
30 cm 2.981591310 1.766139158 2.373865234
40 cm 3.315491403 2.041593813 2.628542608

Table I shows the results from our drop testing we drop


tested a smartphone as many as 10 times and recorded the
results, we recorded that accidently dropping smartphone will
not cause the system to generate an alert. The maximum g-
force value we got in our testing by dropping smartphone from
the height of 40cm was 3. 315491403. Our system will
generate alert if the g-force value exceeds 4g.

TABLE II. G-FORCE WHILE APPLYING BRAKES IN VEHICLE.

Brakes Max Min Average


Hard 3.025675430 2.220679102 2.623177266
Normal 2.357143091 1.301464250 1.829303670

Table II shows the results from testing by mounting a


smartphone in a vehicle and applying brakes while driving,
even in situation like applying sudden brakes in a vehicle the g-
force values were lower than g-force during dropping a
smartphone. The maximum value we got by applying sudden
Fig. 29. History database snapshot. brakes in vehicle while driving was 3.025675430, which is
lower than our critical threshold value. The threshold value at
VIII. RESULTS AND DISCUSSION (RQ1) which our system will generate emergency alert is set to 4g,
because during fatal traffic accidents the g-force value exceeds
From emergency victim’s point of view, during fatal
4g. It can detect when an accident occurs but will avoid false
accidents, emergency victims usually are not able to call an
positives in case of dropping a smartphone or applying sudden
ambulance by themselves, in these situations the designed
brakes in a vehicle.
system will automatically detect the accident and will send an
emergency notification to the nearest emergency responder IX. RESEARCH CONTRIBUTIONS (RQ2)
available, to hopefully save victim’s life. Sending an
emergency alert is a lot easier and convenient because all Many systems exist that uses conventional in vehicle
essential functionalities reside together. In case of other sensors and also some work done in the field of Smartphone
based accident detection systems, we aim to develop a

353 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

Smartphone based accident detection system with much more in combination with accelerometer for accident detection like
features and better user experience. We developed a complete gyroscope, microphone, camera (to automatically take pictures
system for both emergency victims and emergency responders. of the accident) and a voice recognition module to detect
The system uses on-board sensors of a typical Smartphone to noises during a vehicle crash like noise when air bags are
detect accidents and report it to nearest emergency responders. deployed, will drastically increase the reliability and accuracy
Emergency responders will be able to track the exact location of the system.
of the victims on a Google map. The system also provides help REFERENCES
during other types of emergencies like Fire, Police etc. With
[1] Asirt.org. (n.d.). Road Crash Statistics. [online] Available at:
innovative and creative ideas, we intend to take the system to http://asirt.org/Initiatives/Informing-Road-Users/Road-Safety-
another level, staying a step ahead from system which pre- Facts/Road-Crash-Statistics [Accessed 10 Dec. 2017].
exists. [2] Pbs.gov.pk. (n.d.). Traffic Accidents (Annual) | Pakistan Bureau of
Statistics. [online] Available at: http://www.pbs.gov.pk/content/traffic-
The proposed system will provide much more accidents-annual [Accessed 11 Dec. 2017].
functionalities than the existing systems like. [3] Traffic accidents kill an average 15 people in Pakistan daily. (2015).
[Blog] Available at: https://www.thenews.com.pk/print/58036-traffic-
 Directly sends emergency notifications to the nearest accidents-kill-an-average-15-people-in-pakistan-daily [Accessed 11
available responder. Dec. 2017].
Evanco and William M., “The Impact of Rapid Incident Detection on
 Real time location tracking for both responders and [4]
Freeway Accident Fatalities", technical report available from Mitretek ,
victims on a Google map. McLean, Virginia, USA, report No .WN 96W0000071, June 1996.
 An android application for emergency responders that [5] J. Zaldivar, C. T. Calafate, J. C. Cano and P. Manzoni, "Providing
accident detection in vehicular networks through OBD-II devices and
directly receives notifications about the emergency that Android-based smartphones," 2011 IEEE 36th Conference on Local
occurs near to them and is provided with real time Computer Networks, Bonn, 2011, pp. 813-819.
location of the victim and is also provided with the [6] Shahbaz Ahmed Khan Ghayyur, Salman Ahmed, Mukhtar Ali, Adnan
details about victim such as name, blood group, Naseem, Abdul Razzaq and Naveed Ahmed, “A Systematic Literature
address. Review of Success Factors and Barriers of Agile Software
Development” International Journal of Advanced Computer Science and
 Provide directions to the nearest hospital during Applications(IJACSA), 9(3), 2018.
medical emergencies. [7] Zainab S. Alwan Hamid M. Ali. “Car Accident Detection and
Notification System Using Smartphone”. In: International Journal of
 Provide other emergency services such as Fire Computer Science and Mobile Computing 4.4 (Apr. 2015), pp. 620–635.
Department, Ambulance and Police. [8] J. & Dougherty B. & Albright A. & Schmidt DC Chris T. & White.
“WreckWatch:Automatic Traffic Accident Detection and Notification
X. CONCLUSION AND FUTURE WORK with Smartphones”. In: Journal of Mobile Networks and Applications
manuscript(2011).
In this research, we developed the accident detection and [9] Patel K.H., "Utilizing the Emergence of Android Smartphones for
smart rescue system, which uses on board accelerometer sensor Public Welfare by Providing Advance Accident Detection and Remedy
to detect accident and generate emergency alert and send it to by 108 Ambulances", International Journal of Engineering Research &
the nearest emergency responder and will also send an SMS to Technology (IJERT), Vol.2, Issue 9, PP 1340-1342, September – 2013.
emergency contact containing location coordinates of the [10] Chao Wang, Wei Duan, Jianzhang Ma and Chenhui Wang, "The
accident. With real time location tracking for both victim and research of Android System architecture and application programming
" Proceedings of 2011 International Conference on Computer Science
responder the system will drastically increase the survival rate and Network Technology, Harbin, 2011, pp. 785-790.
of an accident victim by providing emergency aid in time. The
[11] Shahbaz Ahmed Khan Ghayyur, Salman Ahmed, Adnan Naseem and
system will also provide help during other emergencies such as Abdul Razzaq, “Motivators and Demotivators of Agile Software
during fire, robberies/theft and other medical emergencies. Development: Elicitation and Analysis” International Journal of
Emergency responder will be able pin point victim’s location Advanced Computer Science and Applications(ijacsa), 8(12), 2017.
on a Google map in real time. [12] Android Developers. (n.d.). Meet Android Studio | Android
Developers. [online] Available at:
The probability of false positives in a smartphone-based https://developer.android.com/studio/intro/ [Accessed 17 Dec. 2017].
accident detection and rescue system is inevitable. We have [13] Android Developers. (n.d.). ADT Plugin (UNSUPPORTED) | Android
added some features to reduce these issues. Here are some Developers. [online] Available at:
features we added to reduce false positives. https://developer.android.com/studio/tools/sdk/eclipse-adt [Accessed 17
Dec. 2017].
 Acceleration filter: The system will ignore g-force [14] Gosling J., Joy B., Steele G., Bracha G., Buckley A. The Java Language
values lower than 4g. Specification. Java SE 8 Edition. New Jersey: Pearson Education. 2014.
[15] Dimension Engineering LLC. A beginner’s guide to accelerometers.
 Count down timer alert: On detection of an accident 2017. [online] Available at:
the system will present an alert dialog with 15 sec https://www.dimensionengineering.com/info/accelerometers [Accessed
count down, which the user will be able to cancel in 1 Jan. 2018].
case accident didn’t occur. [16] Edwin F. Taylor & John Archibald Wheeler. “Spacetime Physics”. In:
1st ed. Vol. 1. 1. San Francisco: W.H. Freeman, July 1966. Chap. 1, pp.
For future work, more research is needed in order to make 97–98. ISBN: 071670336X.
the accident detection part more reliable and accurate which [17] James B. Angell & Stephen C. Terry & Phillip W. Barth. “Silicon
will help in reducing false positives. Adding additional sensors Micromechanical Devices”. In: Scientific American 4.4 (Apr. 1983), pp.
44–55.

354 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 9, No. 6, 2018

[18] Android Developers. (n.d.). Location and context overview | Android https://developer.foursquare.com/docs/api/troubleshooting/rate-limits
Developers. [online] Available at: [Accessed 15 Jan. 2018].
https://developer.android.com/training/location/ [Accessed 4 Jan. 2018]. [23] Google Developers. (n.d.). Developer Guide | Directions API | Google
[19] Google Developers. Overview | Maps SDK for Android | Google Developers. [online] Available at:
Developers. [online] Available at: https://developers.google.com/maps/documentation/directions/intro
https://developers.google.com/maps/documentation/android-sdk/intro [Accessed 4 Feb. 2018].
[Accessed 4 Jan. 2018]. [24] Square.github.io. (n.d.). Retrofit. [online] Available at:
[20] Google Developers. (n.d.). Overview | Places SDK for http://square.github.io/retrofit/ [Accessed 4 Jan. 2018].
Android | Google Developers. [online] Available at: [25] Android Developers. (n.d.). Volley overview | Android Developers.
https://developers.google.com/places/android-sdk/intro [Accessed 15 [online] Available at: https://developer.android.com/training/volley/
Jan. 2018]. [Accessed 4 Jan. 2018].
[21] Google Developers. (n.d.). Places API Usage and Billing | Places [26] Firebase. (n.d.). Firebase Cloud Messaging | Firebase. [online]
API | Google Developers. [online] Available at: Available at: https://firebase.google.com/docs/cloud-messaging/
https://developers.google.com/places/web-service/usage-and-billing [Accessed 8 Feb. 2018].
[Accessed 15 Jan 2018].
[27] GitHub. (n.d.). firebase/geofire-java. [online] Available at:
[22] Developer.foursquare.com. (n.d.). Rate Limits - Foursquare Developer. https://github.com/firebase/geofire-java [Accessed 26 Jan. 2018]
[online] Available at:

355 | P a g e
www.ijacsa.thesai.org

You might also like