Flexion
Flexion is an Arduino-based project to help with the recovery process after knee-replacement surgeries. The device tracks recovery progress by measuring the flexion angle in the knee joint, and track post-operative exercises and activities.

Inspiration
My grandma recently underwent a knee-replacement surgery. The recovery process has been painful, from relearning how to walk to doing the daily exercises and attending physiotherapy a couple times a week. I wanted to make her life easier.



Today, the post-operative recovery process looks something like this: you're sent home with a paper detailing the exercises you must do and you visit the physiotherapist a few times a week. The time with the physiotherapist is the only time you will know how much you're improving. This process is long, inconvenient, and uncertain.
​
I interviewed my grandmom's physiotherapist to better understand the problem space and the device he used to track improvements in the knee joints of his patients.
Problem
Idea
I wanted to solve this problem by letting users track their own progress and, consequently, give them some motivation during a long recovery process. I also wanted to give users assistance with their exercises (especially for incorrect technique or asymmetry in gait) when no other help is present.



Device
The Arduino-based device measures the angle in the joint-- which should be at least 120 degrees for a healed knee-- and tracks improvements in other exercises by looking at the number of repetitions and technique.
​
The device consists of a bluetooth-enabled Arduino device, a flex sensor, and a 9 degree of freedom inertial measurement unit (IMU). The Arduino device reads acceleration (linear and angular) from the IMU and runs the Madgwick algorithm to determine the orientation in space (by creating an AHRS). Since the IMU is attached to the lower leg, the deduced orientation is of the lower leg. The flex sensor gives the flexion angle of the knee joint and thus indicates the orientation of the upper leg in reference to the lower leg. These data (orientations, acceleration, and flex angle) are sent over bluetooth from the Arduino device using the Adafruit bluefruit libraries. The bluetooth data is received by an Android app running on a phone using the blessed-android library for bluetooth communication.
​
The app gathers and further processes this data, stores it, and can generate reports. The processing includes activity and exercise detection, asymmetry in gait, preference in leg when walking up and down stairs, and the progression in joint flexion angle.
​
Status:
I was able to integrate the flex sensor with the Arduino device, get the Madgwick algorithm to determine orientation, and send these results over bluetooth to an app on the phone. Future work includes working on the app to process and store the data to generate reports.
Skills Learned:
-Soldering, circuit assembly and prototyping on breadboards
- Arduino programming
- Android programming in Android Studio
- Sending data via bluetooth
​
Components of Device:
- Flex sensor (SparkFun SEN-08606)
- IMU (SparkFun ICM-20948)
-Arduino (SparkFun nRF52840 Mini - Bluetooth Developement Board)