# MEMS and IoT in HAR: Effective Monitoring for the Health of Older People
## 5 Data Analysis
### Data Set  
The inertial data collected every 50 milliseconds can be used to identify four activities: grasping, walking, limb flexion, and arm circular movement. Here, these data are gathered from five subjects, three males and two females, aged between 35 and 50. Each activity is repeated twice on different days in a realistic setting within the Biorobotics Laboratory at the University of Florence. The subjects wear the STM32 WB55G device, which incorporates the ISM330 DMCX sensor. This device is compact and lightweight, with approximate dimensions of 85 mm \(\times\) 54 mm \(\times\) 1.6 mm and a total weight of around 40 g, including the battery. It is designed to securely attach to the body using an adjustable elastic strap, ensuring comfort and stability during movement. Depending on the activity being monitored, the device can be fastened around the upper arm, wrist, or upper limb. For walking, the device is typically positioned on the upper arm or wrist to capture the arm swing and overall body motion accurately. The adjustable strap ensures that the device remains securely in place without causing discomfort, allowing for natural movement. The energy consumption for this activity is approximately 1.03 J. For arm circular movements, the device is attached to the upper arm to monitor the circular motion of the arm. This placement allows the sensors to detect the full range of motion and angles of the arm, resulting in precise data for analyzing motor skills. The energy consumption for arm circular movements is approximately 0.95 J.  
Figure 8: Flow of process steps. In grasping activities, the device is secured to the wrist to capture the fine motor movements of the hand and fingers. This positioning ensures that the sensors accurately detect the grasping motion and grip strength, with an energy consumption of approximately 0.89 J. For leg flexion activities, the device is attached to the upper leg or thigh to monitor the flexion and extension of the knee joint. This allows the sensors to detect precise movements and angles, providing valuable data for motor skill analysis. The energy consumption for leg flexion is approximately 0.93 J. This setup facilitates accurate data collection while minimizing user discomfort. The device's lightweight and compact design ensures it does not interfere with daily activities, making it suitable for the continuous monitoring of older people. The dataset contains 60,000 samples. The data are organized into matrices for the accelerometer and gyroscope for each of the four activities detected. Each matrix consists of 1500 rows and six columns, where the rows represent timestamps, and the columns correspond to the Cartesian axes that help identify the type of activity being performed. The first three columns of each matrix represent the triaxial inertial data, while the following three columns indicate the type of activity, the reference date, and the timestamp. The data collected pertain to activities carried out by adults for 60 s. Readings are recorded with precise timestamps and time intervals (delta times), indicating the duration of each measurement. Using the \"graph\" script, a program written specifically for this purpose, we extracted statistical features for each activity, concentrating on the accelerometer and gyroscope data. We compiled a complete set of sensor readings and calculated various statistical features for each axis of both sensors. The Energy from Motion (ENMO) values were calculated to better differentiate between sedentary and light physical activities. This information aids the researchers in analyzing movement patterns, changes in orientation, and other physical activities throughout the recorded period. The statistical features include the mean, mode, median, variance, standard deviation, mean deviation, root mean square, count, minimum, maximum, and various percentiles. Utilizing these features enhances the model's accuracy in classifying the activities performed. Below is a description of how each feature contributes to the classification.