In order to understand, fall detection MPU6050 which is a gyro and accelerometer sensor has been used. MPU6050 can be named as IMU device because it contains a gyroscope combined with an accelerometer. This IMU device has 6 inputs, 3 of them being for the gyroscope and 3 of them being for the accelerometer. Consequently, it can also be named as 6-DOF IMU. This sensor can be used in many places like phones, remote controllers, quadcopters, position tracing tilt calculating or making a compass, etc. This sensor has been used because it can calculate tilts and it can calculate the position of the sensor.
For the purpose of the project MPU6050 has been placed on a PCB inside the device. Since there is only one proper position to wear the device onto the mask, the position of MPU6050 is known at all times. In order to test fall detection calculation, MPU6050 is set to detect outcomes in 3 different axes which can be referred to as x, y, and z. Hence, calculations have been made for x, y, and z-axis values while the device is on. After the calculations made which will be explained in the calculations section, it is known that the value of the y axis will always be equal to 1. The reason for that while the device is being used, its position will be perpendicular to the ground, and so to the surface of the earth. If the device is used as a parallel to the ground and as being faced to the surface of the earth, the value for the z-axis will be calculated as 1. On the other hand, if the device is used as a parallel to the ground but is not facing the surface of the earth, the value of the z-axis will be calculated as -1.
So, with this simplified approach we can concluded that if the z value is equal to 1 or -1, it means that the person who is using the device has fallen on the ground and his/her face is parallel to the ground. In order to differentiate the times where a person really falls on the ground and where a person bows down, some simple coding improvements have been made by adding the element of time to the calculations.
Thus, when a person who uses this device falls on the ground, the device can detect it by considering the calculations made for the z value. In different situations such as a person falling on his/her left or right, the device would still be expected to work since once someone falls sideways, they tend to make themselves parallel to the ground because lying back is more practical and natural for waiting help.