## Inspiration

Many, health studies show the negative effects of staring at a screen or sitting down for long periods of time. Starring at a screen of too long, causes strain and lack of moisture for the eyeballs [(Time)](https://time.com/4789208/screens-computer-eye-strain/). Sitting down for hours straight can lead to increased weight gain, back problems, and even increased anxietey[(BetterHealth)](https://www.betterhealth.vic.gov.au/health/healthyliving/the-dangers-of-sitting) Doing regular breaks, such as standing up and stretching or eye exercises, can eliminate most of these negative effects. In addition, studies also show that physical movement can help with thinking and problem-solving[(NCBI)](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4879139/).

## What it does

This is a module that would attach to the seat of the chair. It is able to determine how long the user is sitting on the seat. It is fully customizable and can send notifications to popular platforms such as slack and discord (soon...). For example, here are some possible notification examples.
![](https://i.gyazo.com/b5835a5bacf0be7216a0884d93d4e153.png)
![](https://i.gyazo.com/99272bc327f0228c99869faa6a95c24e.png)

## How I built it

For this project, I mainly used a raspberry pi. There is a python script that reads the state of the button and will send slack API posts.
![](https://i.imgur.com/W6oefUt.png)

## Challenges I ran into

One challenging part for me was to get the pi setup. Without having a monitor a my disposal, I was very limited and had to learn to set up the pi "headless".

## Accomplishments that I'm proud of

It works.

## What I learned

I learned a lot about API's. For example, setting up the app like on slacks website then figuring out how to format the HTTPS request to send a message.

## What's next for fit chair

Integration into offices
Integration into gaming areas.
Integration Into vehicles.
Have a large network to collect data on worker habits in an office
## Inspiration

Due to covid-19 and online school, the number of hours we spend seated has increased dramatically. From a human physiology perspective, because seating is not a natural position for our body, it can lead to significant long-term health consequences. A bad posture can amplify these effects on our back and neck, and many of us often don’t realize that we have suboptimal posture. This is why we have created PosFix. We wanted to create a device that allows users to monitor their posture, become more self-aware of their posture, and take the necessary measures to correct it. Our device would allow users to limit the damage associated with bad posture, such as back pain, headaches, and stress/anxiety.

## What it does

We provide a shirt that has been enhanced with sensors and a computer system, as well as an app that works in tandem to model and record the position of vital points on your body. In order to get a good model for posture, we focused on four main areas: the right & left shoulders, the neck, and the lower back. PosFix monitors the orientation of the shoulders, neck, and lower back, to determine the relative orientation in space of these four points to monitor for suboptimal positioning. In addition, we monitored the curvature of the back to determine if the user was sitting up straight and to ensure a natural curvature to the lower back which is something research indicated was important to a healthy posture.

The user starts a session on our app, which signals the raspberry pi to start recording sensor values to Firebase's Cloud Firestore database. At the end of a session, this information was used to calculate a heuristic and recorded onto our app.

## How we built it

There were two main components to our project: the hardware side and the software side. On the hardware side, the orientation of the shoulders, neck, and lower back was measured using 4 IMU (Inertial measurement unit) sensors, which contain an accelerometer, gyroscope, and magnetometer. The curvature of the back was measured using a flex sensor. Processing orientation in space was probably one of the bigger challenges and involved using an algorithm that takes an accelerometer, gyroscope, and magnetometer data and passes it through a Kalman filter to give an accurate estimate for orientation in space relative to the earth. The filter works to eliminate drift caused by noise in the sensors. This data is processed in real-time on the raspberry pi from all four sensors and sent to the database along with the flex sensor data.

On the software side, we built our mobile app using React Native because of its similarity to React and its ability to seamlessly create cross-platform mobile applications. In the app, we processed information from the cloud in real-time and we displayed it to the user in a simple but useful way.

## Challenges we ran into

Because the hackathon was online this year we ordered our own hardware parts, however, the delivery took longer than expected to arrive due to shipping delays which left us only a few days to build and test the hardware component.

As well, we originally wanted to also measure the position with orientation, however, there were a number of factors for why this was infeasible and eventually scrapped. Firstly, there is too much noise inherent to working with IMU’s, and so position over a long period of time is never accurate and needs to be periodically fixed by other sensors/information. As well, we had performance issues caused by the relatively low power ARM chip on the Raspberry Pi, and the fact that python inherently can’t take advantage of multiple cores to distribute the load of processing multiple sensors. There are ways to remediate the performance concerns, but they weren’t a problem if we were just considering orientation.

Since this was our first project working with React Native, we ran into a few issues connecting the application to the Raspberry Pi through the Cloud Firestore to allow bidirectional data transmission.

## Accomplishments that we're proud of

From the five sensors to the mobile app, we are proud that we were able to seamlessly integrate all the components together. In addition to the various hardware and software components, we also faced challenges such as delays in hardware shipment and limitations of the processing speed of the Raspberry Pi. These obstacles required effective planning and communication to integrate everything together. In the end, when we were proud to see our sensors retrieve accurate information and display it on our mobile app in realtime. There was a lot that went into both the hardware and software side, so we’re also proud that we managed to get so much done in basically 2 and a half days.

## What's next for PosFix

In the future, we would like to explore new methods of getting even more accurate data on orientation used to model posture. Due to the processing limitations of the Raspberry Pi, we were not able to get accurate enough position data from the IMU. Furthermore, we have explored the idea of utilizing machine learning to help us interpret the sensor data, and classify good posture from bad posture.

Furthermore, the hardware needs to be refined, including using something more appropriate than a raspberry pi for processing the data, using a real-time operating system. The orientation data can be improved this way, and further processing can be done on the pi. As well right now the pi needs to be plugged into the wall, which is inconvenient. These fixes would help improve the usability and usefulness of PosFix.
Sit up straight !!

## Inspiration

We set out on our journey to help people fix their postures after spending our first year of university turning our backs into parabolas. After doing some research, we found various studies linking bad posture to orthopedic problems such as pain in the joints, neck, shoulders and lower back. Furthermore, an article published by Harvard Health states that poor posture leads to incontinence, constipation, heartburn, & slowed digestion. On the other hand, having good posture is very important to a person’s quality of life. Good posture centers a person's weight over their feet, which makes it easier for them to maintain comfortable form while performing everyday movements, such as walking, standing up from sitting, using stairs, and carrying heavy items.

## What it does

Professor Puddles is a duck-shaped desk buddy that is equipped with a camera, water gun, and speaker. To use Professor Puddles, the user simply has to run our provided code, which will launch our posture-detecting program. Using both the front camera of the laptop and the side camera angle provided by Professor Puddles, our program keeps track of the user’s posture from various angles. If either camera detects bad posture the user receives an initial warning in the form of a notification on their laptop. If the bad posture continues, the consequences intensify. After 15 minutes of bad posture, Professor Puddles will verbally ~~abuse~~ notify the user that their posture is poor. 15 minutes after that if you ignore his final warning, he loses it and spits at you. Surely when you are getting wet you will fix your posture, right?

## How we built it

The Python program uses OpenCV to track various points on the user's body and detects when these points exceed standard sitting proportions and sends desktop notifications. The user can view the tracking live and create custom profiles for better accuracy with one click in our Tkinter user interface. In the case you ignore the messages, Professor Puddles is running a server on a Raspberry Pi that the computer connects to wirelessly via socket connection. When it sends the message over this connection saying that you have been a naughty boy or girl and haven't been taking your posture seriously, Puddles gets mad and uses his Python codebase to play sounds and control the servo motor that has been integrated with the parts of a dissected water gun.

## Challenges we ran into

It turns out that when you buy something for only two dollars, it functions as if you only bought it for two dollars. Our cheap water mechanism extracted from a water gun slowly began to need more torque from the motor as you used it and the servo motors were too cheap to apply enough force. Even when we made creative designs to maximize the torque and got something that works, over time the mechanism got too stiff and stopped working. By taking advantage of every law of gravity/friction/kinematics that we can, we were able to optimize it to spray just enough to embarrass you.

In the process of building Professor Puddles, one of our motors was fried, resulting in us having to remodel the project. Additionally, having to work with low quality materials to build our project was a struggle but despite our dollar store water gun and duct tape, we persevered.

## Accomplishments that we're proud of

Our software is able to detect poor posture very accurately. We would also like to mention that this was the first hackathon for 2 out of 4 of our teammates, and we are very proud of Professor Puddles for winning first place! Finally, we are very proud that we found a way to make computer science students shower. Even if it is just showering in a little bit of duck spit, its better than nothing!

## What we learned

* Do not trust anything worth less than $2 (Especially from Dollarama)
* Maybe don't use Tkinter
* Don't make 76 commits and try to make the commit message a different spelling of "monkey" every time. There are only so many variants and with no sleep at 6 am, your unique spellings like "munkee" will have degraded to become just "m". Surely employers won't look at your GitHub right??? 😐

## What's next for Professor Puddles

In future variants of Professor Puddles, we are hoping to create a smaller version and work with higher-quality materials. We would also like to work on optimization so it can run in the background with no effect on performance. We plan to do this by only analyzing a frame every x seconds rather than running a continuous window. Also, we can scrap that silly Tkinter UI for a nice tray popup.