Stress Fountain

Submitted by sebarness on Mon, 05/06/2013 - 01:18

Description: When a user places the sensors on his or her fingers their stress level is used as input to control the fountain. The more stressed they are the higher the fountain goes. We have designed a two player mode as well. When two players wear the sensors an average is taken and that input is sent to the fountain. We wanted the stress fountain to be a collaborative effort so both players have the option to contribute to the overall height of the fountain. If one player takes off the sensors the fountain goes back into one player mode. 




-Arduino, breadboard, fountain, DC pump, handmade copper electrode sensors, wall power (7.5vDC, 1000mA), 10k resistors, wires, diode, transistor  


Arduino Code:

////////   The Stress Fountain   //////////

// A fountain that listens to your emotions using 
//     changing values in your galvanic skin response.
// For 1 or 2 players

// Tangible User Interface  Final Project Spring 2013
// UC Berkeley School of Information 
// Deb Linton & Sophie Barness

int skinA = A0;   // select the input pin for person  A
int skinB = A1;   // select the input pin for person B
int A = 0;
int B = 0;
int avg = 0;
int motorPin = 9; // select the pin for the fountain  
void setup() {

void loop() {

  A = analogRead(skinA);    // read the value from the sensor, between 0 - 1024
  B = analogRead(skinB);    // read the value from the sensor, between 0 - 1024
  if ((A ==0 || B == 0)){
    Serial.println("SINGLE PLAYER MODE");  // If there's only one signal coming 
                                      // through one set of rings or no signal at all, 
                                      //switch to Single Player Mode
    A = analogRead(skinA);    // read the value from two rings, between 0 - 1024
    A = map(A,0,70,60,600);   // maps values to fountain  
    analogWrite(motorPin, A);

    Serial.println("2 PLAYER MODE");   // If there's a signal coming through 
                                      // on both rings, switch to Two Player Mode
  avg = ((A+B)/2);         // average reading between person A and person B
  Serial.println(" ");
  Serial.print("A ");
  Serial.println(A);      //person A
  Serial.print("B ");
  Serial.println(B);      //person B
  Serial.print("avg ");
  Serial.println(avg);   // average between A and B
  avg = map(avg,0,70,60,600);
  Serial.print("-------Mapped avg ");
  Serial.println(avg);      // average reading mapped to the fountain  
     analogWrite(motorPin, avg);  
Your rating: None
Drupal theme by Kiwi Themes.