You are on page 1of 17

Project Review - 3

Page - 1

A project report on
“Fall Detection for Elderly and Patients”

Submitted in partial fulfilment for the award of the degree of

B. Tech CSE
by
Anshul Guglani 18BCE2112
Gagan Yadav 18BCE2056
Crish Karthik 18BCE2171

Under the guidance of


Prof. Dr. B. D. DEEBAK
Project Review - 3
Page - 2

ACKNOWLEDGEMENT
It is our pleasure to express with deep sense of gratitude to Prof Deebak B D, Vellore Institute
of Technology, for his constant guidance, continual encouragement, understanding; more than
all, he taught me patience in our endeavour. Our association with him is not confined to
academics only, but indeed is a great opportunity on our part of work with an intellectual and
expert in the field of Internet Of Things.
It is indeed a pleasure to thank my friends who persuaded and encouraged me to take up and
complete this task. At last, but not least, I express my gratitude and appreciation to all those
who have helped me directly or indirectly toward the successful completion of this project.

Place: Vellore Name of the students: Anshul Guglani,


Gagan Yadav, Crish Karthik
Project Review - 3
Page - 3

INDEX

1. OBJECTIVES

2. BACKGROUND AND MOTIVATION

3. METHODOLOGY

4. TOOLS DESCRIPTION

5. USER INTERFACE

6. DEMONSTATION

7. LITERATURE SURVEY

8. CONCLUSION

9. REFERENCES
Project Review - 3
Page - 4

1. Objectives:

The goal of our initiative is to make a wearable gadget which can recognize an old
individual's fall by investigation of their speed increase. At that point it will get the
elder’s geographic position and send message to guardian figures. So, the old individual
who has fallen can get convenient assistance to limit the negative impact.

2. Background and Motivation:

Tumbling down is hazardous to elderlies around the world. On the off chance that they
fall, we should have the option to help them straightaway before any terrible things
occur. The issue is we can't generally keep a watch on their exercises. The significant
danger of falls and the considerable expansion in the older populace make the
programmed fall location framework become vital.

Existing fall discovery frameworks utilizing accelerometer as the indicator are


frequently planned dependent on an exact speed increase limit to separate tumbles from
ordinary exercises. An ideal discovery edge can be acquired which meets the
predetermined bogus alert rate while boosting the location likelihood. Thus, in this
venture we will make a model of fall identification to tackle the issue above.

This gadget aims to send an alarm to a parental figure's email if a fall is recognized,
subsequently empowering them to proceed to help them quickly to diminish any danger
of entanglements or injury.
Project Review - 3
Page - 5

3. Methodology:

A gyroscope and an accelerometer sensor are included within the MPU6050 sensor
module (which we’ll be using). The accelerometer gives information about the angular
motion alongside the X, Y, and Z-axis data, while the gyroscope determines the
orientation. We will compare the acceleration magnitude to the threshold value to detect
a fall. The gadget will send an SMS to the user if a fall is detected.

Our code first determines if the accelerometer data surpass the lower threshold, then
waits 0.5 seconds before determining the upper threshold. If the accelerometer
measurements cross the higher threshold, the change in orientation is calculated using
the gyroscope measurements.
Calculation utilized in this fall framework depends on the magnitude data of the
acceleration obtained and the rotational angle measurements. When an actual fall
occurs, the impact between the human body and the ground produces a visible peak
value at the cumulative acceleration a, which has magnitude, where ax, ay, and az are
three-axis accelerometer values.

The system uses this magnitude acceleration as the first step to distinguish high
intensity movement from others. But normal motions such as jumping or sitting also
produce peak values which mean that additional detection features are required.

The subsequent component utilized would be the angle of fall measurement data using
the rotational gravity vectors in fixed coordinates
Project Review - 3
Page - 6

IFTTT Setup
IFTTT (If This Then That) is a web-based tool that allows us to construct applets,
which are chains of conditional statements. We may use these applets to send emails,
tweets, and Facebook posts, as well as play music, send SMS, and get notifications.
We're using IFTTT in this project to send SMS messages to the phone when the
system detects a fall.

The IFTTT account credentials will later be used in the code to connect our system.
Project Review - 3
Page - 7

4. Tools Description:
1. Hardware needed:
1.1 NodeMCU ESP8266
1.2 MPU6050 triple axis acc gyro
2. Software needed:
2.1 Arduino IDE
2.2 IFTTT website
3. Other equipment:
3.1.Connecting wires
3.2 Bread board
Project Review - 3
Page - 8

CIRCUIT DIAGRAM:

Programming NodeMCU
5. User Interface:

The microcontroller (NodeMCU) is connected to MPU6050 (Accelerometer and


gyroscope sensor). When the person falls, there is an increase in the acceleration of the
sensor, and after it crosses the threshold limit , a SMS is sent to the Phone number
specified using IFTTT technology mentioned.

Connections:
Project Review - 3
Page - 9

6. Demonstration (Code and Output):

➢ This is the IFTTT applet which is connected to the node MCU of our device

➢ The Mobile Number entered in the applet will be used to send the fall detection
message.
Project Review - 3
Page - 10

➢ This is the code which will be used to detect the fall which will send the message to
the IFTTT applet
➢ The WIFI credentials of the user will be updated to the code.
➢ #include <Wire.h>
➢ #include <ESP8266WiFi.h>
➢ const int MPU_addr=0x68; // I2C address of the MPU-6050
➢ int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
➢ float ax=0, ay=0, az=0, gx=0, gy=0, gz=0;
➢ boolean fall = false; //stores if a fall has occurred
➢ boolean trigger1=false; //stores if first trigger (lower threshold) has
occurred
➢ boolean trigger2=false; //stores if second trigger (upper threshold) has
occurred
➢ boolean trigger3=false; //stores if third trigger (orientation change) has
occurred
➢ byte trigger1count=0; //stores the counts past since trigger 1 was set true
➢ byte trigger2count=0; //stores the counts past since trigger 2 was set true
➢ byte trigger3count=0; //stores the counts past since trigger 3 was set true
➢ int angleChange=0;
➢ // WiFi network info.
➢ const char *ssid =
➢ "Gagan"; // Enter your Wi-Fi Name
➢ const char *pass = "ekbvcygjh96hw"; // Enter your Wi-Fi Password
➢ void send_event(const char *event);
➢ const char *host = "maker.ifttt.com";
➢ const char *privateKey = "gagan@ifttt";
➢ void setup(){
➢ Serial.begin(115200);
➢ Wire.begin();
➢ Wire.beginTransmission(MPU_addr);
➢ Wire.write(0x6B); // PWR_MGMT_1 register
➢ Wire.write(0); // set to zero (wakes up the MPU-6050)
➢ Wire.endTransmission(true);
Project Review - 3
Page - 11
➢ Serial.println("Wrote to IMU");
➢ Serial.println("Connecting to ");
➢ Serial.println(ssid);
➢ WiFi.begin(ssid, pass);
➢ while (WiFi.status() != WL_CONNECTED)
➢ {
➢ delay(500);
➢ Serial.print("."); // print ... till not connected
➢ }
➢ Serial.println("");
➢ Serial.println("WiFi connected");
➢ }
➢ void loop(){
➢ mpu_read();
➢ ax = (AcX-2050)/16384.00;
➢ ay = (AcY-77)/16384.00;
➢ az = (AcZ-1947)/16384.00;
➢ gx = (GyX+270)/131.07;
➢ gy = (GyY-351)/131.07;
➢ gz = (GyZ+136)/131.07;
➢ // calculating Amplitute vactor for 3 axis
➢ float Raw_Amp = pow(pow(ax,2)+pow(ay,2)+pow(az,2),0.5);
➢ int Amp = Raw_Amp * 10; // Mulitiplied by 10 bcz values are between 0 to
1
➢ Serial.println(Amp);
➢ if (Amp<=2 && trigger2==false){ //if AM breaks lower threshold (0.4g)
➢ trigger1=true;
➢ Serial.println("TRIGGER 1 ACTIVATED");
➢ }
➢ if (trigger1==true){
➢ trigger1count++;
➢ if (Amp>=12){ //if AM breaks upper threshold (3g)
➢ trigger2=true;
➢ Serial.println("TRIGGER 2 ACTIVATED");
➢ trigger1=false; trigger1count=0;
➢ }
➢ }
➢ if (trigger2==true){
➢ trigger2count++;
➢ angleChange = pow(pow(gx,2)+pow(gy,2)+pow(gz,2),0.5);
Serial.println(angleChange);
➢ if (angleChange>=30 && angleChange<=400){ //if orientation changes by
between 80-100 degrees
➢ trigger3=true; trigger2=false; trigger2count=0;
➢ Serial.println(angleChange);
➢ Serial.println("TRIGGER 3 ACTIVATED");
➢ }
➢ }
➢ if (trigger3==true){
➢ trigger3count++;
➢ if (trigger3count>=10){
➢ angleChange = pow(pow(gx,2)+pow(gy,2)+pow(gz,2),0.5);
➢ //delay(10);
➢ Serial.println(angleChange);
➢ if ((angleChange>=0) && (angleChange<=10)){ //if orientation changes
remains between 0-10 degrees
➢ fall=true; trigger3=false; trigger3count=0;
➢ Serial.println(angleChange);
➢ }
Project Review - 3
Page - 12
➢ else{ //user regained normal orientation
➢ trigger3=false; trigger3count=0;
➢ Serial.println("TRIGGER 3 DEACTIVATED");
➢ }
➢ }
➢ }
➢ if (fall==true){ //in event of a fall detection
➢ Serial.println("FALL DETECTED");
➢ send_event("fall_detect");
➢ fall=false;
➢ }
➢ if (trigger2count>=6){ //allow 0.5s for orientation change
➢ trigger2=false; trigger2count=0;
➢ Serial.println("TRIGGER 2 DECACTIVATED");
➢ }
➢ if (trigger1count>=6){ //allow 0.5s for AM to break upper threshold
➢ trigger1=false; trigger1count=0;
➢ Serial.println("TRIGGER 1 DECACTIVATED");
➢ }
➢ delay(100);
➢ }
➢ void mpu_read(){
➢ Wire.beginTransmission(MPU_addr);
➢ Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
➢ Wire.endTransmission(false);
➢ Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers
➢ AcX=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C
(ACCEL_XOUT_L)
➢ AcY=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E
(ACCEL_YOUT_L)
➢ AcZ=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40
(ACCEL_ZOUT_L)
➢ Tmp=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
➢ GyX=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44
(GYRO_XOUT_L)
➢ GyY=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46
(GYRO_YOUT_L)
➢ GyZ=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48
(GYRO_ZOUT_L)
➢ }
➢ void send_event(const char *event)
➢ {
➢ Serial.print("Connecting to ");
➢ Serial.println(host);
➢ // Use WiFiClient class to create TCP connections
➢ WiFiClient client;
➢ const int httpPort = 80;
➢ if (!client.connect(host, httpPort)) {
➢ Serial.println("Connection failed");
➢ return;
➢ }
➢ // We now create a URI for the request
➢ String url = "/trigger/";
➢ url += event;
➢ url += "/with/key/";
➢ url += privateKey;
➢ Serial.print("Requesting URL: ");
➢ Serial.println(url);
➢ // This will send the request to the server
Project Review - 3
Page - 13
➢ client.print(String("GET ") + url + " HTTP/1.1\r\n" +
➢ "Host: " + host + "\r\n" +
➢ "Connection: close\r\n\r\n");
➢ while(client.connected())
➢ {
➢ if(client.available())
➢ {
➢ String line = client.readStringUntil('\r');
➢ Serial.print(line);
➢ } else {
➢ // No data yet, wait a bit
➢ delay(50);
➢ };
➢ }
➢ Serial.println();
➢ Serial.println("closing connection");
➢ client.stop();
}

➢ Once the module is dropped the message will be sent to the entered mobile no. in the
applet
➢ This message will indicate the time and date the module is been dropped.
Project Review - 3
Page - 14

Video demonstration link:

https://drive.google.com/file/d/1vBfpnndonTyUGmfUGNujirebQ9xVMHfK/view?usp=shari
ng

Final Code Snippet:


Project Review - 3
Page - 15

7. Literature Survey:

S.no Year Journal Name Highlights Content

1 2013 Osteoporosis Prevention of This paper highlights that


International falls in the elderly people’s fall can lead to
elderly serious health issue and is the
reason of decline of their
physical fitness.

2 2012 IEEE Sensors Sensors-based The paper stresses on the fact


Journal wearable that later attending of patients
systems for can worsen the situation.
monitoring of
human
movement and
falls

3 2013 Neurocomputing A survey on fall Fall detection approaches are


detection: divided into three main
principles and categories: wearable device
approaches based, ambience device
based and vision based.

4 2010 IEEE Sensors 3D ToF camera A wearable gadget is set on


Conference and wireless human's midsection. The
accelerometer framework can distinguish the
old's falling by speed increase
investigation. At that point it
will get the elder’s geographic
position and send miss the
mark message to parental
figures. So the old who has
fallen can get ideal assistance
to limit the negative impact
Project Review - 3
Page - 16

Base Paper:

Wu, F., Zhao, H., Zhao, Y., & Zhong, H. (2015). Development of a wearable-sensor-based fall detection
system. International journal of telemedicine and applications, 2015.

In [11] a fall detection system based on a single triaxial accelerometer-based wearable device was
created. Because the algorithm does not claim the axes of the accelerometer to be parallel, there are no
additional requirements for the device's mounting orientation. Fastened with rigour The hardware in the
system consumes very little power, design and implementation of an extremely efficient algorithm that
might be extended the wearable device's service life. Both the hardware and the software Wearable and
outdoor software designs are available.

8. Conclusion:

With growing technology and the vast development in IoT devices soon in the near
future these technologies will conquer all the sectors and the day to day life of man.
Our initiative to help the medical sector and elderly people has led to the study and
developing of this fall detection IoT device which we think has been successfully
working. This wearable device consumes very less power and has a very efficient
algorithm. Like all the other devices even this device also has its setbacks, the might be
a heavy possibility that regular activities in our day to day life might also trigger fall
alarm. We hope this paper would help the future designers to improve on the existing
model ultimately giving birth to new opportunities.
Project Review - 3
Page - 17

References:

[1] Karlsson, M. K., Magnusson, H., von Schewelov, T., & Rosengren, B. E. (2013). Prevention of falls
in the elderly—a review. Osteoporosis international, 24(3), 747-762.

[2] Shany, T., Redmond, S. J., Narayanan, M. R., & Lovell, N. H. (2011). Sensors-based wearable
systems for monitoring of human movement and falls. IEEE Sensors journal, 12(3), 658-670

[3] Mubashir, M., Shao, L., & Seed, L. (2013). A survey on fall detection: Principles and
approaches. Neurocomputing, 100, 144-152

[4] Grassi, M., Lombardi, A., Rescio, G., Ferri, M., Malcovati, P., Leone, A., ... & Gonzo, L. (2010,
November). An integrated system for people fall-detection with data fusion capabilities based on 3D ToF
camera and wireless accelerometer. In SENSORS, 2010 IEEE (pp. 1016-1019). IEEE..

[5] Bourke, A. K., O'Donovan, K., Clifford, A., ÓLaighin, G., & Nelson, J. (2011, August). Optimum
gravity vector and vertical acceleration estimation using a tri-axial accelerometer for falls and normal
activities. In 2011 Annual International Conference of the IEEE Engineering in Medicine and Biology
Society (pp. 7896-7899). IEEE..

[6] Anania, G., Tognetti, A., Carbonaro, N., Tesconi, M., Cutolo, F., Zupone, G., & De Rossi, D. (2008,
October). Development of a novel algorithm for human fall detection using wearable sensors.
In SENSORS, 2008 IEEE (pp. 1336-1339). IEEE.

[7] Li, Q., Stankovic, J. A., Hanson, M. A., Barth, A. T., Lach, J., & Zhou, G. (2009, June). Accurate,
fast fall detection using gyroscopes and accelerometer-derived posture information. In 2009 Sixth
International Workshop on Wearable and Implantable Body Sensor Networks (pp. 138-143). IEEE.

[8] Sabatelli, S., Galgani, M., Fanucci, L., & Rocchi, A. (2012). A double-stage Kalman filter for
orientation tracking with an integrated processor in 9-D IMU. IEEE Transactions on Instrumentation
and Measurement, 62(3), 590-598.

[9] Bianchi, F., Redmond, S. J., Narayanan, M. R., Cerutti, S., & Lovell, N. H. (2010). Barometric
pressure and triaxial accelerometry-based falls event detection. IEEE Transactions on Neural Systems
and Rehabilitation Engineering, 18(6), 619-627.

[10] Hsieh, S. L., Chen, K. R., Yeh, C. L., & Chen, C. C. (2014, October). An unfixed-position
smartphone-based fall detection scheme. In 2014 IEEE International Conference on Systems, Man, and
Cybernetics (SMC) (pp. 2077-2081). IEEE.

[11] Wu, F., Zhao, H., Zhao, Y., & Zhong, H. (2015). Development of a wearable-sensor-based fall
detection system. International journal of telemedicine and applications, 2015.

You might also like