Real-time heart rate monitoring and fall detection system for the elderly based on STM32W

Publisher:SparklingMoonLatest update time:2013-05-14 Source: 电子科技 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    Based on the overall research of wireless Internet of Things technology for telemedicine and community medical informationization as shown in Figure 1, this paper uses STM32W108 wireless radio frequency as the core MCU to propose
a real-time monitoring system for the elderly. The system uses hardware filtering to extract the QRS wave in the ECG signal and can analyze the heart rate in real time; it can determine the fall state by analyzing the motion state (SVM and DSVM) and the change of posture angle. Finally, the reliability and practicality of the system are proved through simulation tests.

a.JPG



1 System Architecture Design
1.1 Introduction to STM32W Wireless RF Chip
   
STM32W108 is a fully integrated system-level chip launched by STMicroelectronics (ST), which complies with the IEEE802.15.4 standard. The biggest difference from other 2.4GHz SoC chips is that: 1. On the basis of maintaining low power consumption, it adopts the 32-bit ARMCortex-M3 core with strong processing power; 2. The chip has a power amplifier (PA) inside, and the transmission power can reach 7dBm, which can achieve a larger communication distance without a power amplifier; 3. The ZigBee protocol stack is solidified inside the chip, which is simple to develop. In the application of this topic, we use STM32W108 CBU61 (embedded ZigBee protocol stack) and 128kB Flash memory.
1.2 ECG heart rate detection principle
   
Heart rate detection can be obtained from many aspects, such as: by analyzing the pressure signal of blood pressure; by analyzing the blood oxygen pulse wave signal; by analyzing ECG (Electrocardiogram). Considering the cheapness of the equipment, we adopt the chest single lead ECG acquisition principle, using the right chest and abdomen of the person being tested as two electrode signal inputs (since the current design is only for heart rate acquisition, no reference electrode is required). An ideal ECG signal for a complete cycle is shown in Figure 2.

b.JPG


    As shown in the figure, the peak at R of the QRS wave group represents the transmission of electrical pulses between the atria. Its typical value is about 1mV, which is the signal with the largest amplitude in the ECG signal. In this project, the detection of heart rate is to use the characteristics of the QRS wave, and the processed ECG signal is output as the pulse signal of the R wave through the QRS detection circuit. The heart rate value can be calculated by using the input capture function of the STM32W chip port. The ECC signal acquisition process is shown in Figure 3.

c.JPG


1.3 Principle of fall detection
   
Human fall is the behavior of the body losing balance involuntarily. At the moment of falling, the gravity, acceleration, displacement and posture of the human body will change. Since the actions of the elderly in this subject are relatively simple, we use a single three-axis acceleration sensor to detect the state of falling. We judge the motion state of the human body by analyzing the transient change of acceleration, and then judge the posture characteristics of the human body according to the change of posture angle, and combine the two factors to determine whether it has fallen.
    * Speed ​​transient change
    The human acceleration vector amplitude SVM and the absolute average value DSVM of the differential acceleration amplitude are important parameters for distinguishing the motion state of the human body. SVM characterizes the intensity of human motion by calculating the acceleration amplitude. The larger the value, the more intense the motion. Its definition is that
    d.JPG
    DSVM characterizes the intensity of human motion state change by calculating the time average of the differential absolute value of SVM. The larger the value, the more intense the motion state change. Its definition is:
    Inspecting SVM and DSVM in a dynamic coordinate system can monitor the intensity of human motion and the intensity of motion state change. [page]

    * Posture angle judgment
    In the three-dimensional space, we think of the human body as a square. Using the relationship between the three-axis acceleration and gravity, we can get three posture angles ρ, θ and φ, as shown in Figure 4. By judging the change of posture angles, we can get the posture change of the body.
    e.JPG
    g.JPG
    Among them: ρ is the angle between the X axis and the horizontal plane; θ is the angle between the Y axis and the horizontal plane; φ is the angle between the Z axis and the direction of gravity acceleration.

f.JPG


1.4 Hardware composition and design
   
Considering the portability of the device, we use a waist-hanging type. The specific implementation scheme is as follows: It is powered by Li-ion batteries. Since the system power supply is 3.3 V, and the battery voltage range of Li batteries is 2.5V-4.2 V, the scheme uses TI's TPS63031DC-DC buck-boost chip.
    * The STM32W chip uses the system's 3.3 V as the main power supply, and the power supply for the core and storage area is provided by the chip's internal voltage regulator; the external clock source is a 24MHz high-frequency crystal oscillator and a 32.768kHz low-frequency crystal oscillator; RF uses a ceramic antenna.
    * ECG signal acquisition uses fabric electrodes, and the two electrodes are located on the right chest and abdomen of the subject respectively; the electrode input front end has ESD protection and input impedance matching; the ECG data storage chip uses AT24C02, 2kB e2PROM.
    * The three-axis acceleration sensor uses the ADI company's digital sensor ADXL345, which has ultra-low power consumption and a resolution of 3.9mg/LSB. It can measure less than 1° of tilt angle change; I2C communication method.
    * A 1.1-inch OLED screen is used to display the system status information, three function keys and a power button.

2 Software Design
   
The development of STM32W is based on the EmberZNet protocol stack, which is a development kit provided by ST for users. It contains a wealth of API functions. Users only need to call the API to complete related functions. The EmberZNet application is similar to an operating system. The system processes all module programs in the form of task scheduling, namely: monitoring tasks (Housekeeping Tasks). The main tasks of the system are: network maintenance tasks and processor maintenance tasks. The latter includes function button collection tasks, heart rate detection and backup curve tasks, three-axis acceleration sensor data collection tasks and fall algorithm tasks.
2.1 Network maintenance tasks
   
The tasks responsible for managing network relevance in the application are: detecting the network, joining the network, and network maintenance. The network topology is shown in the figure. When the device is turned on, it must join the established home network after initialization. Complete channel scanning and network discovery by calling the emberStartScan function, call the emberScanCompleteHandler function to check whether the scan is successful, and call the emberNetworkFoundHandler to view the scan results. Before joining the network, you need to manually select your home PAN ID. Configure relevant network parameters, select a parent node, and then call the emberJoinNetwork function to join the network.
    After joining the network, E0, as a mobile device, does not need to bind a router. It must maintain contact with the parent node through periodic polling (defined as 5s) to ensure that it is "online". If the periodic polling loses contact, to rejoin the network, call the emberRejoinNetwork function. As shown in Figure 5, the transmission path from E0 to the coordinator can be 1, 2, or 3.

h.JPG[page]

2.2 Processor maintenance tasks
   
In the protocol stack of STM32W108, the only task required by all applications is to run on this platform. By periodically calling the emberTick function, many tasks collected from the last call to the emberTick function are processed.
    * Function key acquisition task
    The device has four keys, a power key, which is responsible for the system's power on/off and lock key functions, and three function keys, which are responsible for system-related configuration.
    * Heart rate detection and backup curve task The
    real-time monitoring of heart rate is completed by using the STM32W timer to capture interrupts. The interrupt is used to start the heart rate detection task, calculate the instant heart rate, and complete the abnormal value alarm. Compress the recorded values ​​within 1 minute (60-120) into 10, store 60 per hour, and store 1440 per day, and store them in 2 kB e2PROM in chronological order.
    * Three-axis acceleration sensor data acquisition task
    The frequency of data acquisition is set to 100Hz. After collecting 2S of data, the fall algorithm task is started.
    * The fall algorithm task
    first determines whether the acceleration value in each direction is greater than the preset threshold, and then calculates the SVM and DSVM according to the company (1) (2). When a fall occurs, the SVM will increase significantly and last for a long time, and the DSVM will increase significantly. When the peak value exceeds the preset threshold (the experimental statistical value is 0.35g/s), it is considered that the human body has a tendency to fall. If the difference is obvious, it is determined to be a fall; if it is not obvious, the change of the posture angle is determined according to formula (3) (4) (5). If the posture angle changes, it is also determined to be a fall. The specific algorithm flow chart is shown in Figure 6.

i.JPG



3 System Test
   
In order to verify the practical reliability of the equipment, we need to conduct relevant tests, including: system power consumption, that is, normal system operation time (900mAh battery power supply); real-time heart rate test; real-time fall alarm; reliability of network transmission.
    In order to verify the real-time performance of the system for heart rate test, we test the heart rate by exercising. For the convenience of testing, we compress the heart rate data per minute into 50 and send them to the smart terminal immediately. The changes in heart rate can be clearly seen through the analysis of the smart terminal as shown in Table 1 below.

j.JPG


    The transmission of the system in the network can be divided into active transmission and passive transmission. Active transmission is mainly used to send alarm information. Passive transmission is the intelligent terminal accessing the data on the terminal. The heart rate data is transmitted to the terminal for analysis every day. For the convenience of testing, passive transmission is defined as 1h.

4 Conclusion
   
In this research, the detection and data recording of heart rate were completed, and the fall alarm was provided, which provided a basis for the development of remote monitoring system and realized the remote monitoring of "empty nesters". Recording the historical data of heart rate is of great help to doctors in analyzing pathology. The advantage of this system is that it uses the powerful STM32W wireless RF chip and adopts a relatively complex but accurate algorithm, which can accurately analyze sudden events (abnormal heart rate, fall). Taking this system as a model, we can design a detection system for other vital signs parameters (such as blood pressure, blood lipids, blood sugar, respiration, etc.) and establish a complete health record, which is of practical significance to the development of telemedicine services.

Reference address:Real-time heart rate monitoring and fall detection system for the elderly based on STM32W

Previous article:Design and implementation of infrared thermometer based on STM32 microcontroller
Next article:Design of Taxi Monitoring and Dispatching System

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号