Get up or get embarrassed! A chair that ensures you take a break every 30 minutes you sit.
CHAIRninja
I am guilty of sitting for long hours in front of my computer when I am working, and this is bad. Medical experts recommend taking a break every 30minutes by standing up or walking around. While I know this, it is easy to ignore while I am deep into my work. Therefore, I decided to outfit my chair with an assistive device that not only reminds but embarrasses me out of my chair.
(Sorry about the vertical video).
Materials Used + How it works
The sensors used to detect whether someone is sitting or not:
- Square FSR (force sensitive resistor)
- Ultrasonic ranger
While the initial plan was to use only the force sensitive resistor on the back of the chair to detect if a person is sitting on the chair or not, it is possible that the person is sitting but without their back resting on the back of the chair. I, therefore, decided to use the FSR on the seat and the ultrasonic ranger on the back of the chair so the sensors can together detect even if someone is sitting on the edge of the seat.
To provide feedback to the person sitting:
- Vibration motor (to warn the person sitting that it is time to get up)
- Piezo buzzer (will buzz if the person does not get up even after the vibration motor goes off)
Initially, the piezo buzzer was supposed to go off at the end of 30 minutes of sitting, but I decided to add a vibration motor as a warning before the piezo buzzer is activated. This will vibrate for 20seconds and the piezo buzzer will turn on only if the person still does not get up. The vibration as well as the piezo buzzer (if it has turned on) will stop as soon as the person gets up from the chair. However, they will turn on again if the person sits again within 5 minutes of getting up.
Other items:
- Arduino Uno
- Small Breadboard
- 9V Battery
- Jumper wires
- Cardboard (or any material to make a box), Glue, Tape and other supplies
The decision to design a box with clear windows was because I love the messy and colorful wires and other electronic parts. I wanted people to be able to see all of it.
It also allows me to see if all the wires are in place or if something has come loose.
Schematic
(TBD)
The code
____________________________________________________________________________
</pre> <pre>#include <NewPing.h> unsigned long timer = 0; int buzzerPin = 6; int vibratePin = 8; int triggerPin = 12; int echoPin = 11; int fsrPin = 0; int fsrReading; // the analog reading from the FSR resistor divider int sonarReading; NewPing sonar(triggerPin, echoPin); bool history [30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int x = 0; //standing = 0 //sitting = 1 void setup() { Serial.begin(115200); pinMode(buzzerPin, OUTPUT); pinMode(vibratePin, OUTPUT); pinMode(fsrPin, INPUT); pinMode(triggerPin, OUTPUT); pinMode(echoPin, INPUT); } void loop() { fsrReading = analogRead(fsrPin); sonarReading = sonar.ping_cm(); if (millis() - timer >= 1000) { history[x] = (fsrReading >= 100) || (sonarReading < 40); Serial.println(fsrReading); Serial.println(sonarReading); Serial.println("fsrReading = " + String(fsrReading) + "; sonarReading = " + String(sonarReading)); x++; if (x == 30) { x = 0; } timer = millis(); } int sum = 0; for (int i = 0; i < 30; i++) { sum = sum + history[i]; } if (sum == 30) { digitalWrite(vibratePin, HIGH); delay(3000); digitalWrite(vibratePin, LOW); if ((analogRead(fsrPin) >= 100) || (sonar.ping_cm() < 40)) { tone(buzzerPin, 1000); } } else if (sum < 30) { digitalWrite(vibratePin, LOW); noTone(buzzerPin); } }</pre> <pre>
____________________________________________________________________________
While I had initially thought I will primarily be using millis( ) to achieve the behavior, I ended up having to code this differently (with massive help from Zach). We created an array which stored 30 values and the ‘if’ condition populated these values with 0 and 1 (0 for standing and 1 for sitting). If the sum of all the values in the array exceeded 29, then the vibration motor is activated followed by the piezo buzzer.
Learning to code (I’m still really bad at it) has been a big thing for me as part of this course. While I understand the concept, remembering to write the exact code is always a challenge.
Reflection + Next steps
Ideally, I would have loved to integrate this in a chair that has foam seats and back. This way, I could have hid all the electronics within the chair’s structure. Also, I need to give additional thought to the location of the vibration motor (instead of sitting on it).
I would love to explore Velostat, a material that behaves like an FSR. This way, I can cover the seat of a chair with velostat making the electronics seamless and not even need the second sensor (ultrasonic ranger) as the velostat can detect a person anywhere on the seat.
Another thought I had was how the chair could detect if it is a human sitting on the chair or some object kept on it. Currently, there is no way of detecting that. I could probably use some kind of RFID sensor that talks to something in my back pocket.
Leave a Reply
You must be logged in to post a comment.