This project aims to develop a lying posture tracking system using the IMU sensor unit embedded in an Arduino board. The system will gather sensor data mimicking various lying postures and implement an algorithm to control the on-board LED, indicating specific lying postures. Accurate estimation of lying postures during sleep is crucial for monitoring a patient's mobility, risk of developing hospital-acquired pressure injuries, and quality of sleep.
The system focuses on detecting three lying postures:
- Supine (lying on the back)
- Prone (lying on the stomach)
- Side (lying on either the right or left side)
The LED will indicate the detected posture as follows:
- Supine: LED blinks once
- Prone: LED blinks twice
- Side: LED blinks three times
- None of the above postures: LED remains off
The sensor unit is assumed to be attached to the chest of the user.
Develop code to read the IMU sensor data from the Arduino board and store the signal readings on your computer.
Collect data for different scenarios by holding the board in orientations that represent various in-bed postures. Ensure to gather enough signal data for each posture.
Plot the collected data and visually observe the differences among signals for different postures. Develop an ad-hoc algorithm to infer the posture based on these observations.
Implement the developed algorithm on the Arduino board to read the IMU sensor data in real-time and control the LED output depending on the detected posture.
- Arduino board with embedded IMU sensor unit
- Computer with Arduino IDE installed
- USB cable to connect Arduino board to the computer
- Open the Arduino IDE:
- Install the necessary libraries for the IMU sensor: Arduino_LSM9DS1.h
- Upload Code to Arduino:
- Open the provided
.ino
file in the Arduino IDE. - Upload the code to the Arduino board.
- Open the provided
-
Data Collection:
- Run the
readData.ino
sketch to read IMU sensor. - Run the
readData.py
to collect data and store in csv file. - Collect data by holding the board in different orientations representing the supine, prone, and side postures.
- Run the
-
Data Analysis:
- Use a plotting tool (e.g., Python with Matplotlib) to visualize the collected data.
- Observe and identify patterns in the data corresponding to each posture.
-
Algorithm Development:
- Develop an algorithm based on the observed patterns to classify the postures.
-
Posture Detection and LED Control:
- Implement the algorithm in the
postureDetection.ino
sketch. - Upload the code to the Arduino board.
- The system will continuously update the LED output based on the detected posture.
- Implement the algorithm in the
- The algorithm processes IMU sensor readings to determine the orientation of the board.
- It classifies the orientation into one of the three postures (supine, prone, side) based on predefined thresholds and patterns.
- The LED is controlled to blink according to the detected posture.
Below are the results of the lying posture tracking system, showing the detected postures with corresponding images.
Posture | Image |
---|---|
Supine | |
Prone | |
Left Side | |
Right Side |
For a visual demonstration of this project, please refer to the video linked below: