Project Thumbnail

Posture Analysis

Non-intrusive wearable sensor to monitor posture and provide feedback to encourage good posture throughout the day


Hardware & IoT

Machine Learning


May 2019

Tools & Stack






We wanted to build a non-intrusive wearable device that one could simply attach to their clothing and gain accurate insights about their posture throughout the day. The device should be able to provide feedback to the user to correct his or her posture whenever identified as improper. For this, the device must be able to correctly identify and classify the spinal curvature. It should also be able to communicate with the user in some way.


How to design a wearable device that can monitor and subtly correct a user's posture?


Why Posture Analysis?

The increase in improper posture including lower back pain (LBP) and neck and shoulder pain (NSP) has been related to increased desk-based activities such as using computers. As of April 2019, 4.4 billion people were active internet users. The reason for the development of improper posture can be accounted to the fact that repeating one activity throughout the day without reprieve can lead to the body orienting and adjusting itself to perform that action more efficiently.

Applications & Advantages

Posture analysis finds important applications in bio-medical studies, healthcare and workplaces. There are several advantages of maintaining a healthy posture. The proper alignment of spinal curves leads to even distribution of weight along with balance amongst different parts of the body like the spine, shoulders, knees, hips etc. This helps define a good posture which is important for daily activities involving sitting, standing, and lying down. Having proper posture keeps bones and joints in correct alignment alleviating strain on the spine and decreasing the abnormal wearing of joint surfaces that could result in degenerative arthritis and joint pain. It also reduces muscle and ligament stress along joints, minimizing the likelihood of injury and preventing muscle fatigue.


The Implementation

Hardware & Communication

Stages of the programming experience

Circuit Diagram & Prototype

To estimate the complete posture accurately, we needed sensors to estimate the three curves of the spine — namely cervical, thoracic, and lumbar. Having accelerometers at the three locations allowed us to understand their inclination with reference to the ground, enabling us to reconstruct the spinal curve. Each accelerometer gave us data about acceleration in triaxial dimensions that was processed to identify its roll and pitch (which are essentially the rotations of the accelerometer along the x-axis and y-axis in 3D space respectively).

We used three ADXL345 accelerometers that were placed at a fixed distance of 15cm from each other.

We wanted the information to be transmitted over the internet for several reasons:

  • The device would not be limited by distance such as bluetooth range
  • It would be easier for multiple devices to access the data
  • Access of the user's real-time data could be easily shared say with the user's doctor

To implement the input of sensor data, processing, and transmission over wifi, we chose a wifi module + microprocessor. We used the NodeMCU ESP8266 to act as a central chip that inputs data from the three sensors, processes the values to obtain its inclination in degrees, and uses wifi to transmit to the database.

Stages of the programming experience

We used Google's Firebase as our real-time database because of its web socket implementation. This helped us make a dynamic interface where change in data at our database by the wifi module reflected instaneously on the devices accessing the database.

Classifying Posture

Stages of the programming experience

The device can classify if a posture is good, average, or bad based on the estimated reconstruction of posture. This is done by training a model on a manually labelled dataset of 450 data points (150 data points for each class). The dataset consists of three features that are the inclination values of three accelerometers. We trained a neural network on this dataset and found an accuracy of 95.54% on our test data.


Stages of the programming experience

Our interface consists of a graphical display with a representation of the estimated spinal curve from the three sensors. The display also shows if the posture is classified as good, average, or bad. In addition, a timer shows how long the user has been wearing the device and a visual demonstrating how often the user was in a good posture or a bad posture during that time.


Project Simulator

Since the wearable technology is not accessible to everyone for a demonstration, we made this simulation where a user can control the inclination of the sensors and view how the posture estimate changes.

Step 1. Open the simulation interface that displays the estimated posture representation
Step 2. Open the update page on a new device or tab to change the accelerometer rotations
Step 3. Observe how the interface graph changes real-time as you update the values

You may note while using the simulation, that changing the middle accelerometer linearly changes the values in the top and bottom accelerometers. This is because the middle accelerometer acts as a reference node to understand how the back is aligned with the ground i.e. if the user is standing, lying down, or bending. The difference between the top and middle accelerometers estimates the upper curvature of the spine and the bottom and middle accelerometers inform us about the lower curvature.