Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 2, No. 3, 2022 56 Design of Portable Wireless Fall Monitoring and Warning System Hao Li, Yaxiong Gu School of mechanical and electrical engineering, Southwest Petroleum University, Sichuan, 610000, China Abstract: Aiming at preventing the old man falling down in the field of study, this article studies the status quo, focusing on sitting down research and analyze the behavior characteristic, this paper proposes a portable wireless fall monitoring and alarm system scheme design and manufacture, the conventional time-domain motion data multilevel threshold detection algorithm combined with combined with frequency domain characteristics of machine learning classification has realized the real-time identification of fall behavior. The time domain data used rectangular window filter to preserve the critical time series of behavior occurrence, fully considering the time characteristics of data changes, and completed the detection of lying posture and falling and the exclusion of daily low-intensity activities of the elderly. In the frequency domain, Discrete Fourier Transform (DFT) was applied to the combined acceleration data of sitting posture fall and moderate intensity activity, and the Support Vector Machine (SVM) classifier model was established by using frequency domain features. Complete the recognition and detection of sitting posture fall, and complement the detection of lying posture fall. After the decision of falling is made, the information of falling will be sent to the guardian of the elderly in time through wireless communication module, and the on-site alarm will be made at the same time, so that the elderly can get help from others in time when there are people nearby. Keywords: Fall detection, Wearable devices, Discrete Fourier Transform, Support Vector Machine. 1. Introduction As the elderly grow older, all functions of the body age, leading to a significant increase in the risk of falls. At the same time, various external environmental factors, such as various road obstacles, complex road conditions or accidental collisions, will further increase the possibility of falls of the elderly. If the elderly live alone at home and lack care, there is a risk of falling down at any time when they live at home or carry out activities with certain intensity, such as square dancing, going up and down stairs, etc. Many of the injuries caused by the fall of the elderly are irreversible. After the fall, the elderly will temporarily lose their ability to move or even coma. If they are not treated in time, the situation will often continue to deteriorate or even die. At present, most of the fall behavior detection studies focus on the detection of lying down, ignoring the study of sitting down. However, sitting down can also cause serious injury to the elderly, and it is also a direction that must be paid attention to. In view of the current situation of monitoring and Research on falls of the elderly, based on the detection of falls in lying position, this paper focuses on the analysis and research of the behavioral characteristics of falls in sitting position, and strives to identify and promptly notify the family members and medical personnel of the elderly after falls, so as to minimize the risk caused by falls. Fall monitoring research has very important practical significance and application value, so many researchers at home and abroad have paid attention to it and carried out a lot of corresponding research. In this paper, the research content is to design a portable wireless fall monitoring and alarm system, based on microprocessor, MPU9250 attitude sensors, bluetooth communication module, GPRS communication module, alarm module and power module hardware, such as human movement data gathered by posture sensor, through the fall identification algorithm is effective to distinguish the elderly daily activities and behavior lying posture falls, At the same time, it can also have a good recognition effect on sitting posture. When a fall occurs, the alarm information can be sent to the guardian in time for timely treatment and treatment, so as to reduce the subsequent injury caused by the fall of the elderly. 2. System structure and Hardware Circuit 2.1. System Structure To build a portable wireless fall detection and alarm system, it is necessary to analyze the motion data of each human behavior first, so it is necessary to build a software and hardware platform of data acquisition, data transmission and data processing. The data is sent from the lower computer to the upper computer in real time and displayed graphically. There is no need for long-distance transmission of data collected in this design. After the fall occurs, the microprocessor will make the decision to fall, and alarm will be timely according to the decision result. The alarm function should include on-site alarm and remote alarm, which must be time-sensitive. Figure 1. Block diagram of system structure 57 2.1.1. Microprocessor Microprocessor is the core of the design, responsible for data receiving and receiving, data processing and fall decision, heavy computing task, need strong digital processing computing ability. STM32F411CEU6 is a high-performance MCU designed by stmicroelectronics. It is based on the Cortex-M4 kernel of ARM company, and adopts the NVM process and ART accelerator of stmicroelectronics. It combines the real-time control function of MCU and DSP signal processing function, and its main frequency is up to 100 MHz. At the same time, small size, low power consumption, peripheral resources are sufficient, convenient to build peripheral circuit to meet various needs, very suitable for this system design. Figure 2. Schematic diagram of STM32F411CEU6 circuit 2.1.2. Bluetooth Module The transmission of human motion data to the PC need short distance wireless communication, Bluetooth (Bluetooth) communication technology is currently one of the most perfect technical development of short distance wireless communication, it is widely used in smart phones, intelligent household daily life scenes, such as short distance connection is stable, mature technology, ease of use and low cost. This paper will use DX-BT24 Bluetooth module, based on the British DAILOG 14351 chip, follow the Bluetooth V5.1BLE specification, support AT instruction, support Bluetooth transparent transmission mode, low cost, small size, and has A low power consumption mode, the minimum current is only 19 ΞA, while data receiving and receiving stable and sensitive, The maximum baud rate is 115,200. Figure 3. Schematic diagram of BT24 Bluetooth module 2.1.3. Attitude Sensor To detect falling behavior, attitude sensors that can collect real-time human motion data are needed. This article will adopt victor JY901B module of intelligence company production, based on MPU9250, integrated the precision of accelerometer and gyroscope and geomagnetic field, provide stable dynamic calculating with dynamic kalman filter algorithm, can effectively reduce the measurement noise, quick solution to the module's current real-time motion, attitude measuring stability of 0.01 °. Supports two communication modes: serial port and IIC, maximum 200 Hz data output rate, good real-time performance, high stability 58 and low power consumption. This design uses IIC communication, because the module IIC port is open leakage output, it is necessary to connect the external resistance value of 4.7K at both ends of SCL and SDA to increase the driving capacity. Figure 4. Schematic diagram of the JY901B module 2.1.4. GSM/GPRS Module When the elderly fall down, especially when they live alone, on-site alarm has limitations. In order to timely inform the absent guardian after the elderly fall down, wireless remote communication is needed. SIM900A is a wireless communication module with strong performance. It supports TTL and RS232 serial port communication, and can be controlled by AT commands. SIM900A has simple instructions, can send and receive short messages and make phone calls, and supports TCP/IP and UDP/IP related services. Figure 5. Schematic diagram of SIM900A module 2.2. Power Supply Module The portable wireless fall monitoring and alarm system proposed in this paper should meet the requirements of portability, low power consumption, high safety factor and low cost. The working voltage of each circuit module mentioned above is 3.3V or 5V, so only one 18650 lithium battery is used as the power supply. Its rated working voltage is 3.7V, and its rated capacity is up to 1500 mAh. It is safe, reliable and has excellent battery life. The two-in-one charging protection module based on TP4056 charging chip is used to charge the battery. The maximum charging current is 1000 mA, and the charging protection module can provide overdischarge protection and overcurrent protection, which improves the safety during use. Then, the battery voltage is increased to 5V through the S09 step-up module to meet the voltage requirements of each circuit module. The input voltage of the step-up module ranges from 2V to 15V, and the output voltage is stable 5V with the output current of 0.6A. 3. Fall Behavior Analysis and Feature Extraction 3.1. Establishment of Coordinate System In order to facilitate the analysis, the human body dynamic coordinate system OXYZ and the ground coordinate system OXYZ were established. The direction is defined as: when the four fingers of the right hand turn 90° from the positive X axis 59 to the positive Y axis, the thumb points to the positive Z axis. It is stipulated that the forward Z-axis of the human dynamic coordinate system always points to the direction of the human head, the rotation Angle around the X-axis of the human dynamic coordinate system is 𝑅𝑜𝑙𝑙 Angle, the rotation Angle around the Y-axis of the human dynamic coordinate system is ð‘ƒð‘–ð‘Ąð‘â„Ž Angle, and the rotation Angle around the Z-axis of the human dynamic coordinate system is 𝑌𝑎ð‘Ī Angle. Figure 6. The body dynamic coordinate system Through the MPU9250 module mentioned above, the three-axis acceleration and three-axis attitude Angle based on the human dynamic coordinate system can be collected. Human daily movement is random and the direction of movement is not fixed. When people are doing activities such as squatting and going up and down stairs, the change of uniaxial acceleration is very similar to falling behavior. Therefore, using uniaxial acceleration as a measurement index will bring great difficulties in analysis. Signal Vector Magnitude(SVM) is then used to define human activity intensity. 𝑠ð‘Ģ𝑚 𝑎 𝑎 𝑎 1 𝑎 , 𝑎 and 𝑎 respectively represent the axial velocity of the X-axis, Y-axis and Z-axis of the human dynamic coordinate system. 3.2. Time Domain Feature Extraction When analyzing the human motion data in the time domain, we focus on the analysis of the single point acceleration and Angle sampling point at the time when the fall occurs, and set the threshold. However, in fact, the time point when the change of attitude Angle reaches the threshold in the process of falling is not completely synchronized with the time point when the change of acceleration reaches the threshold. If only the value of the sampling point at a certain moment is considered, there will be a great risk of missing detection. To solve this problem, this paper adopts sliding matrix window filtering to extract the key part of human behavior sequence, and selects the maximum difference of the acceleration and Angle change as the time domain feature. Table 1. Time domain characteristic sample statistics of each behavior Behavior ∆𝜑 /° ∆𝜑 /° ∆𝑠ð‘Ģ𝑚/g Fall while lying down (left) 149.580 88.888 3.441 Sitting down 63.414 10.233 4.631 Walking 12.151 6.758 1.355 Sleeping 129.606 44.108 0.469 Jogging 11.014 9.014 2.606 Jumping 27.728 14.355 3.662 3.3. Frequency Domain Feature Extraction Signal frequency domain analysis is a kind of data analysis method widely used in data analysis, industrial production and instrument design. From the continuous Fourier transform of the analog continuous signal to the discrete Fourier transform of the discrete digital signal, the frequency domain analysis methods have been improved with the development of The Times and technology. With the rapid development of computer technology, DSP (Digital Signal Processing) has become very important. Digital signal and digital circuit are more and more applied in all aspects of production and life, such as digital control, digital filtering and so on. Compared with the traditional hardware based module, digital PID algorithm and digital filter are more flexible. The algorithm can be modified at any time according to the actual needs, and the effect is not inferior to the traditional hardware implementation. Discrete Fourier Transform (DFT) plays an important role in digital signal processing. The DFT can Transform Discrete time signals into Discrete frequency domain signals, which is convenient for computer processing. At the same time, the characteristics of frequency domain signals can be well preserved, which is easy to integrate and high precision. Table 2. DFT signal intensity sample statistics of each behavior Behavior Mean Value Variance Standard Deviation Lying posture falls 3.958 0.581 0.713 Sitting down 4.226 0.707 0.814 Jogging 2.069 4.419 2.070 Jumping 3.508 2.727 1.609 4. Design of Recognition Algorithm In this paper, an algorithm structure of multi-layer threshold in time domain combined with machine learning in frequency domain is proposed to recognize falls. For the recognition of falls in lying position, the Angle change is taken as the measurement index, which can distinguish the behaviors such as jogging and jumping that have similar acceleration change and fall behavior but inconsistent attitude Angle change. However, using the change in acceleration as a measure can distinguish the change in attitude Angle from the behavior of falling, but the change in acceleration is significantly smaller, such as sleeping. At the same time, because this paper will study the sitting posture fall behavior, although this behavior belongs to fall, but does not meet the above conditions of multi-level threshold judgment. Based on the above data analysis, it can be seen that the variation trend 60 of falling in sitting position and acceleration data is similar to that of falling in lying position. Therefore, in the frequency domain analysis, the SVM machine learning algorithm is trained with its frequency domain features to get a binary classifier. According to the SVM classification results and the distance between each feature point and the classification hyperplane, a probability of falling is given, which is different from jogging and jumping behavior. 4.1. Support Vector Machine Support vector machine (SVM) is a classical machine learning algorithm, which belongs to supervised learning and is often used in binary or multi-classification scenarios. The principle of the algorithm is to find an optimal hyperplane, which can maximize the distance of most feature vectors to the plane, and then the classification effect of positive and negative samples is the best. Support vector machines also contain a variety of algorithm models for different application scenarios, such as linear separable support vector machines, linear support vector machines and nonlinear support vector machines. The hyperplane of linearly separable support vector machine requires the feature vectors to be absolutely linearly separable in two dimensions in order to maximize the hard interval. While linear support vector machine (LSVMS) is approximately linearly separable in two-dimensional space, allowing a certain number of points to be unseparable, but pursuing the best overall effect. The reality is, not all can always the two-dimensional linear or approximate linear separable, and nonlinear support vector machine (SVM) can solve the two dimensional nonlinear, maximize its soft magnetic method and interval, through the proper kernel function, the 2 d feature data mapped to high-dimensional data space, makes the two-dimensional linear inseparable data in high dimensional space can be a very good classification. Figure 7. Classification diagram of linear support vector machine (left) and nonlinear support vector machine (right) The 16-point DFT signal intensity variance X and relative variance Y data of the experimental data samples collected in this paper are taken as feature vectors and plotted in the two- dimensional feature space as shown in the figure below, where the abscissa is the relative variance Y and the ordinate is the signal intensity variance X. The blue feature points are non-falling behaviors, and the red sample points are falling behaviors. It can be seen that this fall detection problem is approximately linearly separable, and linear support vector machine can be used for machine learning. Figure 8. Support vector machine feature space 5. System Debugging and Result Analysis 5.1. Data Acquisition and Transmission The transmission of data stream is very important in the design of portable wireless fall monitoring and alarm system. In order to ensure the stability of system data acquisition, it is necessary to debug the communication between each module, and only after the debugging verification can it be applied to the fall monitoring system. According to the hardware circuit design in Chapter 2, the wireless fall monitoring equipment is built as shown in the figure below. These include the TP4056 charging module, the S09 step-up module, the BT24 61 Bluetooth module, the JY901B attitude sensor module and the microprocessor STM32F411CEU6, powered by a 3.7V lithium battery. Figure 9. Construction of wireless fall monitoring equipment 5.2. Identification Result Analysis For the fall classification algorithm, its final prediction effect needs to be measured from a number of indicators. In this paper, confusion matrix, accuracy rate, precision rate and recall rate are selected as evaluation indexes to evaluate the classification algorithm. Confusion matrix, also called error matrix, is a square matrix of order, which is often used to evaluate the performance of classification algorithms. It directly reflects the classification effect of a classifier in the form of data. For a dichotomous problem, the sample space can be divided into Positive samples and Negative samples, which can be divided into the following four categories: 1) TP (Ture Positive): The actual sample is positive, and the prediction result is also positive. 2) FN (False Negative): The actual sample is positive, and the predicted result is negative. 3) FP (False Positive): The actual sample is negative, and the predicted result is positive. 4) TN (Ture Negative): The actual sample is negative, and the prediction result is also negative. The accuracy index is obtained based on the results of the confusion matrix, which describes the proportion of all predicted categories that are consistent with the actual categories in the total sample. ðī𝑐𝑐ð‘Ē𝑟𝑎𝑐ð‘Ķ 𝑇𝑃 𝑇𝑁 𝑇𝑃 ðđ𝑁 ðđ𝑃 𝑇𝑁 100% 2 The accuracy rate refers to the proportion of the number of positive samples with positive prediction results in all positive samples, which measures the accuracy of the prediction of positive sample results. 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑇𝑃 𝑇𝑃 ðđ𝑃 100% 3 The index of recall represents the proportion of all the actual positive samples, and the proportion of the number of the positive samples with the prediction result in all the actual positive samples, which measures the ability of the model to detect as many correct samples as possible. 𝑅𝑒𝑐𝑎𝑙𝑙 𝑇𝑃 𝑇𝑃 ðđ𝑁 100% 4 The behavior samples collected in this experiment are divided equally, half of which are used to train the vector machine, and the other half of which are used to evaluate the performance of the recognition algorithm. It is stipulated that the characteristics of falling behavior are positive samples and the characteristics of non-falling behavior are negative samples. The time domain and frequency domain features of all samples were input into the recognition and classification algorithm, and the prediction results of each time were recorded to calculate the accuracy rate, precision rate and recall rate. Table 3. Statistics of SVM model indicators ðī𝑐𝑐ð‘Ē𝑟𝑎𝑐ð‘Ķ ð‘…ð‘Žð‘Ąð‘’ /% 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 ð‘…ð‘Žð‘Ąð‘’ /% 𝑅𝑒𝑐𝑎𝑙𝑙 ð‘…ð‘Žð‘Ąð‘’ /% 94.40 92.00 98.57 The recognition algorithm achieves 94.40% accuracy in the case of four features, and the effect is good. At the same time, due to the particularity of fall detection, it is usually required that the recall rate should be higher than the accuracy rate, and as many positive samples should be predicted as possible, because the missed detection and fall behavior should be avoided as far as possible, so as not to cause greater losses. References [1] Organization W H. WHO global report on falls prevention in older age.[J].Who Global Report on Falls Prevention in Older Age, 2007. [2] Tolkiehn M, Atallah L, Lo B, et al. Direction sensitive fall detection using a triaxial accelerometer and a barometric pressure sensor[C].Engineering in Medicine and Biology Society, EMBC, 2011 Annual International Conference of the IEEE. IEEE, 2011:369-372. [3] Purwar A, Jeong DU, Wan YC. Activity monitoring from real- time triaxial accelerometer data using sensor network[C].International Conference on Control, Automation and Systems. IEEE, 2007:2402-2406. [4] Dean M Karantonis,Michael R Narayanan,Merryn Mathie,et al. Implementation of a Real-Time Human Movement Classifier Using a Triaxial Accelerometer for Ambulatory Monitoring [J]. IEEE Transactions on Information Technology in Biomedicine, 2006,10 (1):156167. [5] S. Beamish,X. Li,H. Brunskill,A. Hunter,R. Dwyer-Joyce. Circumferential film thicknessmeasurement in journal bearings via the ultrasonic technique[J]. Tribology International,2020.