# Forward Fall Detection Using Inertial Data and Machine Learning
## 2 Materials and Methods  
### Measurement of the Two-Axis Acceleration from Real Subjects  
To measure the acceleration data from real subjects, a Raspberry Pi Pico W with an MPU6050 accelerometer (Raspberry Pi, Bucharest, Romania) was used to develop a portable inertial measurement unit (IMU).  
The Raspberry Pi Pico is a commonly used, low-cost, high-performance microcontroller board which has the required 3.3 V power outlet and analog input to operate the MPU-6050 accelerometer. The MPU-6050 is an electronic circuit with a 3-axis Gyroscope, 3-axis Accelerometer, Digital Motion Processor, and a Temperature sensor. It requires just two connections to communicate across the I/C interface. The setup is presented in Figure 1.  
To power on the sensor, the 3V3 PIN on the Raspberry-Pi is connected to the VCC of the MPU6050, and the GND pin to the GND of the MPU6050.  
For signal transmission, the Serial Dala Line Pin I2C0 SDA (Pin 1) and Serial clock Line PIN I2C0 SLC (Pin 2) are connected to the MPU6050's SDA and SCL.  
Python 3.12 was used to interface the MPU-6050 module with the Raspberry Pi. The MPU6050 module (Figure 2) was used to read the acceleration values. The board is programmed to start recordings consisting of the acceleration values and time in ms as soon as the power is on. For every iteration or stop/start loop, a new file is saved, with the name acceleration followed by the date and time.  
The developed IMU is intended to be mounted on the belt of subjects and is made portable by connecting it to an external 5 V, 2 A battery by fixing all the components in a 3D printed PLA case with sleeves for mounting. All wires are soldered before mounting inside the case. The case was printed using an Ender-type V2 3D printer with a nozzle of 0.4 mm and a PLA filament of 1.75 mm. The extruder temperature was set to 210 \({}^{\circ}\)C, building plate temperature to 63 \({}^{\circ}\)C, a layer thickness of 0.2 mm, and an infill ratio of 40%.  
The analyzed method involves writing a code in MicroPython, 1.24.0 which is loaded into Thonny IDE to initialize the sensor, and read and process raw data, thus, determining the acceleration on the X, Y, and Z axes relative to time. The testing and validation process was performed by first continuously monitoring the sensor values and calculated angles displayed in the Thonny IDE console. After the sensor was calibrated, it was mounted on the belt (Figure 3) of Subject 1 and the normal gait acceleration values were recorded by setting a time resolution \(\Delta t\) = 0.02 s.  
Figure 1: Connecting the Raspberry Pi Pico and MPU-6050 sensor.  
The X, Y, and Z axes were considered according to the Open Sim model: the X-axis being in the walking direction, the Y-axis in the upper and lower direction, and the Z-axis in the side direction. The acceleration on the Z-axis was not considered in the current study.  
The gait event acceleration (Figure 4) values were measured only for Subject 1 for 25 s, and the data was used together with the fall events acceleration values obtained through simulations to train the supervised learning models to distinguish between fall events and normal activities.  
Figure 3: Setup for gait acceleration measurement.  
Figure 2: Developed IMU sensor: (**a**) CAD model of the developed IMU; (**b**) IMU sensor.