# MEMS and IoT in HAR: Effective Monitoring for the Health of Older People
## 4 Materials and Methods
### Data Acquisition  
The continuous monitoring of older adults is essential for ensuring their safety and well-being. As people age, they may experience a decline in motor skills, increasing their risk of falls and other medical emergencies. To tackle these challenges, it is crucial to develop monitoring systems that are accurate, reliable, user-friendly, and acceptable to older individuals. In this context, the proposed system employs advanced technologies, including the MEMS sensors and the STM32 WB55 microcontroller, to detect and analyze the movements of elderly individuals. This system is designed to integrate the ongoing, real-time monitoring of daily activities. The data collected by the sensors are processed and analyzed using  
Figure 4: Flow chart of the prototype’s development. machine learning algorithms, such as Random Forest, to classify activities and identify any anomalies. Monitoring patient behavior and tracking the physical movements of the hand and arm are essential for the early detection of any abnormalities or changes in movement patterns that may signal emerging health problems. Grip is crucial for assessing hand strength and coordination, which are essential for everyday tasks such as lifting objects or using tools. The flexion of the legs provides useful indications to understand the conditions of stability and balance. In addition, it allows for the early identification of musculoskeletal pathologies. Circular arm motion analysis helps understand the mobility and strength of the upper extremities, which are important for lifting objects or dressing. Walking is a key indicator of overall mobility and balance, and monitoring this movement can help prevent falls and assess the need for rehabilitation interventions. Continuous monitoring enables healthcare professionals to intervene quickly when anomalies are detected, thereby enhancing the safety and well-being of older patients. Additionally, the collection of long-term data allows for the personalization of rehabilitation programs and facilitates ongoing progress monitoring over time. In intelligent care, the human activity recognition (HAR) system monitors patient behavior and captures data on the physical movements of the hand and arm, offering valuable guidance for diagnostic and therapeutic support. These physical movements not only provide essential information, but also interact with the environment. In a smart home, specific actions can be controlled through gestures, such as adjusting light intensity, changing radio volume, and turning appliances on or off [38]. A HAR model primarily consists of three phases: data collection, feature extraction, and classification. Recent improvements in algorithms mainly focus on enhancing the extraction and classification steps. However, the quality and size of the raw data collected significantly impact the model's efficiency and accuracy. For inertial data acquisition, the X-CubeMEMS1 software (v.11.1.0, released on 16 December 2024) enhances the functionality of the STM32 Cube. It is a comprehensive package that includes drivers capable of recognizing sensors and collecting data on temperature, humidity, pressure, and motion. This software is compatible with STM32 CubeMX and can be downloaded and installed directly within it. It also includes advanced motion libraries as middleware. For data fusion, the MotionFX library implements a sensor fusion algorithm that utilizes a digital filter based on Kalman theory [39] to combine data from multiple sensors and mitigate the limitations of individual sensors. The six-axis sensor fusion process relies only on accelerometer and gyroscope data. While it has lower computational requirements, it does not provide information on the device's absolute orientation, making it suitable for fast movements where absolute orientation is not necessary. For inertial signals, the ISM330 DHCX module, which includes an accelerometer and gyroscope, is utilized.