Back pain affects a large amount of people around the world, impacting the health of the spine and leading to many health problems (negative impacts on the quality of life, sleep disorders, respiratory problems...)
Half of back pains are caused by improper posture and could therefore been prevented and cured by correcting the posture. The only requirement is to actually detect a bad posture.
The focus of this project is to answer this problem: build a wearable device that's capable of detecting bad posture and providing instant feedback to allow the wearer to correct his posture immediately. Real-time posture data will also be transmitted by Bluetooth on a mobile app made with Cordova.
For this prototype, I used LEDs to give an indication of the posture but the final product will be equiped with a vibrating module to give haptic feedback.
Assemble the components by following this circuit diagram:
The program sets the reference position by reading the momentary switch when pressed by the user and does all the calulcations and values conversion from the accelerometer.
See the code below or on codebender here : https://codebender.cc/embed/sketch:910134 or on GitHub here : https://github.com/cvirginie/ArduinoPostureDetector_BLE
This project uses the iShield library made by Victor Carreño to send the posture data to the app.
The application displays the BLE device and allows to connect to it.
Once connected, the angle is received and displayed on the app, and a line indicating the direction of the bending is drawn at the same time.
If the position begins to be considered as bad (yellow led on), the app indicates "warning"; If the position is considered bad (red led on), the app indicates "wrong". You can see that behavior in the photos section below.
There is also a textbox on the app to communicate with the device in bluetooth (useless for this project), you can see those messages on the serial monitor.
See source code on GitHub: https://github.com/cvirginie/CordovaPostureDetector_BLE and follow the instructions.
Install the app on iOS:
Clone the repo https://github.com/cvirginie/CordovaPostureDetector_BLE
git clone https://github.com/cvirginie/CordovaPostureDetector_BLE.git
Then type the following commands :Navigate to the directory
Install the dependencies
Add the ios platform (not tested on Android)
cordova platform add ios
cordova build ios
cordova build ios --buildFlag='-UseModernBuildSystem=0'
Open the project in XCode and deploy on your device.
The plugin used to communicate in BLE: https://github.com/don/cordova-plugin-ble-central/