The Anti-RSI Mousepad _ John

The Anti-RSI (Repetitive Strain Injury) Mousepad is a medically-related desktop gadget-gift for those suffering from carpal tunnel syndrome. Stemming form my own experience w/ carpal tunnel syndrome, the mousepad could conceivably be underwritten by a surgical supply or drug company as marketing leave-behinds for surgeons whose practices address the injury.

The mousepad uses an 1.5 in. sq. FSR whose threshold has been set to represent excess applied pressure from the user’s wrist, presumably due to stress and habit. A faint beep is heard and an LED – embedded in an image of Carpal Tunnel Syndrome – lights up. The tone of the beep changes according to the amount and direction of applied pressure, adding variety and a sense of fun to what otherwise could be an annoyance.

Ideally all components would be contained in a battery-charged mousepad w/ plastic base containing the speaker and visual cues.

My initial idea was to play a voice recording – a soothing “Relax, take it easy” – but the levels of complexity involved in cueing files from an MP3 Shield far exceeds my current abilities with electronics and programming.

 

Click on this link to see a video of the device in action!

Here is the final code used:

 

/*
This sketch plays variable tones through a speaker and illuminates an LED
at the same time, once an FSR threshold has been exceeded.
This code was put together with reference to the following sources:

Creation and Computation Course Blog
Arduino.cc website
JermeyBlum.com – various Arduino Tutorials
learn.adafruit.com/force-sensitive-resistor-fsr/using-an-fsr

*/

//identifying pins

int spkrPin = 3;
int pitchPin = 0;
int ledPin = 2;
int fsrThreshold = 775;

void setup(void) {
pinMode(2, OUTPUT); //setting the LED
Serial.begin(9600); // to check debugging information via the Serial monitor
}

void loop(void) {
int fsrReading = analogRead(pitchPin); //linking fsr reading to speaker
fsrReading = constrain(fsrReading, 775, 1010); //to prevent readings outside range from interfering w/performance
int frequency = map(fsrReading, 775, 1010, 30, 7000); //mapping constrained fsr range to speaker frequency
int duration = 500; //duratino of tone from speaker in msec
if (fsrReading >= fsrThreshold){ //speaker to sound if threshold met or exceeded
tone(spkrPin, frequency, duration); //speaker tone combination of pin activity, set frequency range and 500msec)
digitalWrite(2, HIGH); //LED illuminates if threshold meyt or exceeded
delay(1000); //LED lit for one second
} else { //if threshold not met,
digitalWrite(2, LOW); //then LED is off

}

Serial.println(fsrReading); //allows reading of serial monitor to verify integrity of fsr wiring
delay(500); //delay of 0.5 sec between numeric values in serial monitor, for easier reading
}

Comments are closed.