UpRight
By Michael Owyang & Sabrina Zhu
Overview:
UpRight aims to detect and analyze posture in working environments. During our research, we found that prolonged trends in posture can impact productivity, alertness, and mood. As the chair notices trends in the person’s posture, it outputs speaker prompts to inform the person about their posture. Speaker outputs give people immediate feedback and can be a subtle alert system without completely disrupting the flow of the person sitting in the chair.
UpRight uses FSR sensors that are embedded into the cushions of the chair to track slouching. If the person slouches for five minutes, leaving pressure off one FSR sensor, a corrective alert alarm will remind the person to sit up. Conversely, if the person has been upright for five minutes, they will be encouraged to take a few seconds of mindfulness breathing. If the person continues to maintain a correct posture for 45 minutes, they will be rewarded with a positive song so they can take a break. The system uses a serial MP3 player to output tracks that have been uploaded onto an SD card. With the SD card, the person can customize the tracks so they match their intended responses. As a whole, the reward and reminder system aids workers to be more cognizant of their posture throughout work sessions.
Code:
/* FSR testing sketch. Connect one end of FSR to 5V, the other end to Analog 0. Then connect one end of a 10K resistor from Analog 0 to ground Connect LED from pin 11 through a resistor to ground */ //Speaker Stuff #include <SoftwareSerial.h> #define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module #define ARDUINO_TX 6//connect to RX of the module SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX);//init the serial protocol, tell to myserial wich pins are TX and RX //////////////////////////////////////////////////////////////////////////////////// static int8_t Send_buf[8] = {0} ;//The MP3 player undestands orders in a 8 int string //0X7E FF 06 command 00 00 00 EF;(if command =01 next song order) #define CMD_PLAY_WITHVOLUME 0X22 //data is needed 0x7E 06 22 00 xx yy EF;(xx volume)(yy number of song) #define CMD_SEL_DEV 0X09 //SELECT STORAGE DEVICE, DATA IS REQUIRED #define DEV_TF 0X02 //HELLO,IM THE DATA REQUIRED #define STOP_PLAY 0X16 void sendCommand(int8_t command, int16_t dat) { delay(20); Send_buf[0] = 0x7e; //starting byte Send_buf[1] = 0xff; //version Send_buf[2] = 0x06; //the number of bytes of the command without starting byte and ending byte Send_buf[3] = command; // Send_buf[4] = 0x00;//0x00 = no feedback, 0x01 = feedback Send_buf[5] = (int8_t)(dat >> 8);//datah Send_buf[6] = (int8_t)(dat); //datal Send_buf[7] = 0xef; //ending byte for(uint8_t i=0; i<8; i++)// { mySerial.write(Send_buf[i]) ;//send bit to serial mp3 Serial.print(Send_buf[i],HEX);//send bit to serial monitor in pc } Serial.println(); } //FSR Stuff int fsrAnalogPinSeat = 0; // FSR is connected to analog 0 int fsrAnalogPinBack = 1; int fsrReadingSeat; // the analog reading from the FSR resistor divider int fsrReadingBack; //Extras int counter = 0; void setup(void) { Serial.begin(9600); // We'll send debugging information via the Serial monitor mySerial.begin(9600); sendCommand(CMD_SEL_DEV, DEV_TF); } void loop(void) { //FSR LOOP fsrReadingSeat = analogRead(fsrAnalogPinSeat); fsrReadingBack = analogRead(fsrAnalogPinBack); //Seat if (fsrReadingSeat > 0 && fsrReadingBack > 0) { counter += 1; Serial.print("Pressure detected "); Serial.println(counter); } else { counter -= 1; Serial.print("No pressure "); Serial.println(counter); } if (counter == -5) { sendCommand(CMD_PLAY_WITHVOLUME, 0X1E01); } if (counter <= -5 && fsrReadingSeat > 0) { sendCommand(STOP_PLAY, 0X1E01); counter = 0; } //Back if (counter <= -5 && fsrReadingBack > 0) { sendCommand(STOP_PLAY, 0X0F01); counter = 0; } if (counter == 5) { sendCommand(CMD_PLAY_WITHVOLUME, 0X1E02); } if (counter == 10) { sendCommand(CMD_PLAY_WITHVOLUME, 0X1E03); } if (counter >= 5 && fsrReadingBack == 0) { counter = 0; } if (counter >= 5 && fsrReadingSeat == 0) { counter = 0; } delay(60000); }
Video Link:
Prototype Images:
No comments:
Post a Comment