You are on page 1of 83

Fall detection system for diabetes and epilepsy patient

JIMMA UNIVERSITY
JIMMA INSTITUTE OF TECHNOLOGY
SCHOOL OF ELECTRICAL AND COMPUTER ENGINEERING
(COMPUTER STREAM)
Final thesis
Title: Fall detection system for diabetes and epilepsy patient with
GSM communication and GPS localization

Student name Id
1.Dawit Belachew 00948/05
2.Dawd Fikadu 00943/05
3.Abiyu Abayine 00574/05
4.Yared Mengsitu 02109/05
5.Beiment Sileshi 00810/05
6.Fetiya Ahmed 01111/05
Fall detection system for diabetes and epilepsy patient

DECLARATION OF ORIGINALITY
We declare that this report entitled “Fall detection system for diabetes and epilepsy patient
with GSM communication and GPS localization” is our own work except as cited in the
references. The project has not been accepted for any degree and is not being submitted
concurrently in candidature for any degree or other award.

Group members ID No Date Signature

1.Dawit Belachew 00948/05 _____________

2.Dawd Fikadu 00943/05 _____________

3.Abiyu Abayine 00574/05 _____________

4.Yared Mengsitu 00000/05 _____________

5.Beiment Sileshi 00810/05 _____________

6.Fetiya Ahmed 01111/05 _____________

Advisor
Name: Engr. Kris Calpotura, MSME, MIT
Signature: _______________
Date: 12/05/2017

Submission date 12/05/2017

i
Fall detection system for diabetes and epilepsy patient

Acknowledgment
First, we would like to give appreciation for our advisor Engr. Kris Calpotura, MSME, MIT
who was abundantly helpful and offered invaluable assistance, support and guidance until the
end of the project. We truly appreciate and value his esteemed guidance and encouragement
from the beginning of 4th year lesson (software engineering) and in our entire project including
mini project and CBTP good guidance and motivation. This work will not be true without our
advisor.

Second, we would like to express our deepest gratitude to school of ECE staff and Mr.Fetulhak
chairperson of computer stream for his incredible support during title submission, preparing
required materials and creation of awareness, continuous flow up and motivation for each group
member to participate actively without missing the schedule.

Last but not least, we wish to express our sincere thanks you to all of our friends for their
contribution and ideas sharing during the development of the project.

ii
Fall detection system for diabetes and epilepsy patient

Abstract
Falls is very common danger problem for diabetes and epilepsy patient including elders, when
falls happen, it is difficult to detect the fall at the earliest possible time, which can lead to serious
injury and even fatality. If a patient falls does not get medical assistance with immediate
treatments, even if cultural treatment may be medically not advisable. Therefore, detecting falls
as early as possible is the key to decrease the risk of serious injuries among the patient. In
addition, falls are a major cause of health and psychological problems as well as hospitalization
costs among patients and older adults.

The adoption of automatic fall detection mechanisms can noticeably reduce the response time of
the medical staff or caregivers when a fall takes place. Fall detection system for diabetes and
epilepsy patient with sensor of Accelerometer ADXL345, vibrational sensor SW-420,
temperature sensor LM35, bush button for false detection, GSM communication, and GPS
localization to track the location of patient using Global Positioning System and send the details
information of patient using wireless network (GSM) to their caretakers. Fall detections system
also have help information’s through speaker for the environment. Another futures of this fall
detection system connected with android application for monitoring and preventing fall by
displaying measured sensor value (body temperature, blood pressure, sugar level and heart beat)
of user and give help information based on measured values status. The android application is
connected with fall detections system through serial communication using Bluetooth modem
HC-05.

The aim of this study is to develop a wearable device to detect fall among patient using a
technology that is easy to obtain and keeping the cost low to make it affordable to any user.

iii
Fall detection system for diabetes and epilepsy patient

Table of Contents
DECLARATION OF ORIGINALITY ............................................................................................ i
Acknowledgment ............................................................................................................................ ii
Abstract .......................................................................................................................................... iii
List of figures ................................................................................................................................ vii
List of table .................................................................................................................................. viii
ACRONYMS ................................................................................................................................. ix
CHAPTER 1 ................................................................................................................................... 1
INTRODUCTION .......................................................................................................................... 1
1.1 Background of the Project ..................................................................................................... 1
1.2 Statement of the Problem ...................................................................................................... 2
1.3 Objectives of the Project ....................................................................................................... 3
General objectives ................................................................................................................... 3
Specific objectives ................................................................................................................... 3
1.4 Scope and Limitation of the Project ...................................................................................... 3
1.5 Outline of the Report ............................................................................................................. 4
CHAPTER 2 ................................................................................................................................... 5
Literature review ............................................................................................................................. 5
2.1 Existing Fall Detection Research and Development ............................................................. 5
2.2 iLife™ Fall Detection sensor ................................................................................................ 6
2.3 myHalo™ .............................................................................................................................. 7
2.4 Life Alert Classic .................................................................................................................. 7
2.5 MEMS Accelerometer Technology ...................................................................................... 7
2.6 Arduino.................................................................................................................................. 8
2.7 Sensors .................................................................................................................................. 9
2.7.1 Temperature sensor LM35.............................................................................................. 9
2.7.2 Accelerometer sensor ADXL345 ................................................................................. 10
2.7.3 Vibration sensor sw-420 ............................................................................................... 11
2.8 GSM module SIM 900 ........................................................................................................ 12
2.9 Bluetooth HC 05 module..................................................................................................... 13
2.10 Bush button ....................................................................................................................... 14
iv
Fall detection system for diabetes and epilepsy patient

2.11 Power supply ..................................................................................................................... 15


2.12 LCD display ...................................................................................................................... 15
2.13 Buzzer................................................................................................................................ 16
2.14 GPS receiver ...................................................................................................................... 16
2.15 About MIT Software ...................................................................................................... 18
2.15.1 Introduction MIT app inventor ................................................................................... 18
2.15.2 App Inventor Built-in Blocks ..................................................................................... 18
2.15.3 MIT app development overall block diagram ............................................................ 20
2.15.4 MIT app development software Requirements .......................................................... 20
2.15.5 Building Apps with the Emulator ............................................................................... 21
2.15.6 Starting the Emulator .................................................................................................. 22
2.15.7 App Development with the Emulator ......................................................................... 22
2.16 Android application description ........................................................................................ 22
CHAPTER 3 ................................................................................................................................. 24
Project design and methodology ................................................................................................... 24
3.1 Architecture ......................................................................................................................... 24
3.1.2Types of architecture used for system ............................................................................... 25
3.2 Software Methodology (Rapid Application Development) ................................................ 25
3.3 Method of data collection .................................................................................................... 27
3.3.1 Primary Source ............................................................................................................. 27
3.3.2 Secondary Sources ........................................................................................................ 27
3.4 Tools for Data Analysis ...................................................................................................... 28
3.5 Block diagram of fall detection system ............................................................................... 28
3.6 Software Tools for hardware Design .................................................................................. 29
3.7 Flowchart of fall detection system (Hardware) ................................................................... 30
3.8 Flowchart (Android App) .................................................................................................... 31
3.9 Analog to digital convertor for sensor value ....................................................................... 31
3.10 Advantages of Arduino Uno microcontroller than other types for fall detection system . 33
CHAPTER 4.............................................................................................................................. 34
Discussion of Findings .................................................................................................................. 34
4.1 Profile the nature of fall detections ..................................................................................... 34

v
Fall detection system for diabetes and epilepsy patient

4.2 Problems encountered by the diabetes and epilepsy patient ............................................... 35


4.3 Requirements of the fall detection system .......................................................................... 36
4.4 Hardware Design consideration of the system ............................................................... 38
4.4.1 When fall is detected .................................................................................................... 38
4.4.2 False fall is detected ..................................................................................................... 39
4.4.3 Sensors that are integrated ............................................................................................ 40
4.4.4 Hardware and Android App Integration........................................................................... 41
4.5 Protues simulation of fall detection system ........................................................................ 42
4.6 The developed fall detection system for diabetes and epilepsy patient .............................. 43
4.6.1 Working principle of designed fall detections ............................................................. 43
4.6.2 Business Rules .............................................................................................................. 45
4.7 Software Design and Android app snapshot ....................................................................... 45
4.7.1 Design Home Screen .................................................................................................... 45
4.7.2 Design Screen to send Message.................................................................................... 49
4.7.3 Screen to read Received message ................................................................................. 51
4.7.4 Design Screen to help user ........................................................................................... 53
4.8 Acceptability of the system ................................................................................................. 55
4.8.1 Test acceptability for Hardware (Arduino Code) ......................................................... 55
4.8.2 Software acceptability test for android application ...................................................... 59
CHAPTER 5 ................................................................................................................................. 62
CONCLUSIONS AND RECOMMENDATION ......................................................................... 62
5.1 Conclusions ......................................................................................................................... 62
5.2 Recommendations ............................................................................................................... 63
Reference ...................................................................................................................................... 64
Appendices .................................................................................................................................... 66

vi
Fall detection system for diabetes and epilepsy patient

List of figures
Figure 1: Arduino Uno R3 .............................................................................................................. 9
Figure 2: temperature sensor LM35 .............................................................................................. 10
Figure 3: Accelerometer sensor ADXL345 .................................................................................. 11
Figure 4: Vibration sensor SW-420 .............................................................................................. 12
Figure 5: Gsm sim900 modem ...................................................................................................... 13
Figure 6: Bluetooth HC-05 module .............................................................................................. 14
Figure 7: push button .................................................................................................................... 15
Figure 8: Rechargeable battery ..................................................................................................... 15
Figure 9: Liquid Crystal Display .................................................................................................. 16
Figure 10: Buzzer .......................................................................................................................... 16
Figure 11: GPS receiver module ................................................................................................... 17
Figure 12: block diagram of MIT app development ..................................................................... 20
Figure 13: Architecture of Fall detections system ........................................................................ 25
Figure 14: Software development RAD model ............................................................................ 26
Figure 15: Block diagram of fall Detections system .................................................................... 29
Figure 16: Flow chart of fall Detection system ............................................................................ 30
Figure 17: Flow chart android application .................................................................................... 31
Figure 18: Analog to digital convertors ........................................................................................ 32
Figure 19: Different Section of fall detections ............................................................................. 35
Figure 20: Flow chart for True fall detections .............................................................................. 39
Figure 21: push button flow chart ................................................................................................. 39
Figure 22: Bluetooth interfacing with Arduino ............................................................................ 40
Figure 23:ADXL345 interfacing with arduino uno ...................................................................... 40
Figure 24: SW4_20 interfacing ..................................................................................................... 41
Figure 25: LM35 interfacing ......................................................................................................... 41
Figure 26: Flow chart of Hardware and android connections....................................................... 42
vii
Fall detection system for diabetes and epilepsy patient

Figure 27: Protues simulation of fall detections ........................................................................... 43


Figure 28: over all hardware implementation ............................................................................... 44
Figure 29: Home Screen of fall application .................................................................................. 46
Figure 30: Send Screen Fall application ....................................................................................... 50
Figure 31 Read Screen of fall app................................................................................................. 52
Figure 32: help Screen of fall app ................................................................................................. 54
Figure 33: Cyclomatic flow graph ................................................................................................ 57
Figure 34: Software test Flow graph for androin code ................................................................. 60

List of table
Table 1:A summary of three types of approaches for fall detector [10] ......................................... 6
Table 2: Cyclomatic Graph matrix ............................................................................................... 58
Table 3: Test Case Cyclomatic complexity .................................................................................. 59
Table 4: Graph matrix for the android app ................................................................................... 61

viii
Fall detection system for diabetes and epilepsy patient

ACRONYMS
AC- Alternative Current

ADL-Activities of Daily Living

AFH-Adaptive Frequency Hopping

BP-Blood pressure

CMOS- complementary metal oxide semiconductor

DC-Direct Current

EDR-Enhanced Data Rate

EDA-Event driven architecture

FDS- Fall Detection System

FIFO- Frist In Frist Out

GPS – Global positioning system

GSM –Global Sim Communication Module.

LCD- Liquid Cristal Display

LED-Light Emitting Diode

MEMS- Microelectromechanical systems

OS-Operating System

PWM-Pulse Width Modulation

RAD-Rapid Application Development

RFID-Radio Frequency Identification

SPP-Serial Port Protocol

SMV- Signal Magnitude Vector


ix
Fall detection system for diabetes and epilepsy patient

SIM-Subscriber identity module

SMS-Short Message Service

SUDEP-sudden unexpected death in epileptic patients).

TTFF-Time To First Fix

USB – Universal Serial Bus

x
Fall detection system for diabetes and epilepsy patient

CHAPTER 1
INTRODUCTION

1.1 Background of the Project


Fall is one of the most common event that adversely affects health & hence increases medical
care cost. The fall management is a major challenge in medical care quality. Thanks to latest
technologies that are available to manage the fall mechanism. A fall is nothing but “accidentally
coming to floor, or some lower level not as outcome of sustaining a violent blow, loss of
awareness, sudden onset of paralysis as in caress or an epileptic attack”. [1] Something like 3%
of all fallers stretches out for more than 20 minutes without exterior hold up. [2] The need of
support in the case of unconsciousness or extreme injury is the main reasons why patient leave
the comfort and privacy of their own home to live in an assisted-care environment (40% of
nursing home patient are only fall accident). Fall related injuries are the leading source of death
and hospitalization for diabetic and elliptic people. A fall could cause a medical issue such as
cardiovascular disorder, infection, or chronic ailment to the fallers. The consequent injuries
caused by the fall are the major problem that requires medical attention. In twenty to thirty
percent of mild to severe injuries that have been led by the fall, ten to fifteen percent of these
cases results in the emergency department visit [5]. The main reason of the fall-related hospital
admissions is caused by hip fracture, upper limb and brain injuries [6].

Sensor to overcome the flaws of visual monitoring equipment we thought of devising electronic
sensor which will important to detect fall and send out alert to call for help. If a fallen person is
unconscious and unable to call for help it can lead to permanent injure and even death.
Therefore, there is a need of self-directed fall detectors that are capable of triggering an alarm
automatically without any interference of the victim and transferring this information to a remote
site. So that the fallen person should gets immediate medical help. Based on these problems, the
main aim, of this system is to build up a small, comfortable, and user-friendly device, and
automatic fall detector system that will help diabetic and elliptic people to handle this problem.
In this paper the fall detector system is a real time working model for detecting the fall, by using
accelerometer. It will be accomplished for continuous fall detection and sending an alarm to a
remote terminal. It will consist of GSM attached to this system to transfer the real time condition

1
Fall detection system for diabetes and epilepsy patient

to the respective places (Caretaker, Relatives, Family, and Doctor etc.) As for fall detection
through an accelerometer, the scope of activity is relatively unrestricted; the device is easily
attached to the human body, and the cost of system is low as compared to vision-based method.

There are several researches that were conducted by using accelerometer and gyroscopes as the
sensor for their studies on detecting the falling events [7]. The only difference with each study is
based on their detection approach, which depends on the sensor locations, types, algorithm and
the overall system. Accelerometer is one of the sensors that is pragmatic, inexpensive and
provides a reliable approach to monitor the patient for the detection of the falls [8]. It allows the
development of the fall detector method to become more dependable.

To develop a fall detection device using Arduino as the microcontroller and three-axis
accelerometer as the sensor to detect the sudden changes of acceleration that involved in free
falls and to integrate the GSM modules with the fall detection device to acknowledge the
caregiver or guardian when heavy fall is detected.

1.2 Statement of the Problem


One of the most common problems related to Epilepsy and Diabetes is the sudden fail they cause
to patients. Since the fail is sudden and almost impossible to avoid, it is difficult for both the
patient as well as the people around the patient to provide treatment and help. The patient may be
permanently injured or even die due to lack of proper medical attention at the time. Related to
that people May not aware why the patient falls or how to provide basic medical care like first
aid in case the patient is unconscious. There were some attempts to solve these problems but they
are not good enough due to several limitations. This project is intended to design and build a
device which detects when a patient fails and notify the physician for medical treatment, family
members or friends as well as people around the patient to enable them to provide the patient
with all sorts of supports including first aid.

Nowadays diabetes and epilepsy patient are doing day-to-day activity us other people. Fall may
be happening in their day activity and patient unable to seek for help especially if they are
unconscious or seriously injured. The device that can detect the fall and notify the caregiver is
not yet available [4]. Therefore, a fall notification to caregiver or guardian is essential. Hence, a

2
Fall detection system for diabetes and epilepsy patient

wearable fall detection that can help the patient to summon for help whenever they are
unconscious or unable to get up after a fall by notify the caregiver should be develop.

1.3 Objectives of the Project

General objectives

The general objectives of this project to design, simulate, and implement fall detection system
for diabetes, epilepsy and other fall related patients with informing relatives of the fallen about
the probable location of the fallen

Specific objectives
 To profile the nature of fall detections
 To understand the problems encountered by the diabetes and epilepsy patient
 To enumerate the functional and non functional requirements of the fall detections system
 To understand the design consideration of the system in terms of
a. Hardware
b. Software
 To develop the fall detection system for diabetes and epilepsy patient

 To test the acceptability of the system.

1.4 Scope and Limitation of the Project

Scope
Fall detection system is system that detect fall by angle change of accelerometer and vibration
sensor in addition measure temperature values. This fall detection system monitor vital sign of
patient by measuring blood pressure and sugar level of person. This fall detections system after
detecting true fall it able to send SMS and call through GSM modem and ask first aid help
through speaker, but if false fall is detected user able stop alarming and initialize GSM module.
In addition, this system has a connection with android app through Bluetooth module to monitor
and register into database for farther medical treatment. An android application used for this
system us an interface with system.

3
Fall detection system for diabetes and epilepsy patient

Limitations

Fall detection system, to do perfect detection should have well integrated connection with each
component. The system well be placed in position of fall detect and needs good network media
to notify. The distance of the wireless technology used in transmitting the signals from the
sensor device to the monitoring device is limited. Any range farther than the standard
can cause an interruption in the system. The sensor device must only be worn anywhere
along the trunk of the person. It is set to distinguish a fall from a non-fall based on the center
of gravity of the body. But since some activities have drastic changes in acceleration even if it is
a non-fall, a false alarm button will be set. The monitoring or receiving device can still generate
an alarm even if it is not connected to the Arduino Board or if the software is not available,
but the information regarding the patient who has triggered the alarm will not be
displayed and the incident will not be recorded.

1.5 Outline of the Report

This report paper contains five chapters. The first chapter is an introductory chapter, and
background of the project, statement of the problem, objectives, significance of the study and
scope and limitation of the project is also discussed. The second chapter is all about literature
reviews and discussion of related works and brief description of equipment we used including
Arduino microcontroller sensor, display devise and power supply of system. The third chapter
explains about the software and hardware methodologies and the model we selected.
Requirement gathering techniques used, software and hardware requirement specifications and
brief history and description of MIT app development, requirements for developing android app
also included. This chapter also includes methodology used, architecture of system, block
diagram and flowchart of hardware and software of fall detection system. The fourth chapter is
about results and discussion, compared with the current future. The fifth chapter concludes all
about the project and recommends necessary points for the future, whereas the references, and
appendix is also included at the end of the paper

4
Fall detection system for diabetes and epilepsy patient

CHAPTER 2
Literature review
2.1 Existing Fall Detection Research and Development
Due to these incidents that arise from the falls among elderly have resulted in an increase in the
cost of medical services, serious injuries and sometimes can lead to fatalities, there are many
researchers that have conducted a number of research and development on the fall risk detection
as well as the prevention of the fall. The previous research can be categorize into three types of
approach, which are through, ambience device, camera-based and wearable device. Each of it
has its own advantages and disadvantages.

An example for camera-based approach is by using Omni-camera as the detector for the fall of
the elderly [8]. This system utilizes the camera to capture images by comparing the change of
people’s height and width ratio to identify falls. The personal information of the elderly such as
height, weight and health history will be combines with the system to adjust the sensitivity of the
system. This system is suitable for the elderly with certain types of disease or conditions.
However, it has a problem with people’s shadow, which gives a false alarm. Besides that, the
residents feel uncomfortable with this method as they feel that they are “being watched”.

One of the wearable devices approach is, a wearable watch-like fall detector [9]. The detector is
easy to wear and have full functionality for small transportable wireless alarm system. It can alert
a call center after a heavy fall detected. The system combines both complex data analysis and
wireless communications capabilities. The major disadvantage of this approach is the complexity
of the fall detector. The wrist can rotate and move in many angles, which require the device to
have at least 6 degrees of freedom in its element. The three-axis acceleration sensor was used
solely to comply with the small space available and low power requirement. Based on that, not
all fall situations were successfully being detected.

5
Fall detection system for diabetes and epilepsy patient

Table 1:A summary of three types of approaches for fall detector [10]

2.2 iLife™ Fall Detection sensor


As expected, there exist several commercial devices already on the market that attempt to
address the issue of falling in the elderly. One such device is the iLife™ Fall Detection Sensor
by AlertOne®. It is a self-contained, battery operated, wireless fall sensor worn on the body
with a belt clip. It is designed to detect falls or abnormal body movements and automatically
summon assistance without end-user intervention; it also has a manually activated button for
summoning help. There are several differences between this device and ours. It uses only
accelerometers and thus only acceleration based algorithms (no gyroscope). It has only one LED
for visual confirmation of activation; it has no audio or tactile alert for the seeing/hearing
impaired. It also does not facilitate a cancel feature; once an alert is set off there is no turning it
off. Finally, it requires a base station that it communicates with by RF and a call center
subscription service (US $27.95/month), both of which are additional costs on top of the
wearable device.

6
Fall detection system for diabetes and epilepsy patient

2.3 myHalo™

Another fall detection device on the market is the myHalo™ by Halo Monitoring™. This is
more of a full body monitoring system in that it is worn as a chest strap and detects falls,
monitors heart rate, skin temperature, sleep/wake patterns, and activity levels. Data transfer
requires a modem base station, which sends the information to a central server to be uploaded to
a caregiver-accessible webpage. Following a fall or emergency, the device again goes through a
call center (US $49-59/month) before alerting authorities/emergency contacts. Because this
device offers so many features, it is quite complicated and hard to access (chest-mounted). It is a
system less focused on fall detection and more on total health monitoring.

2.4 Life Alert Classic

One of the more well-known commercial devices for fall and emergency detection is the Life
Alert Classic by Life Alert Emergency Response, Inc. This device is recognizable from long-
running TV commercials starring an elderly woman on the floor exclaiming, “Help! I’ve fallen
and I can’t get up!” Despite its popularity, this device is one of the simpler emergency response
devices. It consists of a pendant or watch with a single push button. Pressing this button, it
connects with a base station via RF, and contacts operators at a call center. It has no automatic
features, sensors, or feedback built into the device; it requires entirely on the user’s ability to
manually activate the alert and does not take into account the immobility or unconsciousness of
the wearer, as is often the case in elderly post-fall.

2.5 MEMS Accelerometer Technology

Microelectromechanical systems (MEMS) combine mechanical and electrical components into


small structures in the micrometer scale. They are formed by a combination of semiconductor
and microfabrication technologies using micro machine processing to integrate all the
electronics, sensors, and mechanical elements onto a common silicon substrate. Major
components in any MEMS system are the mechanical elements, sensing mechanism, and the
ASIC or a microcontroller. This article presents an overview of MEMS accelerometer sensors
and gyroscopes. We discuss the principles of their operation, their sensing mechanism, the

7
Fall detection system for diabetes and epilepsy patient

growing variety of applications for them, and the profound impact they are already having on our
daily lives.

The GSM & GPS technologies have been inherently used for fall management along with
suitable high precision fall sensors like MEMS 3 & 2 axis accelerometers, gyroscopes and
magnetometers etc. A variety of combinations of different technologies have been reported in the
literature. A Bluetooth based MEMS with 3-axis accelerometer is used for short distance
communication for multi category human motion recognition. The use of Zigbee (for little larger
distance) with different MEMS for physical activity monitoring has been reported. Researchers
have suggested the use of body area sensor network for body posture recognition. The RFID
reader is being used as I Grabber with Bluetooth for fall detection system. The indoor activity
monitoring of adults with MEMS & Zigbee wireless communication is well suited for this
particular application. Monitoring &controlling of physiological parameters by using SMS
techniques with the aid of GSM & GPS network proved as realistic one. Sometime only location
awareness of the patient/people becomes a vital tool using GPS network.

2.6 Arduino
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a USB
cable or power it with a AC-to-DC adapter or battery to get started. The Uno differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter.
Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground, making it easier
to put into DFU mode.

8
Fall detection system for diabetes and epilepsy patient

Figure 1: Arduino Uno R3

Features of the Arduino UNO:

 Microcontroller: ATmega328
 Operating Voltage: 5V
 Input Voltage (recommended): 7-12V
 Input Voltage (limits): 6-20V
 Digital I/O Pins: 14 (of which 6 provide PWM output)
 Analog Input Pins: 6
 DC Current per I/O Pin: 40 mA
 DC Current for 3.3V Pin: 50 mA
 Flash Memory: 32 KB of which 0.5 KB used by bootloader
 SRAM: 2 KB (ATmega328)
 EEPROM: 1 KB (ATmega328)
 Clock Speed: 16 MHz

2.7 Sensors

2.7.1 Temperature sensor LM35

LM35 is a precision IC temperature sensor with its output proportional to the temperature (in
oC). The sensor circuitry is sealed and therefore it is not subjected to oxidation and other

9
Fall detection system for diabetes and epilepsy patient

processes. With LM35, temperature can be measure more accurately than with a thermistor. It
also possess low self-heating and does not cause more than 0.1 oC temperature rise in still air.
The operating temperature range is from -55°C to 150°C. The output voltage varies by 10mV in
response to every oC rise/fall in ambient temperature. i.e., its scale factor is 0.01V/ oC.

Figure 2: temperature sensor LM35

“Arduino can sense the environment by receiving input from a variety of sensors and can affect
its surroundings by controlling lights, motors, and other actuators. The microcontroller on the
board is programmed using the Arduino programming language”. Using the Arduino I will show
you how to get the analog input from the LM35 temperature sensor and display the information
in the serial window as raw data, Celsius and Fahrenheit.

2.7.2 Accelerometer sensor ADXL345

The ADXL345 is a small, thin, low power, 3-axis MEMS accelerometer with high resolution
(13-bit) measurement at up to +-16 g. Digital output data is formatted as 16-bit twos complement
and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. The ADXL345 is
well suited to measures the static acceleration of gravity in tilt-sensing applications, as well as
dynamic acceleration resulting from motion or shock. Its high resolution (4 mg/LSB) enables
measurement of inclination changes less than 1.0 degrees;. Several special sensing functions are
provided. Activity and inactivity sensing detect the presence or lack of motion and if the
acceleration on any axis exceeds a user-set level. Tap sensing detects single and double taps.
Free-fall sensing detects if the device is falling. These functions can be mapped to one of two
interrupt output pins. An integrated, patent pending 32-level first in, first out (FIFO) buffer can
be used to store data to minimize host processor intervention. Low power modes enable

10
Fall detection system for diabetes and epilepsy patient

intelligent motion-based power management with threshold sensing and active acceleration
measurement at extremely low power dissipation.

Figure 3: Accelerometer sensor ADXL345

Features

 Digital Output: SPI / I2C


 Low Power Consumption
 Compact Accelerometer / inclinometer
 5V/3.3V input support
 PCB Board double-sided gold-plated Size: 28mm x 14mm
 Lower pressure drop than the 1117, use on-board RT9161 chip for power
 Faster load the appropriate speed
 Ideal for noisy power environment
 Pin Standard 100mil (2.54mm), make it easily connect to development board

2.7.3 Vibration sensor sw-420

The Vibration Sensor Module Vibration Switch SW-420 is based on the vibration sensor SW-
420 and Comparator LM393 to detect if there is any vibration that beyond the threshold. The
threshold can be adjusted by the on-board potentiometer. When this no vibration, this module
output logic LOW the signal indicate LED light, and vice versa.

11
Fall detection system for diabetes and epilepsy patient

Figure 4: Vibration sensor SW-420

Features of the Vibration Sensor Module Vibration Switch SW-420:

 Normally closed type vibration sensor SW-420


 The comparator output, signal clean, good waveform, driving ability is strong, for
more than 15ma
 The working voltage of 3.3V to 5V
 Output form: digital switch output (0 and 1)
 Has a fixed bolt hole, convenient installation
 Small board PCB size: 3.2cm x 1.4cm
 Use the LM393 wide voltage comparator

2.8 GSM module SIM 900

A GSM modem is a specialized type of modem which accepts a SIM card, and operates over a
subscription to a mobile operator, just like a mobile phone. From the mobile operator
perspective, a GSM modem looks just like a mobile phone. When a GSM modem is connected to
a computer, this allows the computer to use the GSM modem to communicate over the mobile
network. While these GSM modems are most frequently used to provide mobile internet
connectivity, many of them can also be used for sending and receiving SMS and MMS
messages. A GSM modem is a specialized type of modem which accepts a SIM card, and
operates over a subscription to a mobile operator, just like a mobile phone. From the mobile
operator perspective, a GSM modem looks a mobile phone. These GSM modems are most

12
Fall detection system for diabetes and epilepsy patient

frequently used to provide mobile internet connectivity, many of them can also be used for
sending and receiving SMS and MMS messages. We have used virtual terminals for simulations
purpose instead SIM900 GSM module. It is an Advanced Low cost modem for wireless GSM
communications which includes sending and receiving text messages. This GSM Modem can
accept any GSM network operator SIM card and act just like a mobile phone with its own unique
phone number.

Applications like SMS Control, data transfer, remote control and logging can be developed
easily. The modem can either be connected to PC serial port directly or to any microcontroller. It
can be used to send and receive SMS or make receive voice calls. It can also be used in GPRS
mode to connect to internet and do many applications for data logging and control. This GSM
modem is a highly flexible plug and play quad band GSM modem for direct and easy integration
to RS232 applications.

Figure 5: Gsm sim900 modem

2.9 Bluetooth HC 05 module

HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for
transparent wireless serial connection setup. The HC-05 Bluetooth Module can be used in a
Master or Slave configuration, making it a great solution for wireless communication. This serial
port bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore
04‐External single chip Rluetooth system with CMOS technology and with AFH (Adaptive
Frequency Hopping Feature).

13
Fall detection system for diabetes and epilepsy patient

Figure 6: Bluetooth HC-05 module

Hardware Features

 Typical ‐80dBm sensitivity.


 Up to +4dBm RF transmit power.
 3.3 to 5 V I/O.
 PIO (Programmable Input/Output) control.
 UART interface with programmable baud rate.
 With integrated antenna.
 With edge connector.

Software Features

 Slave default Baud rate: 9600, Data bits:8, Stop bit:1,Parity:No parity.
 Auto‐connect to the last device on power as default.
 Permit pairing device to connect as default.
 Auto‐pairing PINCODE:”1234” as default.

2.10 Bush button

A push-button or simply button is a simple switch mechanism for controlling some aspect of a
machine or a process. Buttons are typically made out of hard material, usually plastic or metal.
maintained bush button is recommended for system, but we have got momentary push button this
needs hold on pressing to make action and when release push button is open circuit.

14
Fall detection system for diabetes and epilepsy patient

Figure 7: push button

Description: This is a standard 12mm square momentary button. What we really like is the large
button head and good tactile feel (it ‘clicks’ really well). This button is great for user input on a
PCB or a good, big reset button on a breadboard. Breadboard friendly!

2.11 Power supply

Since fall detection system is real time application, so portable and rechargeable source of power
is used instead. Arduino Uno R3 needs 5V DC source or 9-12V AC power supply where us GSM
and GPS module also needs 5V DC source or 9-12V AC power supply. So 5V rechargeable
battery bank is used.

Figure 8: Rechargeable battery

2.12 LCD display

Liquid Crystal Display is an electronic device for displaying text or characters. We are using 14
pin LCD. 16*2 represents 16 characters and 2 line display. LCD’s are economical and easily
programmable and can easily display special and custom characters. Pin Description is as
follows:

15
Fall detection system for diabetes and epilepsy patient

LCD1
LM016L

VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3

4
5
6

7
8
9
10
11
12
13
14
Figure 9: Liquid Crystal Display

2.13 Buzzer

The piezo buzzer produces sound based on reverse of the piezoelectric effect. The generation of
pressure variation or strain by the application of electric potential across a piezoelectric material
is the underlying principle. These buzzers can be used alert a user of an event corresponding to a
switching action, counter signal or sensor input. They are also used in alarm circuits.
The buzzer produces a same noisy sound irrespective of the voltage variation applied to it. It
consists of piezo crystals between two conductors. When a potential is applied across these
crystals, they push on one conductor and pull on the other. This, push and pull action, results in a
sound wave. Most buzzers produce sound in the range of 2 to 4 kHz.

Figure 10: Buzzer

2.14 GPS receiver

Stands for "Global Positioning System." GPS is a satellite navigation system used to determine
the ground position of an object. The Skylab SKG13 series is a complete gps receiver module

16
Fall detection system for diabetes and epilepsy patient

that features super sensitivity, ultra low power and small form factor, and a complete serial data
message with position, velocity and time information is presented at the serial interface with
NMEA protocol. Connect the GPS module using the cable to 5 to 30 V dc power, ground, and
the RS-485 serial lines to a Modbus master device according to the wiring/pin diagram shown.
After connecting the GPS module, the user may change the communications parameters using
Modbus registers on the device

Figure 11: GPS receiver module

Features:

 Ultra high sensitivity: -165dBm.


 Extremely fast TTFF (Time To First Fix) at low signal level.
 Low power consumption: Typical 45mA@3.3V.
 NMEA-0183 compliant protocol or custom protocol.
 Operating voltage: 3.3V or 12V DC,
 Operating temperature range: -40 to 85℃.
 SMD type with stamp holes.
 LED indicator for fix or no fix

17
Fall detection system for diabetes and epilepsy patient

2.15 About MIT Software

2.15.1 Introduction MIT app inventor

App Inventor for Android is an open-source web application originally provided by Google,
and now maintained by the Massachusetts Institute of Technology (MIT).It allows newcomers to
computer programming to create software applications for the Android operating system (OS). It
uses a graphical interface, very similar to Scratch and the Star Logo TNG user interface, which
allows users to drag-and-drop visual objects to create an application that can run on Android
devices. In creating App Inventor, Google drew upon significant prior research in educational
computing, as well as work done within Google on online development environments. MIT App
Inventor is an innovative beginner's introduction to programming and app creation that
transforms the complex language of text-based coding into visual, drag-and-drop building
blocks. The simple graphical interface grants even an inexperienced novice the ability to create a
basic, fully functional app within an hour or less.

2.15.2 App Inventor Built-in Blocks

Built-in blocks are available regardless of which components are in your project. In addition to
these language blocks, each component in your project has its own set of blocks specific to its
own events, methods, and properties. This is an overview of all of the Built-In Blocks available
in the Blocks Editor.

Control Blocks

 if & if else
 for each from to
 for each in list
 while
 if then else
 do
 evaluate but ignore result
 open another screen

18
Fall detection system for diabetes and epilepsy patient

 open another screen with start value


 get start value
 close screen
 close screen with value
 close application
 get plain start text
 close screen with plain text

Procedures

A procedure is a set of instructions that perform a specific task or tasks. It may also be called a
function. A recipe for banana bread is an example of a procedure. The baker must follow the
instructions step-by-step to produce the bread. We use procedures in App Inventor to create new
blocks that we can use repeatedly and take up less space than all of the blocks used in the
original procedure. If we are using the same sets of blocks more than once, these blocks are
called redundant.

Procedure in App Inventor An App Inventor procedure collects a sequence of blocks together
into a group. You can then use the sequence of blocks repeatedly by calling the procedure. If the
procedure has arguments, you specify the arguments by using name blocks. When you create a
procedure, App Inventor automatically generates a call block and places it in the My Definitions
drawer. You use the call block to invoke the procedure. When you create a new procedure block,
App Inventor chooses a unique name automatically. You can click on the name and type to
change it. Procedure names in an app must be unique. App Inventor will not let you define two
procedures in the same app with the same name. You can rename a procedure at any time while
you are building the app, by changing the label in the block. App Inventor will automatically
rename the associated call blocks to match.

Let’s build a procedure to do the job of the redundant code blocks. In App Inventor, you define a
procedure in a manner similar to how you define variables. From the Procedures drawer, drag
out either a procedure do block or a to procedure return block. Use the latter if your procedure
should calculate some value and return it. After dragging out a procedure block, you can change

19
Fall detection system for diabetes and epilepsy patient

its name from the default “procedure” by clicking the word “procedure” and typing the new
name.

What is an argument?

An argument is an input to our procedure. Some procedures require knowing some bits of
information that change how the procedure is run. Let's look at the banana bread recipe example.
Sometimes the baker may want to make two loaves of banana bread. Then the baker would
double the amount of each ingredient called for in the recipe. This double or 2 is an argument to
our procedure since this changes how much of our ingredients we mix together.

2.15.3 MIT app development overall block diagram

Figure 12: block diagram of MIT app development

2.15.4 MIT app development software Requirements

System Requirements To use App Inventor, your computer must meet the following system
requirements: Computer and operating system

 Macintosh (with Intel processor): Mac OS X 10.5, 10.6+


 Windows: Windows XP, Windows Vista, Windows 7+

20
Fall detection system for diabetes and epilepsy patient

 GNU/Linux: Ubuntu 8+, Debian 5+ (Note: GNU/Linux live development is only


supported for WiFi connections between computer and Android device.)

Browser

 Mozilla Firefox 3.6 or higher (Note: If you are using Firefox with the No Script
extension, you'll need to turn the extension off. See the note on the troubleshooting page.)
 Apple Safari 5.0 or higher
 Google Chrome 4.0 or higher
 App Inventor does not support Microsoft Internet Explorer. Windows users should use
Chrome or Firefox

Phone or Tablet (or use the on-screen emulator)

 Android Operating System 2.3 ("Gingerbread") or higher

Whichever model you have, your phone must have an SD card (physical or virtual) installed, or
else the phone won't work with App Inventor. Most modern Android phones have virtual SD
cards, so this is an issue only for older phones. App Inventor also works with many other
Android phones, including models from HTC, Samsung, and Dell, but in many cases you will
need to download and install additional software from the manufacturer. You can find details for
a few of these models in that table at the bottom of the page for setting up your phone. Even if
your phone is not listed there, it is still likely to work with App Inventor. Consult the App
Inventor User Forum under "Getting set up and connecting your phone" for advice from others
who may be using the same phone.

2.15.5 Building Apps with the Emulator

App Inventor includes an emulator for the phone. The emulator lets you develop and test apps
using a virtual phone instead of a real phone. Instead of connecting a phone to the USB port, just
start the emulator program. When you click Connect to Phone in the Blocks Editor, your app will
appear in the emulator.

21
Fall detection system for diabetes and epilepsy patient

You can't do everything with the emulator that you can with a real phone — you can't shake it,
for example, and the emulator can't make or receive phone calls — but you can use the emulator
to create apps and test them, and install them on a phone later if you like.

2.15.6 Starting the Emulator

You don't need to download any additional software to use the emulator. It was included with the
software you already downloaded as part of the App Inventor Extras Package. Navigate to the
directory where the App Inventor Extras software was installed, locate the folder called
commands-for-app inventor and run the command run-emulator

Be patient: The emulator takes a long time to start, even a minute or more. That's because it's
booting up the virtual phone from scratch. The emulator will appear in its own window on your
computer. As you work, you'll need to switch among the emulator window, the Blocks Editor,
and the Designer. Don't connect a physical phone to the computer while you're using the
emulator, or App Inventor will become confused.

2.15.7 App Development with the Emulator

Start the emulator and use App Inventor just as you would with a real phone: connect to the App
Inventor site, start the Blocks Editor, and press Connect to Phone . Your application should
appear in the emulator. Don't forget to "unlock" the virtual phone after it starts up. When your
app is finished, you can download it to your computer just as you would if you'd been
developing on a real phone.

2.16 Android application description

MIT application development is used as fall prevention before fall is detected used able to know
status of her/his by reading sensor value using this android application. Fall prevention
application have four screen to make easy interfacing with uses. The first screen used as home
page for fall prevention application and continuously display sensor result from Arduino through
Bluetooth by serial communication. To make this system in work first we should connect
Bluetooth of android phone with Bluetooth HC-05 interfaced with Arduino UNO

22
Fall detection system for diabetes and epilepsy patient

In addition android application which is developed by MIT app inventor. Which is connected to
the fall detection system through Bluetooth. It receives values of sensors from Arduino based on
the values of the sensors especially temperature, vibration and BP sensors give feedback to the
use, the application also provide text to speech conversion to read out lode the massage sent by
the care giver of the user. The application enable the user to send massages to his care giver or
doctors along with his vital signs and receive text messages from them. The app also first user
though steps for, how to use the application.

23
Fall detection system for diabetes and epilepsy patient

CHAPTER 3
Project design and methodology
The system is controlled by the Arduino Uno microcontroller, an open source electronics
prototyping platform which is commonly used in designing interactive devices. The
accelerometer ADXL345 is used as the sensor in the device to detect fall. The buzzer will act as
an alarm to notify the people around and act as a benchmark for the seriousness of the falls.
Within 5second, if the alarm is not switched off by the user, the system will classify it as a heavy
fall and assume that the user is unconscious. The push button is used to switch off the alarm
sound if false fall is detected. The GSM (Global System for Mobile Communications) will be
communicating with the caregiver/guardian if a heavy fall is detected. It will send a notification
message to the caregiver about patient information including location from GPS modem.

3.1 Architecture

Fall detection system is design as wearable device on belt in order to detect actual falls.
Accelerometers are the most common wearable sensors used nowadays. They are small in size
and cheap; they can be easily placed in any part of the human body. Most of the studies in the
literature use accelerometer data along with threshold-based algorithms to detect fall-related
events. A threshold is a limit that when surpassed triggers an action in the system (e.g., a fall is
detected—caregiver is informed). The most common threshold used with the accelerometer data
is the sum vector magnitude of acceleration, which describes the activity level of the body. The
ADXL 345 sensor is mounted on the subject's pelvis, and it is used to identify human
movements. Eight fall scenarios were used: stand still, sit to stand, stand to sit, walking, walking
backwards, stoop, jump and lie on the bed. The solution proposes a three-level fall detection
criteria that includes a sum vector magnitude of acceleration, acceleration on the horizontal plane
and the reference velocity. The first one describes the spatial changes of the acceleration while
falling. The second one measures the body inclination. The last one is used to determine if the
subject is at rest or not. The results of this study show the effectiveness of the accelerometer data
to detect falls. While it is true that falls generate higher accelerations than other activities, there
are others that have similar accelerations patterns such as jumping, climbing stairs, sitting or

24
Fall detection system for diabetes and epilepsy patient

standing up quickly. This overlapping data poses a problem when distinguishing a fall from
activities of daily living (ADL).

Figure 13: Architecture of Fall detections system

3.1.2Types of architecture used for system

An application’s architecture describes how its pieces fit together at a high level. Developers use
a lot of “standard” types of architectures. Many of these address particular characteristics of the
problem being solved. Among many types of architecture, Monolithic and Event driven are used

 Monolithic: in a monolithic architecture, a single program does everything. It displays


the user interface, accesses data, processes customer orders, prints invoices, launches
missiles and does whatever else the application needs to do.
 Event‐Driven: In an event‐driven architecture (EDA), various parts of the system
respond to events as they occur.

3.2 Software Methodology (Rapid Application Development)


The time given for finishing the project is very small, RAD method is best choice for the
software methodology. it take iterative ideas to the extreme and Instead of using iterations

25
Fall detection system for diabetes and epilepsy patient

lasting years, their iterations last a month, a week, or even less. This methodology is
applicable for small number of team and limited scope of project. The team apply iteration to
requirement gathering, requirement validation, and design.

Requirements planning—all the group member agree on the project’s objective on designing
developing and implementing fall detection device and application and its requirements. The
requirements are specified in a way that they don’t restrict later developmental change.

User design—team members work together to convert the requirements into a functioning
design. we use techniques such as focus groups, workshops, prototyping, and brainstorming
to come up with a functioning design.

Construction—all members of the group participates on designing and implementing the


hardware prototype.

Cutover— on the final day of the project we deliver the finished prototype of our project.

Requirements
planning

User Design Construction

Cutover

Figure 14: Software development RAD model

26
Fall detection system for diabetes and epilepsy patient

3.3 Method of data collection

During this project research work, data needed for the project was gathered from the various
sources of data. In gathering and collecting necessary data and information needed from the
system analyses, two major fact-finding techniques were used in this work and this are:

3.3.1 Primary Source

This refers to the source of collecting original data in which the researcher made use of empirical
approach such as personal interview and observations. But we get some data by observation
only.

Observation

Enables us to list out the existing system problems, since there are many peoples which are
suffering with fall related problems in our day to day activities it is obvious what we see or
observe in reality. We tried deeply looking to what problems are being occurring on these
peoples.

3.3.2 Secondary Sources

The secondary data were obtained by the researcher from related documents and internet
downloads.

Web information

Information that we have acquired over the internet about the fall detection system, the sensors
used for the system, the common types of the fall detection that has been implemented, costs of
every material that we are going to use for budget analysis of the project, to come up with
additional new feature that was not installed before in the previous researches and for
Implementation designing coding of the sensors.

27
Fall detection system for diabetes and epilepsy patient

3.4 Tools for Data Analysis

Documentary Analysis
The datasheet of each hardware devices and how they can be interfaced with the Arduino
microcontroller their power specification, the types of sensor that are used are obtained after
referencing number of documents.

Algorithm Analysis

A basic component in any fall detection system is the decision algorithm that is employed to
distinguish fall events from other conventional movements, which are normally encompassed
under the term “Activities of Daily Life”. Most fall detection systems are wearable device that
are based on accelerometer value to decide if the user is fall or not. The algorithm used in our fall
detection system take the module of the acceleration vector or SMV (Signal Magnitude Vector)
as the main (or unique) decision variable to be analyzed for the detection decision. This variable
is defined as:

SMV2=A2x+A2y+A2z

Where Ax, Ay and Az are the acceleration components, that is to say, the readings in directions of
x, y, and z-axis of the accelerometer that is transported by the monitored user.

3.5 Block diagram of fall detection system

The central processer for our fall detection system the Arduino Uno control every sensors the
display devices the GSM and GPS module and the Bluetooth module. The accelerometer sensors
send x, y and z value of the accelerometer due to gravity based on this values Arduino decide fall
or not and text massage from GSM to the care giver including the latitude and longitude value
that came from GPS module the values of accelerometer and GPS location and other value
displayed on LCD. Through Bluetooth module connected to the Arduino sent the value of blood
pressure level and heartbeat value mobile phone the android application gives feedback to the

28
Fall detection system for diabetes and epilepsy patient

user. The vibration sensor SW-420 send data to the Arduino that measure to detect seizure. LM-
35 temperature sensor keep tracking the body temperature.

Figure 15: Block diagram of fall Detections system

3.6 Software Tools for hardware Design

 Arduino complier 1.5.8 – to write and compile the Arduino program which is written in C
language.
 MIT app inventor – to develop android application
 Microsoft office 2007 – for documentation
 Edraw UML diagram – to draw diagrams and charts
 Snipping tool- to snip diagrams
 Protues – for simulation

29
Fall detection system for diabetes and epilepsy patient

3.7 Flowchart of fall detection system (Hardware)

When Arduino connected with power supply the sensor get initialized and start sensing and
sending analog value to Arduino uno. The fall detection algorithm checks fall detection in every
data received from Arduino. If fall is detected the system check for an other condition whether
fall is TRUE OR FALSE and system check for push button for 5 second if button is HIGH false
fall is detected system back to loop, but if button is LOW fall is detected system trigger speaker
and GSM text message including GPS location. System waiting for some time until caregiver
respond through GSM receive message if not GSM make automatic call if call is not answered
gsm send message to second caregiver.

Figure 16: Flow chart of fall Detection system

30
Fall detection system for diabetes and epilepsy patient

3.8 Flowchart (Android App)

After Android application, launch home Screen displayed when Bluetooth button is clicked
Bluetooth connected. After Bluetooth is connected android application receive sensor data from
Arduino. By clicking read, button able to convert to speech. And application able to send and
read received message.

Figure 17: Flow chart android application

3.9 Analog to digital convertor for sensor value

Microcontrollers are capable of detecting binary signals: is the button pressed or not? These are
digital signals. When a microcontroller is powered from five volts, it understands zero volts (0V)

31
Fall detection system for diabetes and epilepsy patient

as a binary 0 and a five volts (5V) as a binary 1. The world however is not so simple and likes to
use shades of gray. What if the signal is 2.72V? Is that a zero or a one? We often need to
measure signals that vary; these are called analog signals. A 5V analog sensor may output 0.01V
or 4.99V or anything in between. Luckily, nearly all microcontrollers have a device built into
them that allows us to convert these voltages into values that we can use in a program to make a
decision.

An Analog to Digital Converter (ADC) is a very useful feature that converts an analog voltage
on a pin to a digital number. By converting from the analog world to the digital world, we can
begin to use electronics to interface to the analog world around us.

Figure 18: Analog to digital convertors

Not every pin on a microcontroller has the ability to do analog to digital conversions. On the
Arduino board, these pins have an ‘A’ in front of their label (A0 through A5) to indicate these
pins can read analog voltages.

ADCs can vary greatly between microcontrollers. The ADC on the Arduino is a 10-bit ADC
meaning it has the ability to detect 1,024 (210) discrete analog levels. Some microcontrollers have
8-bit ADCs (28 = 256 discrete levels) and some have 16-bit ADCs (216 = 65,536 discrete levels).

The way an ADC works is fairly complex. There are a few different ways to achieve this feat but
one of the most common technique uses the analog voltage to charge up an internal capacitor and

32
Fall detection system for diabetes and epilepsy patient

then measure the time it takes to discharge across an internal resistor. The microcontroller
monitors the number of clock cycles that pass before the capacitor is discharged. This number of
cycles is the number that is returned once the ADC is complete.

Relating ADC Value to Voltage

The ADC reports a ratiometric value. This means that the ADC assumes 5V is 1023 and
anything less than 5V will be a ratio between 5V and 1023.

Analog to digital conversions are dependent on the system voltage. Because we predominantly
use the 10-bit ADC of the Arduino on a 5V system, we can simplify this equation slightly:

3.10 Advantages of Arduino Uno microcontroller than other types for fall
detection system

There are many Advantages of Using Arduino over simple microcontroller. Some of them are as
follows:

1. Ready to use: The biggest advantage of Arduino is its ready to use structure. As Arduino
comes in a complete package form, which includes the 5V regulator, a burner, an oscillator, a
micro-controller, serial communication interface, LED and headers for the connections.

2. Examples of codes: Another big advantage of Arduino is its library of examples present
inside the software of Arduino

3. Effortless functions: During coding of Arduino, you will notice some functions, which make
the life so easy. Another advantage of Arduino is its automatic unit conversion capability.

33
Fall detection system for diabetes and epilepsy patient

CHAPTER 4

Discussion of Findings
4.1 Profile the nature of fall detections

A fall detection system is a mechanism used to detect fall of a person based on comparison of the
position of a person or an object relative to the ground using either specific sensors like
accelerometer or detecting and analyzing collusion of the target with the ground. A very
important aspect is that the Fall Detection System or the Fall Detector device must analyze
condition and decide if the incident is fall or not. If the later stage is neglected it may lead to
misinformation and harm. Generally the whole system must have a fall detection unit or
mechanism, a logical means to decide if the fall is a false fall or not and a notification method to
help the failed person.
Every fall detector has:-
 A fall detector - devices like sensors, which senses certain parameters mostly
gravitational difference to detect fall. In case of this project, the sensor is the
Accelerometer sensor ADXL345.
 A processing unit – which receives inputs from sensors, analyses it and deicide if the
incident is a fall or not using a logical means. This unit is also responsible for intersystem
communication. Arduino microcontroller is used as a processing unit in this project.
 A communication unit – a unit that interacts with the ‘outside the system’ environment.
It calls or texts to the caretakers number. GSM module SIM 900 and Bluetooth HC 05
module

34
Fall detection system for diabetes and epilepsy patient

Figure 19: Different Section of fall detections

4.2 Problems encountered by the diabetes and epilepsy patient

Diabetes is a non-transmitting disease arises because of the abnormal sugar level in blood which
is due to the failure in pancreases to secret insulin which regulates sugar level. A person can be a
diabetic if the sugar level in his/her body is below or above the normal level which makes
him/her to eat a lot sugar to increase it in one occasion and not to consume sugar in another
occasion that’s makes the disease very difficult to control.
Common problems that a diabetic encounter are
 Dizziness
 Sight problems
 Fatigue
 Sudden fall
 Kidney failure
The major problem, which is tried to address in this project, is the sudden fall caused by fatigue.
The person will feel dizziness, fatigue and blunder in size before the fall which makes it a bit
predictable.
Epilepsy on the other hand is a disorder, which makes the patient to fall suddenly and without a
pre caution that makes very difficult to both the person with the illness and the people around the
person. The patient may be unconscious and die due to suffocation if the issue is not addressed

35
Fall detection system for diabetes and epilepsy patient

immediately. These days’ people tend to live alone more often due to the ever-changing social
environment, which makes the problem even worse. Even if in Ethiopia the social interaction is
considered strong, it is changing rapidly which makes these kinds of system more important.
Problem in day-to-day life
Driving, the operation of a motor vehicle can be hazardous for people with epilepsy because the
driver can lose consciousness behind the wheel, and therefore, control of the vehicle, putting
themselves and the public at risk. For those whose seizures are successfully controlled, many of
the medications have side effects that cause drowsiness, also impacting driving. As a result,
many countries and states place restrictions on driving such as a necessity to be seizure-free for a
period of time before being allowed to drive
Employment, many people with epilepsy have trouble with employment due to safety
performing job duties, loss of work time during and after seizures, and transportation to and from
a place of employment.
Depression is very common among people with epilepsy, with rates as high as 20% for those
whose seizures are successfully controlled, and 60% for those with uncontrolled seizures.
Suicide is ten times as likely for people with epilepsy than it is for others.

Personal safety is a major concern for persons with epilepsy. When sudden loss of
consciousness occurs without warning, the patient is at risk for personal injury and possibly
causing injury to others through loss of control or awareness of one's own body. Many activities
of daily living can be dangerous for people with epilepsy, such as bathing, cooking, or walking
up or down steps. These can be remedied by taking showers as opposed to tub baths, cooking
with a microwave oven rather than an open flame, and living on a ground level. Certain high-risk
sports, such as swimming, scuba diving, or snorkeling are considered dangerous for people with
epilepsy. But they pose a level of danger for all participants. They can be equally safe for people
with epilepsy and others if carried out with proper safety precautions

4.3 Requirements of the fall detection system

4.3.1 Functional requirements


The overall functionality of the system can be regrouped as

36
Fall detection system for diabetes and epilepsy patient

Hardware functionalities:-
- Automatic Fall detection using accelerometer
- Seizure detection using vibration sensor
- Body temperature reading by temperature sensor lm35
- measuring heartbeat rate using BP sensor
- Heart beat and blood concentration level using BP sensor

Software functionalities:-
- Automatic Messaging System
- Parameter displaying using android app
- Android application based help
4.3.2 Non Functional requirement
The overall performance of the system can be evaluated in the following nonfunctional terms

1. Reliability
The system generally has a high reliability due to the use of sensors and cross checking logic it
implements. The parameters measured are hard to be corrupted which make them highly reliable.
2. Portability
The fall detector device is portable and can be available in small size and weight to that extent of
being wearable with belts which makes is easy to handle.
3. Usability
The whole system is operational any time where there is a network connection is available,
having a mobile phone is mandatory,
4. Performance
Every fall detector must have quick response to an incident since every second ticking is a matter
of life .With a good mobile internet connection, the system needs only 11 seconds from detecting
the fall to notifying the care taker which is pretty fast.
5. Speed
The system will allow a user to get information quickly.
6. Error Handling

37
Fall detection system for diabetes and epilepsy patient

Our system handles the errors in a very efficient manner. It can tolerate to wrong inputs and
prompts the users to correct the inputs. It gives notifications as and when required, guiding the
users to properly utilize it.

4.4 Hardware Design consideration of the system

Tools
 Arduino Uno microcontroller
 GSM modem
 GPS receiver
 Bluetooth module
 Accelerometer
 Temperature sensor
 Vibration sensor
 Buzzer
 LCD
 Push button
 A mobile phone with IOS or Android operating system

4.4.1 When fall is detected

There are conditions where the patient may fall because of non related cases to the illness she or
he has. These might be due to obstacles or sloppy ground. The system will detect these
conditions as a fall but between detecting it and notifying the care taker, the system has a 5
seconds delay. If the patient conscious and decide the fall as a false fall the notification processes
will be aborted by using the push button. If the push button is not pressed within those 5 seconds,
the system will consider the incident as a fall and notify it to the caretaker.

38
Fall detection system for diabetes and epilepsy patient

Figure 20: Flow chart for True fall detections


4.4.2 False fall is detected

When the patient falls, the system examines the position of the person using an accelerometer
and compares it to the previous position. If the conditions are satisfied the incident is considered
as a fall. The system waits for 5 seconds if the patient is aware of the situation and decides to
abort the system from sending notification messages and calls to the caretaker. If the push button
assigned for this purpose is not pressed within the given time the system will notify.
Note: - between the fall detection and the notification process, there is always a delay to make
sure there is no notification for false fall.

Figure 21: push button flow chart

39
Fall detection system for diabetes and epilepsy patient

4.4.3 Sensors that are integrated

Sensors that are integrated with the Arduino to make full functioning fall detection system are
ADXL345 accelerometer sensor to decide whether the person is falls or not by measuring x, y
and z values of the accelerometer positions against the gravity. SW- 420 Vibration sensor to
detect if there the person is having a seizure. BP sensors for determining the heart beat rate and
blood pressure rate of the user and send the data to the mobile phone through the HC-05
Bluetooth module and the android application which is on the phone gives feedback to the user
based on the value that was sent by the Arduino from the BP sensor through Bluetooth module.
LM _ 35 temperature sensor to keep truck of the body temperature
The Bluetooth pin Rx, Tx connected to Arduino pin 2,3 for serial communication in order to
transfer data, other two pin connected to Ground and 5V Vcc pin of arduino

Figure 22: Bluetooth interfacing with Arduino

The accelerometer sensor ADXL345 axis sensor(SCL, SCA) connected to analog pin of Arduino
A5,A4 respectively 3.3v and Cs connected to Arduino digital output pin 3.3v and other Gnd and
SDO connected to Gnd pin of arduino

Figure 23:ADXL345 interfacing with arduino uno

40
Fall detection system for diabetes and epilepsy patient

The vibration sensor SW4_20 pin out connected to analog pin A0 of Arduino to sense vibrational
activity other pin is connected to ground and 5V

Figure 24: SW4_20 interfacing

LM35 temperature sensor connected to analog pin of Arduino A1 other pin is connected to
ground and 5V of Arduino.

Figure 25: LM35 interfacing

4.4.4 Hardware and Android App Integration

The hardware and the android application are interrelated by a Bluetooth module which allows
data transition between the two (measured parameters from the hardware to the phone and GPS
status from the phone to the hardware incase if the GPS module is not working). This is only
practicable if the hardware and the mobile phone are within the given range of distance for
Bluetooth connection.

41
Fall detection system for diabetes and epilepsy patient

Figure 26: Flow chart of Hardware and android connections

4.5 Protues simulation of fall detection system

This simulations shows sensor interfacing with Arduino and display the result and status on LCD
display. vibration sensor SW4_20 is connected to Analog pin A0 Arduino read analog value and
convert this analog value to digital signal as microcontroller fetch and execute through Analog to
digital convertor. Temperature sensor LM-35 connected to Analog pin A2 of Arduino and
accelerometer sensor ADXL345 pin SDA and SDL connected to A4 and A5 respectively. Blood
pressure sensor connected to A2 analog pin of Arduino, this all sensor value read and convert to
digital signal(voltage). Display device LCD connected to Arduino pin(2,3,4,5,10,11,GROUND,
5V power supply).buzzer connected to digital pin 12 and bush button connected to Arduino pin
13. LED connected to pin 9 of Arduino. Virtual terminals pin tx and rx connected to rx, tx of
Arduino pin respectively.

42
Fall detection system for diabetes and epilepsy patient

Figure 27: Protues simulation of fall detections

4.6 The developed fall detection system for diabetes and epilepsy patient
There is a need for a fall-detection system that can be used long-term and in home situations for
early intervention and prevention of fall related side effects including SUDEP (sudden
unexpected death in epileptic patients). The gold standard for monitoring epileptic seizures
involves video/EEG (electro-encephalography), which is uncomfortable for the patient, as EEG
electrodes are attached to the scalp. Accelerometer based fall detection system is less power used
highly reliable. This real time portable system easy for attaching in to belt. Fall detection have
alarm system for true fall and push button for false fall.

4.6.1 Working principle of designed fall detections

The accelerometer library for Protues is not available but it is connected as an input for the
Arduino microcontroller to feed x, y and z value of the adxl345 sensor to detect fall. The
vibration sensor, the BP sensor and temperature sensor are also connected to the Arduino as an
input device to send analog data to the Arduino microcontroller to take course of action based on

43
Fall detection system for diabetes and epilepsy patient

this analog values. The push button, if a false fall is detected the system could be reset by the
push button.
The liquid crystal display, buzzer and led are connected to the Arduino as an output device to
display the values that we want them to display, to produce alarm when our sensor’s value
reaches a certain value which is predetermined and blinking to indicate something went wrong.
The GPS and GSM module are connected as both as input and output to the Arduino they send
data like geographical location of the user including longitude and latitude from GPS and
received massage by the GSM from caregiver and receive data from the microcontroller to send
massage or to ping the location of the user.

Figure 28: over all hardware implementation

44
Fall detection system for diabetes and epilepsy patient

The Bluetooth module is the key to connect the entire fall detection system to android
application on the user’s mobile phone to send sensors values to the application through
Bluetooth module to check the vital sign of the user.

4.6.2 Business Rules

If our project to be implemented for market as we recommend it should also include some
requirements the also known as business rules. All the sensors that we have used should
integrated as a single device to make it easy for the user to carry it around. The android
application has to be installed to the user mobile phone which he /she could keep truck of her/his
conditions. Even though we haven’t use gyroscope sensor it should be included for better
accuracy of fall detection measurement. Explain how the fall detection device works to the user
is one the rules. We highly recommend if there is a way of receiving alerts when any of our
costumer falls to be additional help for the user so creating a database for our users.

4.7 Software Design and Android app snapshot

4.7.1 Design Home Screen

The first Screen of fall detection system and entire design is using List picker, button, label,
vertical arrangement. The list picker able initialize button and label of Screen. Button 1 used to
make connection with Arduino Bluetooth HC_05. After Bluetooth is connected the sensor data
continuously display on the label of screen.

45
Fall detection system for diabetes and epilepsy patient

Figure 29: Home Screen of fall application


The last four button on vertical arrangement contain four individual button. When read button is
clicked the application able to read the sensor value coming from Arduino through Bluetooth.
The second button is help button when we click help button system link to another help Screen.
The next two button SEND and RECEIVE button also used to link Screen to send message and
Screen to see received message respectively while actively clicked.

Blockes for home Screen

Blocks code for initialize delay time of the system in order to make time difference between two
actions

Screen element initialization blocks of code to make it active the screen element like listpicker,
button, label, and other displayed on screen

46
Fall detection system for diabetes and epilepsy patient

This blocks of code is used when listpicker is clicked in order to speak system discerption about
well come to the system and fall detection system whose to belongs.

When Button is clicked system select and filtered Bluetooth device to be paired with system.

This Blockes of code is the core for receiving data coming from Arduino device through
Bluetooth after Bluetooth is connected. Control blocks(if then) check for availability of data
from other device through Bluetooth, when bluetoothClient bytesAvailabletoreceive > 0 set data
coming into label and call delay functions.

47
Fall detection system for diabetes and epilepsy patient

Read Blockes of code is design to speak with block code of TextToSpeech received data from
Arduino after checking Bluetooth is connected

This block of code is function to create delay by setting global delaytime to callClocksystemtime
plus clock rate of 1000. Until clock1.systemTime greater than global delaytime.

This block is is used to link to an other screen when help button is click system shift to
“helpScreen”

48
Fall detection system for diabetes and epilepsy patient

This block is is used to link to an other screen when help button is click system shift to
“sendScreen”

This block is is used to link to an other screen when help button is click system shift to
“readScreen”

This block is is used exit system when back is pressed

4.7.2 Design Screen to send Message

This send Screen is able to write massage on text box and select contact number by clicking
phoneNumberPicker1 button after select the phone number then click send button to send
message to selected contact. When back Screen is

49
Fall detection system for diabetes and epilepsy patient

Figure 30: Send Screen Fall application


Blockes for send message
This block of code is initialize button, PhoneNumberPicker, textbox to active for sending text
message

This block of code is check for conditions to be fulfilled after button is clicked, this condition is
textbox cannot be empty and PhoneNumberPicker must select contact number. And set message
written in textbox to Texting.message similarly selected phone number set on
Texting.phonenumber . after all call function CallTexting.sendMessage by this block of code
message is sent to selected contact. If one of the condition is fail to fulfilled notifier shows alert
“textbox cannot be empty” and “select proper contact”.

50
Fall detection system for diabetes and epilepsy patient

This block of code is function to create delay by setting global delaytime to callClocksystemtime
plus clock rate of 1000. Until clock1.systemTime greater than global delaytime.

This block of code shows when back screen is pressed application return to home screen

4.7.3 Screen to read Received message

This Screen is activated when received button of home Screen is clicked, on this screen when
new received message is available user automatically read message and click button read to
make it loud if depend on users need. When back screen is pressed it automatically returned to
home screen.

51
Fall detection system for diabetes and epilepsy patient

Figure 31 Read Screen of fall app


Blockes for Receive message
This block of code used to initialize incomingTexts.

This block of code check for new message is received from any incoming number

52
Fall detection system for diabetes and epilepsy patient

This block of code is used to make to received message when button is clicked.

This block of code is function to create delay by setting global delaytime to callClocksystemtime
plus clock rate of 1000. Until clock1.systemTime greater than global delaytime.

Blocke of code for returing back to home screen.

4.7.4 Design Screen to help user

Based on the sensor value this system give help information to calibrate status of user health.
And when back button is pressed Screen automatically back to home screen.

53
Fall detection system for diabetes and epilepsy patient

Figure 32: help Screen of fall app


Blockes for help Screen
When listpicker is clicked is block code check for Bluetooth is connected and enable listpicker

54
Fall detection system for diabetes and epilepsy patient

When button is clicked block of code convert textTopeech the information

Bock of code able to return to home Screen when back is pressed

4.8 Acceptability of the system

4.8.1 Test acceptability for Hardware (Arduino Code)

Algorithm of Arduino C code for detecting fall through white box testing.
1. int led1=8;//Pin for LED
2. int button = 13; //Pin for button
3. int buzzer = 4; // Pin for buzzer
4. const int sensor=A1;//Pin for temperature sensor
5. int x=0, y=0, z=0; // variable receive accelerometer axis value
6. int AM; // variable hold magnitude accelerometer axis values
7. void readAccel() {
8. uint8_t howManyBytesToRead = 6;
9. readFrom( DATAX0, howManyBytesToRead, _buff);
10. int x = (((int)_buff[1]) << 8) | _buff[0];
11. int y = (((int)_buff[3]) << 8) | _buff[2];
12. int z = (((int)_buff[5]) << 8) | _buff[4];
13. int AM;
14. Serial.print("x: ");

55
Fall detection system for diabetes and epilepsy patient

15. Serial.print( x );
16. Serial.print(" y: ");
17. Serial.print( y );
18. Serial.print(" z: ");
19. Serial.println( z );
20. AM=pow(pow(x,2)+pow(y,2)+pow(z,2),0.5);
21. falldetection( AM);
22. }
23. if(AM>=127 && AM<=128&&tempc >= 30&&vab>8&&sensorValue>=3200){
24. if(digitalRead(button) == LOW) //Here we are checking if the button is pushed
25. {
26. Serial.println("False Detections is made ");
27. digitalWrite(buzzer, LOW);
28. digitalWrite(led1, LOW);}}
29. else{
30. Serial.println("Fall is Detected ");
31. digitalWrite(buzzer, HIGH);
32. digitalWrite(led1, HIGH);
33. }
4.8.1.1 Flow Graph
Flow graph of any given code is indication of the code flow path that we could achieved the
desired out put through this paths and also bases for calculating the Cyclomatic complexity of
the code.

56
Fall detection system for diabetes and epilepsy patient

Figure 33: Cyclomatic flow graph

4.8.1.2 Cyclomatic Complexity

Cyclomatic Complexity of the given code is to find out the independent path of the code to the
final out put this could be achieved form the above flow graph of the fall detection code even
though there could be lots of node the linear node can be represented as single node so
depending on the number of node and edges independent path is found.

V (G) = e-n+2p

Where V (G) = Cyclomatic Complexity, e= number of edges, n = number of node and p free path
from the above graph the number of node is 11, whereas the number of edges is 15 and the free
path to the output is 1 so V (G) = e-n+2p 15-11+ 2P=6, V (G) can also be calculated by number
of decision node +1 so five decision node + 1 = 6 paths are available

4.8.1.3. Graph Matrix

57
Fall detection system for diabetes and epilepsy patient

Graph Matrix is a squire matrix which has equal number of row and column as the number of
nod in the above flow graph on the graph matrix the connection between the nodes will be filled
in the corresponding space of the connection node, the filled place considered as 1 and sum of
the horizontal 1s minus 1 and add those differences down vertically and add 1 to it and number
of independent path is the sum

Table 2: Cyclomatic Graph matrix


Node 1,21 22 23 24 25 26 27 28 29 30 31
1,21 1 1-1=0
22 1 1 2-1=1
23 1 1 2-1=1
24 1 1 2-1=1
25 1 1 2-1=1
26 1 1 2-1=1
27 1 1-1=0
28 1 1-1=0
29 1 1-1=0
30 1 1-1=0
31 5+1=6

4.8.1.4 Test Cases

From the fall detection code the variable we are using to detect fall are x, y and z for
accelerometer axis and AM for computing the values of this variable to decide fall and from our
Cyclomatic complexity there are 6 paths to the end node

58
Fall detection system for diabetes and epilepsy patient

Table 3: Test Case Cyclomatic complexity


variables Defined Used at node Moves from defined Definition clear
at node node to used node
x 5 10,14,15,20 From 5 to Yes
10,14,15,20
y 5 11,16,17,20 From 5 to Yes
11,16,17,20
z 5 12,18,19,20 From 5 to Yes
12,18,19,20
AM 13 20,21,22 From 13 to 20,21,22 yes

4.8.2 Software acceptability test for android application

A given code is sample android cade for testing acceptability of android applications
A. While (clock1.timer >0)
B. Do {
C. If (bluetoothclient1 Is connected)
D. {
E. If (call bluetoothclient1.bytsavailabe to receive)
F. {
G. Set label1.text = call Bluetooth client1. Receive
H. }
I. delay();
J. }
K. }
Void delay ()
{
Call clock1.Sytemtime=set label delay time;
Set global delay time =get global delay time + 1000;
While (call clock1.system time <get global delay time)
}

59
Fall detection system for diabetes and epilepsy patient

4.8.2.1 Flow graph of the android app

Figure 34: Software test Flow graph for androin code


4.8.2.2 Cyclomatic Complexity
For the android application the Cyclomatic Complexity is also number of the nodes subtracted
from the number of edges in the above flow graph so depending on the number of node and
edges independent path is found

V (G) = e-n+2p

Where V (G) = Cyclomatic Complexity, e= number of edges, n = number of node and p free path
from the above graph the number of node e=15, n=10 and p=1 15-10+2(1) =7 or the number of
decision node plus 1 so 6+1=7

60
Fall detection system for diabetes and epilepsy patient

4.8.2.3. Graph Matrix


Table 4: Graph matrix for the android app
nodes A B C D E F G H I J

A 1 1 2-1=1
B 1 1 2-1=1

C 1 1 2-1=1

D 1 1-1=0

E 1 1-1=0

F 1 1 2-1=1

G 1 1-1=0
H 1 1 2-1=1

I 1 1 2-1=1
J 6+1=7

4.8.2.4. TEST CASE since we don’t use any variable in the android application code driving test
cases is not necessary.

Note: With the analysis that the proponents have done on the very important structure of the
system including the hardware (arduino code) and software (android app developed using MIT
App Inventor), results shows that our algorithm is structured, therefore, makes our system
acceptable based on the requirements of software development.

61
Fall detection system for diabetes and epilepsy patient

CHAPTER 5
CONCLUSIONS AND RECOMMENDATION

5.1 Conclusions

A fall detection system is a mechanism used to detect fall of a person based on comparison of the
position of a person or an object relative to the ground using either specific sensors like
accelerometer or detecting and analyzing collusion of the target with the ground. Fall detection
system is a system requires fall detector sensor processing device and communication system.
Diabetes and epilepsy is non transmitted disease due to sugar level, heart beat rate, muscle
fatigue and squeezing of mental fall may be detected. This fall detection system have a functions
of Automatic Fall detection using accelerometer, Seizure detection using vibration sensor, Body
temperature reading by temperature sensor lm35, measuring heartbeat rate using BP sensor,
Heart beat and blood concentration level using BP sensor and response on Automatic Messaging
System including GPS location and patient information using GSM module, Parameter
displaying using android app and Android application based help.

Hardware design of fall detection system is designed on Arduino Uno R3 microcontroller


integrate all sensor for detection and GMS and GPS insure functionality of the system. Android
app is communicate with hardware through Bluetooth module for data transmissions.

With the analysis that the proponents have done on the very important structure of the system
including the hardware (Arduino code) and software (android app developed using MIT App
Inventor), results shows that our algorithm is structured, therefore, makes our system acceptable
based on the requirements of software development.

62
Fall detection system for diabetes and epilepsy patient

5.2 Recommendations

Fall detections system has some limitations, the real time device is a bit large to handle so we
recommend all kit integrated together it to one component this increase efficiency of detection
system. Fall detection system cannot distinguish whether the fall is a true or a false fall without
human interference, for next the have intelligence to determine whether fall true or not by itself.
The GPS module detect latitude and longitude of location, this is not enough to position exact
location of patient fall system needs another software that convert latitude and longitude to exact
real time location like google earth. The system uses a power bank, which requires continuous
charging. Some of the sensors (vibration sensor) can be manipulated by external factors, so the
system should be fault tolerate. For prevent fall system integrate vital sign sensor.

The following points are forwarded to improve the performance and reliability of the system

 Minimizing the size of system

 Using more sensors to increase its reliability of system

 Use a better technic to locate the exact position of the person

 Improved power source (generate power from walking legs person)

 Implement a better logic algorithm to decide whether the fall is a false fall or not by it
self

 The integrate intelligence to system for identifying true falls without human interference.

 System include vital sign sensor for fall preventions.

63
Fall detection system for diabetes and epilepsy patient

Reference
1. D. Chen, W. Feng, Y. Zhang, X. Li and T. Wang, "A wearable wireless fall detection system
with accelerators," in Robotics and Biomimetics (ROBIO), 2011 IEEE International Conference
on, 2011., Phuket.

2. M. de la GuiaSolaz, A. Bourke, R. Conway, J. Nelson and G. OÌ.Laighin, "Real-time low-


energy fall detection algorithm with a Programmable Truncated MAC," in Engineering in
Medicine and Biology Society (EMBC), 2010 Annual International Conference of the IEEE,
2010, Buenos Aires

3. T. Banerjee, J. M. Keller, Z. Zhou, M. Skubic, and E. Stone,”Day or Night Activity


Recognition From Video Using Fuzzy Clustering Techniques” IEEE transactions on fuzzy
systems, VOL. NO. 3, JUNE 2011

4.Tang, A. Y., Ong, C. H., & Ahmad, A. (2015). Fall Detection Sensor System for the Elderly.
International Journal of Advanced Computer Research, 5(19), 176.

5. Scuffham P, Chaplin S, Legood R (2003). Incidence and costs of unintentional falls in older
people in the United Kingdom. Journal of Epidemiology and Community Health, 57:740-
744Blake AJ, Morgan K, Bendall MJ et al. (1988). Falls by elderly people at home: prevalence
and associated factors. Age Ageing; 17: 365–72.

6. World Health Organization. Ageing, & Life Course Unit. (2008). WHO global report on falls
prevention in older age. World Health Organization.

7. Noor, A. M., Zainudin, H., Hanafi, N., Baharuddin, S. A.,Rahim, M. A. A. (2015).


Accelerometer Sensor Based Fall Sensing for Elderly. JurnalTeknologi, 73(1).

8.Miaou, S. G., Sung, P. H., and Huang, C. Y. (2006, April). A customized human fall detection
system using omni-camera images and personal information. In Distributed Diagnosis and Home
Healthcare, 2006. D2H2. 1st Transdisciplinary Conference on (pp. 39-42). IEEE.49

9. T. Degen and H. Jaeckel, SPEEDY: A Fall Detector in a WristWatch, In Proc. Seventh IEEE
International Symposium on Wearable Computing (ISWC 2003), pp. 184-189, White Plains,
NY, USA, 21-23 October, 2003

64
Fall detection system for diabetes and epilepsy patient

10.X. Yu (2008, July).Approaches and Principles of Fall Detection for Elderly and Patient.e
health Networking, Applications and Services. Health Com 10th International Conference on,
Singapore, pp. 43-47

11.Hardesty, Larry (August 19, 2010). "The MIT roots of Google's new software". MIT News
Office.
12."On the Shoulders of Giants!". Google. Retrieved August 10, 2010.
13.Wolber, David; Abelson, Hal; Spertus, Ellen; Looney, Liz (May 2011), App Inventor for
Android: Create Your Own Android Apps, O'Reilly, ISBN 978-1-4493-9748-7
14. Clark,first=Andrew (December 30, 2013), App Inventor launches second iteration
15.App Inventor Classic, December 3, 2013
16. Epilepsy: Information for You and Those Who Care about You By Elaine Wyllie: page 122

65
Fall detection system for diabetes and epilepsy patient

Appendices

Sample Arduino C code


#include <TinyGPS++.h>
#include <TinyGPS.h>
#include <Wire.h>
#include <String.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
SoftwareSerial Serial1(2, 3); // RX, TX bluetooth connection pin
SoftwareSerial Serial2(4, 5); // RX, TX gps module
SoftwareSerial Serial3(6, 7); // RX,TX gsm module
//pin discription
int button = 13; //Pin for button
int buzzer = 12; // Pin for buzzer
int led1=11;// pin for led
//pin for sensor
int vibsensor=A0;
int tempsensor=A1;
int Bpsensor = A2;
// viriable diclaretion
int vab=0;
int sensorValue = 0; // variable to store the value coming from the sensor
float bp;
const int sensor=A1; // Assigning analog pin A1 to variable 'sensor'
float tempc; //variable to store temperature in degree Celsius
float tempf; //variable to store temperature in Fahreinheit
float vout; //temporary variable to hold sensor reading
int x=0, y=0, z=0;
int AM;

66
Fall detection system for diabetes and epilepsy patient

int timeTosend=2;
int timeTocall=5;
int count=0;
char phone_no[]="25192133805";
//function declaration
#define DEVICE (0x53) // Device address as specified in data sheet
byte _buff[6];
char POWER_CTL = 0x2D; //Power Control Register
char DATA_FORMAT = 0x31;
char DATAX0 = 0x32; //X-Axis Data 0
char DATAX1 = 0x33; //X-Axis Data 1
char DATAY0 = 0x34; //Y-Axis Data 0
char DATAY1 = 0x35; //Y-Axis Data 1
char DATAZ0 = 0x36; //Z-Axis Data 0
char DATAZ1 = 0x37; //Z-Axis Data 1
char g_buffer[255]; // the sentence being read from the GPS unit
int g_buffer_used; // how many bytes of it we've used
char g_time[10]; // last time we decoded
char g_date[12]; // last date we decoded
bool g_update_clock; // sets true if the time/date has been updated
void setup(){
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
Serial3.begin(9600);
lcd.begin(16,2);
//pin initialazation
pinMode(A5,INPUT);

67
Fall detection system for diabetes and epilepsy patient

pinMode(A4,INPUT);
pinMode(Bpsensor, INPUT);
pinMode(vibsensor,INPUT);
pinMode(tempsensor,INPUT); // Configuring pin A1 as input
pinMode(button, INPUT); //button is declared as input
pinMode(buzzer, OUTPUT); //buzzer is declared as output
pinMode(led1,OUTPUT);
//Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register.
writeTo(DATA_FORMAT, 0x01);
//Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register.
writeTo(POWER_CTL, 0x08);
//gps variable initialation
g_buffer[0] = 0;
g_buffer_used = 0;
sprintf(g_time, "HH:MM:SS");
sprintf(g_date, "DD/MM/20YY");
g_update_clock = false;
while(Serial1.available())
if (Serial1.read() == '\r')
break;
Serial.println("well come to fall detection system");
}
void loop(){
if(Serial1.available()||Serial2.available()||Serial3.available()){
Serial.write(Serial1.read());
Serial.write(Serial2.read());
Serial.write(Serial3.read());
}
if (Serial.available()){
Serial1.write(Serial.read());
Serial2.write(Serial.read());

68
Fall detection system for diabetes and epilepsy patient

Serial3.write(Serial.read());
}
temp();
Bpsens();
vabration();
readAccel(); // read the x/y/z tilt
delay(1000);
}
void temp()
{
vout=analogRead(tempsensor);
vout=(vout*500)/1023;
tempc=vout; // Storing value in Degree Celsius
tempf=(vout*1.8)+32; // Converting to Fahrenheit
Serial.print("in DegreeC=");
Serial.print("\t");
Serial.print(tempc);
Serial.println();
lcd.setCursor(0,0);
lcd.print("in DegreeC= ");
lcd.println(tempc);
Serial.print("in Fahrenheit=");
Serial.print("\t");
Serial.print(tempf);
Serial.println();
lcd.setCursor(1,0);
lcd.print("in Fahrenheit=");
lcd.println(tempf);
delay(1000); //Delay of 1 second for ease of viewing
Serial1.print("temperatue=");
Serial1.println(tempc);

69
Fall detection system for diabetes and epilepsy patient

Serial1.println("|");
}
void Bpsens(){
sensorValue = analogRead(Bpsensor);
bp = 4.0 * (sensorValue - 200);
Serial.print("blood presure= ");
Serial.println(sensorValue);
Serial.println(bp);
Serial1.println("blood presure=");
Serial1.println(bp);
Serial1.println("|");
lcd.setCursor(0,0);
lcd.print("blood presure=");
lcd.println(bp);
delay(1000);
}
void vabration()
{
vab=analogRead(vibsensor);
Serial.println(vab);
if(vab>8){
Serial.println("Vibration is happend");
lcd.setCursor(0,0);
lcd.println("Vibration is happend");
}
// put your main code here, to run repeatedly:
}
void readAccel() {
uint8_t howManyBytesToRead = 6;
readFrom( DATAX0, howManyBytesToRead, _buff); //read the acceleration data from the ADXL345
// each axis reading comes in 10 bit resolution, ie 2 bytes. Least Significat Byte first!!

70
Fall detection system for diabetes and epilepsy patient

// thus we are converting both bytes in to one int


int x = (((int)_buff[1]) << 8) | _buff[0];
int y = (((int)_buff[3]) << 8) | _buff[2];
int z = (((int)_buff[5]) << 8) | _buff[4];
int AM;
Serial.print("x: ");
Serial.print( x );
Serial.print(" y: ");
Serial.print( y );
Serial.print(" z: ");
Serial.println( z );
lcd.clear();
lcd.setCursor(0,0);
AM=pow(pow(x,2)+pow(y,2)+pow(z,2),0.5);
falldetection( AM);
}
void falldetection(int AM){
Serial.print("Accelerometer sensor reads = ");
Serial.println(AM);
if(AM>=127 && AM<=128||tempc >= 30||vab>8&&sensorValue>=3200)
{
if(digitalRead(button) == LOW) //Here we are checking if the button is pushed
{
lcd.print("False Detected");
Serial.println("False Detections is made ");
digitalWrite(buzzer, LOW); //Here we are turning buzzer on
digitalWrite(led1, LOW);
delay(2000);
}
else{
lcd.println("Fall is Detected ");

71
Fall detection system for diabetes and epilepsy patient

Serial.println("Fall is Detected ");


digitalWrite(buzzer, HIGH); //Here we are turning buzzer on
digitalWrite(led1, HIGH);
delay(3000);
gsmtext();
} }
else{
Serial.println("There is NO Fall" );
}}
Wire.endTransmission(); // end transmission
}
void gsmtext(){
while (Serial.available()){
if(count<timeTosend){
delay(1500);
Serial.print("AT+CMGS=\"");
Serial.print(phone_no);
Serial.println("\"");
while(Serial.read()!='>');
{
Serial.print("My text from gsm.person is Failled ..");
delay(500);
Serial.write(0x1A);
Serial.write(0x0D);
Serial.write(0x0A);
delay(5000);
}
count++;
}}}

72

You might also like