Things used in this project
|Software apps and online services:|
We've all submitted STARS requests to adjust our ergonomic settings.
But how many of us can honestly say we sit with perfect posture 100% of the time?
Staying motivated to sit properly is a struggle, and stats just can't seem to scare us into fixing our habits. What we really need is accountability. A friend who can sit next to us and correct us every--single--time.
Introducing...Got Your Back!
No, we don't provide an actual humanoid to correct you all the time. Rather, we use smart sensor technology to periodically check up on you, combined with fun social features like Twitter so your friends can actually monitor you!
Now...how can you make one of these gorgeous economic ergonomic beasts yourself?
WHAT YOU NEED
To create our demo Got Your Back, these were the parts we used:
- SimpleLink WiFi CC3100 Booster Pack
- Grove LaunchPad Booster Pack
- Grove Ultrasonic Ranger sensor (2)
- A power source
We also happened to have an old mesh chair add-on lumbar support at home, but you could easily reconstruct a similar device with foam, cardboard, or any other materials!
No fancy PCBs were necessary. The goal of this project was to make it cheap, easy, and convenient. Just stack the Grove LaunchPad Booster Pack on top of the MSP432 LaunchPad; then, stick the CC3100 Booster Pack on top of that. Using the Grover Starter Kit jumper cables, hook up on Ultrasonic Ranger to J13 and other to J17 on the Grove LaunchPad Booster Pack. Our schematic below roughly shows this setup.
There are two halves, code-wise.
The first half used Energia and is available in our Github repo, listed below. You simply need to have Energia installed from energia.nu, download the zip of our repo, and unzip all the files to a happy place. The main file is "CensoRed.ino;" open this in Energia and all the other files should appear as tabs. We use the Energia MT multitasking function so we can implement all the parts of our code. Later, if you're interested, we discuss what is happening in the code. If you just want to see your device work, just Verify and Upload the code onto your LaunchPad.
One thing to note: make sure under Tools, you have selected the MSP432P401R as your board and the correct COM port.
The second half of our code was built in IBM Bluemix's cloud using Node-RED Flow Editor. To view our flow, visit gotyourback.mybluemix.net/red. Please do not edit anything! To try our project, you should not have to touch anything in the Node-RED Flow Editor. More on what the flows do are explained below.
You should be all set! Just sit down in your chair, use the settings page to configure your device, and voila! Happy sitting.
WHAT IS GOING ON
Are you wondering what is going on? Here's a quick discussion on what the code is doing.
1. ENERGIA MAGIC
We used the lovely Grove Starter Kit Libraries, PubSubClient and WiFi Libraries, and Event Library for Multitasking. The main Energia file, "CensoRed.ino," essentially handles all the sensor checks (thus, the clever name, d'oh).
- It starts by checking in with the user interface via WiFi, to see if the user has changed any settings.
- It updates what it needs to with global variables, then uses those settings to handle checking the Grove sensors.
- Every time it checks the sensors, it can respond in three ways: you're a good human being and everything is fine, one of the sensors doesn't notice you, or it's reached the amount of time you set for it to do a Movement Check.
- If it's Movement Check time, the code goes into a delay where it constantly checks to see if you're still standing. If you aren't, it responds angrily!
2. NODE-RED POWER
Node-RED is the real beast that makes Got Your Back useful: it powers the alerts!
- Part of it's job is to check for configuration updates, first. It sends things back to the MSP432 if it notices anything.
- Then, it also reads what the MSP432 publishes--it checks for alerts.
- Based on what alert it receives, it responds.
- If you aren't sitting right, it'll shoot you a text with Twilio, tweet on the Got Your Back timeline, and make a note for the daily email report.
- If it's time to stand up, it'll shoot you a text with Twilio, congratulate you for making it to a break on Twitter, and make a note for the daily email report.
- Whenever you're done working, you can send yourself an email report. Node-RED handles that magic, too.
So if you aren't convinced yet that you need one of these buddies by your side, check out our video promo that will change your mind! Warning: ridiculous amount of baby pictures; prepare for death by cuteness overload.
Thanks for stopping by! Happy hacking!
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!