# MEMS and IoT in HAR: Effective Monitoring for the Health of Older People
## 4 Materials and Methods
### Data Acquisition
This module represents the latest generation of sensors and offers improved accuracy and performance compared to previous STM sensors. A noteworthy feature is the integrated machine learning core (MLC), which serves as a classification engine based on decision tree logic. While earlier inertial sensors had 256 nodes, the new models now include 512 nodes. They employ eight configurable decision trees to process information, enabling them to capture, analyze, and classify specific tasks. This ability to perform processes directly within the sensor, rather than relying on a microcontroller, significantly reduces power consumption and enhances the potential for edge computing applications. The MLC contributes to increased accuracy by offloading work from the central processor, while the built-in sensors effectively identify motion data. Additionally, the module offers a variety of filters and statistical features. Filters: high-pass, bandpass, and user-defined first- or second-order IIR. * Functionality: mean, variance, energy, peak-to-peak, peak detector, and minimum, maximum. During the implementation phase, the sensors are calibrated to correct errors in the raw data. The primary factors affecting HAR's performance are bias error and random noise. Five subjects performed four movements for data acquisition, each repeated twice on different days. These movements, which include grasping, walking, circular arm movement, and leg flexion, differ from activities usually classified in HAR. The movements of grasping, walking, circular arm movement, and leg flexion are distinct from activities typically classified in human activity recognition (HAR). The decision to analyze these atypical movements is based on their valuable insights into the functional capacity of older adults. These movements were selected due to their clinical relevance and impact on quality of life. Unlike everyday movements such as simple gestures or postures, the chosen movements provide detailed and specific information about the users' health status and functional abilities. This approach allows personalized interventions, offering tailored recommendations and therapies based on collected data. It also helps prevent accidents by identifying risks of falls or losses of mobility early, ultimately improving the quality of life by supporting the older people in daily activities and promoting their independence and well-being. The selection of these specific movements marks a significant advancement in monitoring and supporting older adults. The file motion_server_app. c is utilized for data acquisition. It is a firmware component designed to handle the acquisition and processing of motion data. The process can be summarized in the block diagram of Figure 5 which provides an overview of the firmware design phases for acquiring the gyroscope and accelerometer data capacity of older adults, as follows:
* Sampling rate setting;
* Data acquisition;
* Data processing. The diagram depicting the accelerometer data is shown in Figure 6, while that depicting the gyroscope data will be similar, with the variant of the definition of angular velocities. The data collected from the sensors, specifically the gyroscope and accelerometer, are stored in a CSV file. In this file, the last column represents the target variable, while the other columns contain the feature characteristics. These acquired data undergo a preprocessing phase. During preprocessing, the features are standardized using the Standard Scaler. This step enhances the model's performance by ensuring that all features are on the same scale, which is particularly important for machine learning algorithms sensitive to data scale variations. It is important to note that no over-sampling or under-sampling techniques were applied to address any imbalances in the target classes. The microcontroller utilizes a module (app_ble.c) for data transmission.