As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Thursday, May 10, 2012

Charissa + Erin: Shelving and FSR Sensors

Well, we got the FSR pressure sensor to work. It appears as though all systems are a go in terms of eliminating our cluttered spaces and minds, which is great considering my room is pretty awful right now and I wouldn't mind imposing my disorder on technology to resolve.We've completed a simple sketch for the FSR sensor: the LED light illuminates for the duration of which pressure is applied to the sensor. It's beyond cool. I'd say borderline mind blowing. (No, seriously, this was a big day for Erin: she finally completed a sketch that....worked.... disregard the fact that Charissa set everything up and all Erin had to do was plug in the sketch, connect one thing, and write on the blog).

You watch video now, here:


Things coming up and you should look forward to:

The purchase of a second hand cubby/shelving space. Yep, we're searching the greater Seattle area for some quality shelving that we can dismember in the name of design!

Some MP3 jingles, to politely remind you to get your act together through song.

I feel that just about covers it!!





Oh wait, here's some code:





/* FSR simple testing sketch.

Connect one end of FSR to power, the other end to pin 2.
Then connect one end of a 0.1uF capacitor from pin 2 to ground

For more information see www.ladyada.net/learn/sensors/fsr.html */

int fsrPin = 2;     // the FSR and cap are connected to pin2
int fsrReading;     // the digital reading
int ledPin = 13;    // you can just use the 'built in' LED

void setup(void) {
  // We'll send debugging information via the Serial monitor
  Serial.begin(9600);  
  pinMode(ledPin, OUTPUT);  // have an LED for output
}

void loop(void) {
  // read the resistor using the RCtime technique
  fsrReading = RCtime(fsrPin);

  if (fsrReading == 30000) {
    // if we got 30000 that means we 'timed out'
    Serial.println("Nothing connected!");
  } else {
    Serial.print("RCtime reading = ");
    Serial.println(fsrReading);     // the raw analog reading

    // Do a little processing to keep the LED blinking
    fsrReading /= 10;
    // The more you press, the faster it blinks!
    digitalWrite(ledPin, HIGH);
    delay(fsrReading);
    digitalWrite(ledPin, LOW);
    delay(fsrReading);
  }
  delay(100);
}

// Uses a digital pin to measure a resistor (like an FSR or photocell!)
// We do this by having the resistor feed current into a capacitor and
// counting how long it takes to get to Vcc/2 (for most arduinos, thats 2.5V)
int RCtime(int RCpin) {
 int reading = 0;  // start with 0

  // set the pin to an output and pull to LOW (ground)
  pinMode(RCpin, OUTPUT);
  digitalWrite(RCpin, LOW);

  // Now set the pin to an input and...
  pinMode(RCpin, INPUT);
  while (digitalRead(RCpin) == LOW) { // count how long it takes to rise up to HIGH
    reading++;      // increment to keep track of time

    if (reading == 30000) {
      // if we got this far, the resistance is so high
      // its likely that nothing is connected!
      break;           // leave the loop
    }
  }
  // OK either we maxed out at 30000 or hopefully got a reading, return the count

  return reading;
}



That should probably cover it now....

No comments:

Post a Comment