Detection of Human Energy Consumption in Sports Based on MEMS Sensor

In order to explore the problem of human energy consumption in sports, a method based on MEMS sensor is proposed. Firstly, the data of the whole system is analyzed, including acceleration signal preprocessing, data fusion between accelerometer and gyroscope using the Kalman filter method, and feature extraction. Secondly, each module and the whole system are tested, respectively. Finally, the accuracy experiment is compared with other human motion energy consumption measurement devices to verify the feasibility and superiority of the system. The experimental results show that when measuring human motion energy consumption, the average accuracy of a bracelet 1 is 87%, the average accuracy of a bracelet 2 is 88%, the average accuracy of a bracelet 3 is 96%, and the average accuracy of the system is 94%.The system has relatively high accuracy in measuring human motion energy consumption, and its algorithm is more accurate. It is proved that MEMS sensor can effectively detect human energy consumption in sports.


Introduction
With the rapid development of human-computer interaction technology, computers can be used to identify and track people's running characteristics. Motion tracking technology is based on the above background. Through the operation tracking technology, the computer can deeply understand the human behavior. Users can send relevant instructions or convey information to the computer by using posture, gestures, and expressions, so as to accurately identify the human operation behavior. Therefore, motion tracking has become a key technology in new interpersonal interaction [1]. At present, as shown in Figure 1, the motion capture based on MEMS sensor mainly relies on the original capture technology to design a tracking system suitable for human motion behavior, in order to achieve the purpose of real-time acquisition, fusion, and analysis of human motion information. Human behavior recognition is a technology to judge the state of human behavior by obtaining and analyzing the relevant information of human behavior. Human behavior recognition technology is widely used. By knowing the basic behavior activities of human body, this technology can provide human body-related information for research and application in many fields, such as motion tracking, health monitoring, fall detection, elderly monitoring, patient recovery training, complex behavior recognition, auxiliary industrial manufacturing, human-computer interaction, augmented reality, indoor positioning and navigation, personal feature recognition, and urbanization computing. Therefore, it has attracted extensive attention of researchers. In some of these fields, human behavior recognition technology has been widely used [2]. For example, in the field of fitness, tracking the intensity and duration of human exercise can help users understand the information such as exercise time and heat consumption and formulate a reasonable fitness plan. In terms of elderly monitoring, automatic alarm can be realized by monitoring abnormal behaviors such as falls, which can avoid greater injury caused by accidents. In the field of medical care, by analyzing the recovery training of patients, it can provide help for further treatment [3].

Literature Review
Tang and Wei used the angular velocity sensor, fixed it in front of the human chest, collected the human angular velocity signal, took the collected data as the basis for human motion posture analysis, and took the obtained analysis results as the basis for evaluating the probability of human falling [3]. Tang et al. designed a wearable smart bracelet, which can prevent athletes from falling and prevent catastrophic consequences [4]. Wang et al. developed a wearable fallproof electronic pants, which integrates many microelectronic devices. These microelectronic devices are mainly composed of microcontrollers or microprocessors, sensors, communication chips, and other modules, and most of the power supply methods are battery power supply [5]. Gu et al. used the circular microphone array for the first time to collect sound, detect falls through sound, and locate the location of falls [6]. Ciuti et al. use the acceleration acquisition device worn on the waist to collect human dimensional acceleration data and transmit it to the PC in real time through ZigBee protocol. The PC identifies it by detecting the change of acceleration value in the vertical direction [7]. Abdulrahman et al. studied a real-time heart rate and detection system. The ZigBee network is used to collect various signals to PDA, and two electrodes are used to collect ECG signals. A voting method is used to extract the heart rate, combined with the acceleration data of the abdominal position collected by the acceleration sensor to determine whether the human body falls. If the fall occurs, the WiFi network is used to realize the alarm function [8]. Using the natural attenuation of wireless signals, Wei et al. proposed a detection method of athlete behavior without significantly increasing communication overhead [9]. Qu et al. proposed a method to analyze and study the abnormal behavior of moving human body in video surveillance. This method uses the binary mask method for background modeling and uses the background difference method to extract the foreground of moving targets, so as to detect the abnormal behavior of human body [10]. Wen et al. used human multimode feature fusion to study fall detection. The system used Kinect to obtain three-dimensional coordinate data and depth images of human bone points. On this basis, the feature morphology of human body was extracted. Based on the improved particle swarm optimization algorithm, a classifier with strong generalization was established, and finally, a good detection effect was achieved [11].

MEMS Sensor to Detect Human Energy in Sports
As shown in Figure 2.    Mobile Information Systems Users can not only view personal motion information through the PC terminal host computer but also view the motion status at any time on the mobile terminal [12].
(1) Bluetooth communication: 2.4G Bluetooth communication is adopted between the monitoring terminal and the mobile phone, and USB serial port communication is adopted only when data transmission with PC (2) Manual input. Before exercise, the user can input his personal information manually on the PC (3) Portable design, OLED Chinese character display, users can view the ambient temperature and humidity through the display screen (4) With high measurement accuracy and segmented analysis, not only the measurement is accurate but also the user can view the human motion energy consumption in any period of time through the PC host computer at any time, which is convenient and fast 3.1. MEMS Gyroscope. MEMS gyroscope, also known as angular rate sensor, is a sensor used to measure the rotation speed of objects. Its main performance indexes include sensitivity, full-scale output, resolution, and dynamic range. According to different detection methods, we divide them into capacitive, piezoresistive, piezoelectric, optical gyroscope, and so on. Capacitive gyroscope is widely used.
Because of its small size, low power consumption, and high performance, it is widely used in navigation devices, military equipment, ship positioning, and other fields [13]. Next, we introduce the working principle of capacitive gyroscope. The basic principle of gyroscope is to measure the angular velocity produced by object motion according to the Coriolis effect. In short, when an object rotates, it will be subjected to a tangential force in the straight direction. This force is called Coriolis force, also known as the Coriolis force. As shown in Figure 3, it is assumed that the radial velocity of object motion is v r , the rotation radius is r ! 0 , the Coriolis acceleration is a Coriolts , and the rotation angular velocity is w ! 0 . See formula (1). There is a positive proportional relationship between Coriolis acceleration and angular velocity.
When the object moves, due to the Coriolis acceleration, the electrode plate of the induced capacitance inside the gyroscope will change relative displacement, resulting in the change of capacitance. Considering that there is a positive proportional relationship between Coriolis acceleration and angular velocity, we can calculate the value of angular velocity through the change of capacitance.
With the rapid development of microelectronics technology, MEMS temperature and humidity sensors are also developing from traditional analog to digital, single bus, double bus, and three bus. MEMS temperature and humidity sensor is a microelectronic device used to measure temperature and relative humidity in the air. There are many kinds of temperature and humidity sensors, which are generally divided into resistance type and capacitance type. It is widely used in greenhouse, animal breeding, industrial control industry, and other fields. Here, we take the capacitive temperature and humidity sensor as an example [14]. The capacitive temperature and humidity sensor is composed of three parts: humidity sensing element, temperature measuring element, and conversion circuit. Both the temperature measuring element and the humidity sensing element contain a high molecular polymer material which can sense temperature and humidity. The characteristic of this material is that its dielectric constant will change with the change of temperature and relative humidity content in the air, resulting in the change of the capacitance of the measuring element. Finally, the analog quantity is converted into digital quantity for output through the conversion circuit.

Acceleration Signal
Preprocessing. The preprocessing of acceleration signal is mainly divided into three parts. The first part completes the vector acceleration operation of three-axis acceleration signal, the second part effectively

Mobile Information Systems
filters out the impulse noise in the system by using the median filtering method, and the third part considers that the frequency of gravity acceleration signal is relatively low. Therefore, the low-pass filter is used to effectively separate the motion acceleration signal from the gravity acceleration signal.
(1) Vector acceleration where A X , A Y , A Z , VM--, respectively, x axis, y axis, z axis, and vector acceleration (g); (2) Median filter As a typical nonlinear filtering technology, median filter is mainly used to suppress impulse noise. The basic principle is to set an odd length observation window for the original data. Then, sort the data in the window according to the size of the value and output the middle value of the window. It is found that the effect is most obvious when the observation window length n is set to 3.

(3) Low-pass filtering
Considering that the amplitude of human gravity acceleration component will not exceed 1 g and its frequency is less than 1 Hz, when the human body is active, the frequency range of acceleration signal is concentrated in 0-20 Hz [15].

Data Fusion of Accelerometer and Gyroscope Signals.
When using the accelerometer alone to measure the attitude angle, when the object is at rest, the attitude angle is obtained by calculating the components of gravity acceleration in the x, y, and z axes. At this time, the measurement result is more accurate. However, when the object moves, the acceleration sensor can not distinguish the gravitational acceleration and motion acceleration, resulting in measurement error. Therefore, this method has the disadvantage of poor dynamic performance. The principle of attitude measurement is shown in Figure 4. When the gyroscope is used alone, the angle can only be obtained by integrating the angular velocity. However, in the process of calculation, the gyroscope is prone to drift, forming drift error, and it is difficult to obtain a relatively accurate attitude angle [16]. Therefore, it is very important to adopt appropriate data fusion method.
When the object is at rest, see formula (3).
Normalize it to obtain: The included angle between the vector in the gravity direction and the spatial coordinate system is At present, there are many methods to combine data information, but the weighted average method is relatively simple, but its precision is weak. Although the neural system Internet combination method has high quality responsive control and self-learning ability, it involves the improvement of basic main parameters and the selection of structural model, so the structure is too complicated and has certain constraints [17,18]. Because of its simplicity, expansibility, and optimality, the Kalman filter is widely used in linear filtering. Therefore, the system uses the Kalman filter method to combine the acceleration sensor and gyroscope data signal to obtain a relative real perspective. The basic principle  Mobile Information Systems of the Kalman filter is to obtain the best estimated value based on the possibility of developing the system condition at the previous moment on the basis of the condition room space entity model [19]. The best estimate value and the specific precise and accurate measurement value of the system are used to develop the possibility of the system status at the current time, and then, the relative value is obtained. The basic principle of the Kalman filter is shown in Figure 5. The Kalman filter mainly has two stages of work. The first stage is the prediction stage, and the second stage is the update correction stage.
(1) In the prediction stage, firstly, the prediction state X ðk−1jk−1Þ and error covariance matrix P ðkjk−1Þ of the system at time k are obtained. Matrix P ðkjk−1Þ represents the degree of trust in the current estimated state of the system. The smaller its value, the higher the degree of trust where A, B are the matrix coefficient; U ðkÞ is the control quantity in the current state; andP ðkjk−1Þ , P ðk−1jk−1Þ are the covariance of X ðkjk−1Þ , X ðk−1jk−1Þ respectively; The error covariance of the estimation process of Q ðkÞ at time k, that is, the covariance state of the angle value and the gyro deviation state estimation value [20]. For formula calculation (6), an angular measurement entity model equation is created for prior estimation.
Angle represents the angle estimation value at this time and the optimal angle estimation value at the previous time. Gyro represents the actual measured angular velocity of the gyroscope. Q bias represents the zero drift value of the gyroscope. Here, it is considered that the zero drift value is the same every time.

Angle Q bias
Among them, For formula (9), the error covariance of the system is derived. Where Q angle represents the covariance of gyro noise.
Among them, gyroscope noise and angle noise are not related to each other, and their covariance is zero.
The goal of the Kalman filter is to get the minimum value of P ðk−1jk−1Þ . Here, it is assumed that Substituting equation (10) into equation (9), we can get where the square value of dt approaches zero and is ignored: 3.3.1. Update Phase. In order to verify whether the Kalman filter can accurately calculate the attitude angle of the object, the attitude angle measurement experiments in static and dynamic states are carried out, and the effect is shown in Figure 6.
(a) In other words, when the MPU6050 sensor is fixed on the table, and the general plane diagram of the x axis and y axis of the MPU6050 sensor is vertically bisected on the table, its z axis is in the same direction as the net weight volume. Since it is only affected by the acceleration of gravity, the attitude angle should be zero. However, due to the integral deviation of gyro image signal, the measured attitude angle changes seriously with time, while the signal obtained by the Kalman filter is consistent with the instantaneous speed sensor signal, and the slope of attitude straight line tends to zero [21] (b) The results show that when the MPU6050 sensor causes obvious vibration, although the gyroscope signal is accurately measured in a short period of time, it will produce deviation due to the change of time. Acceleration sensor signals will result in poor 5 Mobile Information Systems peak and dynamic adaptability. The signal obtained by the Kalman filter is relatively smooth and not easy to produce drift deviation

Experimental Results and Analysis
For wearable devices, the data collected by sensors are very different at different wearing positions. In order to achieve the purpose of accurate measurement, the effect of wearing MPU6050 sensor on the waist of human body is the most ideal, because it is closer to the center of gravity of human body and can better reflect the whole motion state of human body. Compared with the waist, wearing the sensor at the human wrist, ankle, and other body joints is easy to produce unnecessary noise interference and affect the whole experimental results due to the large activity of the joints. Therefore, the system selects the wearing position at the waist.
Randomly select 20 experimenters, aged between 20 and 30, with a height of 165-180 cm. Wear the experimental device on the waist of 20 volunteers (keep the positive direction of x axis consistent with the direction of gravity), and let them complete the following actions, respectively. Five dynamic movements: normal walking, running (10 km/h), going upstairs, going downstairs, and jumping in place. Figure 7 shows the experimental results of an experimenter.
From the above experimental results, it can be seen that when using the acceleration vector value VM to recognize several common actions, (b) the signal peak is basically within the range of (1.34 g and 1.83 g) when running (10 km/h), and (e) the signal peak value is basically greater than 1.83 g when jumping in place, so these two actions can be effectively judged. In other dynamic actions, the signal curves of (a) normal walking, (c) going upstairs, and (d) going downstairs are close, and the signal peaks are Initialize the: Covariance of predicted states: Kalman gain: The covariance of the best estimate: The best estimate: Predict:    Mobile Information Systems within the range of (1 g and 1.5 g), so it is impossible to make effective identification. (f) Among the three static actions, since the sensor device and human body remain relatively stationary, the VM vector value has been maintained at about 1 g, so it is impossible to make effective judgment. Therefore, another group of experiments will be carried 7 Mobile Information Systems out to identify actions other than in situ beating, so as to extract the features of different action information. [11].
The following is the experimental results of an experimenter, as shown in Figure 8.
From the above test results, it can be seen that in the previous experiment, the attitude angle can reasonably distinguish the three dynamic actions of walking and going upstairs and downstairs from the three static actions of standing, sitting, and lying down. (a) The peak of the data signal of the posture skew data when walking is -68.5°and -67°, (b) -60°and -50°when going upstairs, (c) -67°and -60°when going downstairs, (d) -70°and -65°when standing; Seating time range is -60°and -55°; When reclining, this type is centered 50°and 40°. Therefore, the larger range of attitude inclination for different actions is set as the screen resolution threshold, so as to reasonably distinguish different actions.
Due to its high accuracy, the double standard water method is the "gold standard" in the detection method of human sports energy consumption. However, due to its expensive equipment cost and complex operation, it is not suitable for use in the laboratory. Therefore, this paper selects a relatively simple and practical method as the    . This time, a target was chosen. The gender was determined to be male, weighing 60 kg. The system equipment was worn on the lower abdomen of men, and jogging at a rate of 10 km/h. The change and development trend chart of acceleration VM of vector materials and raw materials was recorded within one minute. In order to ensure the accuracy of the algorithm, the experiment time is set as t = 1 s. Because the system sampling frequency is 50 Hz, that is, the number of system sampling points within 1 s is 50.
Record the corresponding 1vm and 2vm values at t = 0 and t = 1 s from the serial port data, where g = 9:8m/s 2 .
The results show that when the treadmill runs at a speed of 10 km/h, the energy consumption of human body in one minute is 9.4 kcal. In other words, the energy consumption of human movement in the mean 1 s is 0.158 kcal. Substitute it into the formula to calculate (14) and get u = 0:0017.
Next, two groups of tests were conducted on the accuracy of U value, running on the treadmill at the speed of 3 km/h and 5 km/h, respectively. According to the above operation steps, the corresponding energy consumption values within 1 s were calculated as 0.016 kcal and 0.05 kcal. The corresponding data on the treadmill are 0.017 kcal and 0.053 kcal. The accuracy is up to 94%, so the U value is more accurate.
In order to better certify whether the human motion energy consumption testing system can work properly, all systems carried out system testing. The human motion energy consumption detection system designed in this paper mainly consists of system equipment and software system. Therefore, the performance test of the system mainly verifies whether the system hardware (including acquisition module, display module, and communication module) works normally and whether the software platform (including PC host computer and mobile phone host computer) operates stably.
The precision comparison results are shown in Table 1. Table 2 shows that the average accuracy of bracelet 1 is 93.3%, the average accuracy of bracelet 2 is 90.6%, the average accuracy of bracelet 3 is 94%, and the average accuracy of system is 96%. Therefore, the system has higher accuracy in step detection and its algorithm is more accurate.
Since the other three sports bracelets have no action recognition function for the time being, the above table is only the action recognition accuracy of the system. This refers to the energy expenditure of one minute of exercise, the unit of energy expenditure is Kcal; here, we still use the energy expenditure calculated by the treadmill as the reference standard. Table 3 shows that the average accuracy of the bracelet 1 is 87%, the average accuracy of the bracelet 2 is 88%, the average accuracy of the bracelet 3 is 96%, and the average accuracy of the system is 94% when measuring the energy expenditure of human movement. The results show that the system has high precision in the measurement of human motion energy consumption, and its algorithm has high precision.

Conclusion
There is an inseparable relationship between human exercise energy consumption and people's health. It is an important index that directly reflects people's health. Therefore, the effective detection of human motion energy consumption is of great significance to people's daily life. Taking this as the starting point, this paper designs a set of human motion energy consumption detection system based on MEMS sensor. The system can not only effectively detect the energy consumption of human movement but also monitor the temperature and humidity changes of human movement environment. In addition, the system can effectively distinguish the human movement pace and movement state. Finally, the data analysis and system test of the whole system are carried out, and the test results are analyzed and compared. The results show that the system can effectively ensure the accuracy and has certain feasibility on the premise of realizing the basic functions.

Data Availability
No data were used to support this study.