# IoT-Based Patient Movement Monitoring: The Post-Operative Hip Fracture Rehabilitation Model
## 4 Movement Monitoring System Architecture  
The proposed architecture for an IoT-enabled wearables rehabilitation movement activity monitoring system is illustrated in Figure 2. The architectural functionalities utilize computational resources at three main levels. These are the wearable wireless sensing level, the IoT gateway (or Internet edge) level, and the Cloud level. Each of these levels plays a significant part in offering the key functionalities for the smooth operation of the overall rehabilitated patient movement monitoring process. The proposed wearable wireless activity tracker is comprised of 10 DOF MEMS sensor modules (i.e., accelerometer, gyroscope, and magnetometer sensors) responsible for sensing the human movement in real time. Here, the tracker offers four key functionalities, i.e., sensor data acquisition (involving sensor selection, sampling rate, and acquisition duration); data repository (short-term data storage for movement recognition purposes and long-term backup data storage); data processing (involving data calibration and FFT signal processing); and data communication (for the regulation of the data and the message communication pattern). The data acquisition and reporting are configured to suit the dynamics of the application. However, for this research, and based on our previous investigation, only a triaxial accelerometer sensor with an acceleration range of \(\pm 2\) g has been used [8]. The module also incorporates a real-time clock for capturing a subject's movement event period, a core RF for computational purposes, and an nRF board holding the nrf24 Lo1+ transceiver. All the components are depicted in Figure 2 as a wearable tracker components stack. This tracker could be attached anywhere at the upper or lower limb of the human subject. Based on our earlier investigation, it was found that the ankle is the most suitable location for the collection of a post-operative hip fracture patient data [3]. As a result, the activity tracker is attached to the human subject at the ankle location. The wearable activity tracker wirelessly reports the subject's movement acceleration computed data to a local IoT gateway/edge device through an nRF module that uses its own enhanced ShockBurst communication protocol. The gateway (for example Raspberry Pi, workstation, or smart mobile devices) may handle one or more wearable sensors involved with one or more sensing types. These could be multiple wireless wearable devices used by one user or may deal with multiple users. For this research, and as depicted in Figure 2, Raspberry Pi combined with nRF radio module was used as an edge device. The gateway offers four key functionalities, i.e., the communication protocol (related to the protocol used and acting as a protocol converter for data transmission and reception); gateway computation (such as FFT signal processing, preliminary recognition knowledge components, and data aggregation); pre-cleaned or a final compressed movement data repository for a short- and long-term movement and processed data storage. However, the data can be managed using theongo DB and MySQL database, while gateway-Cloud communication for Internet connectivity uses the Wi-Fi TCP-IP protocol. As a result, both the wearable sensor and the gateway collaboratively offer the role of communicating the data to the Cloud. These could be involved in handling local or edge computation for data compression, decision-making capabilities relevant to offering some level of activity classification, and for data backup storage. In doing so, the involved computation, the data packet size, and the data transaction rate have a direct impact on wearable energy expenditure and communication latency. Managing the scenario of utilizing these resources may have a direct impact on handling the Big Data generated by the process, and hence relieving the Cloud from handling the lower-level details.