Water Tally BETA

PREVIOUS VERSIONS

Demonstration
[QUICKTIME http://www.cameroncundiff.com/media/water.mov 320 257]

Details
A series of physical inputs that correspond to different household water hardware to visualize associated rates of consumption. For example, a toilet flush can consume up to 7 gallons of water. We will show this through a toilet lever attached to a switch that will increment values in a Processing sketch, that in turn will be represented visually.

Recommendations are based on a comparison between water use in the simulation and data on average daily domestic water use. We will offer ways to mitigate excess use based on industry research, and give an option to send the results via email.

Team Members
Nobu Nakaguchi
Cameron Cundiff

Classes
ICM
Physical Computing

Equipment
42" flat screen display (Processing Visualization)
Mac Mini with Keyboard/Mouse (processing platform)
Computer speakers (audio feedback)
Network connection (email sending)

Space Requirements
4' x 4' footprint, 6' tall with display





BETA

A water tally that takes in mouse x position as a value for number of jugs. This is a visualization work in progress that will be attached to physical inputs through arduino.
Slowly move your mouse across the stage to tally up the gallons.




//How much water do you use? Code by Cameron Cundiff and Nobu Nakaguchi

import controlP5.*;
import processing.serial.*;

class Jug {
PShape s;
float x,y,w,h;

Jug(PShape s_, float x_, float y_) {
s = s_;
x = x_;
y = y_;
w = 15;
h = 20;
}

void display() {
shape(s, x, y, w,h);

}
}
Serial myPort;

ControlP5 controlP5;
int myColorBackground = color(112,112,112); //gray
String textValue = "";
Textfield myTextfield;
String tempSearchValue;

Jug jug;
int gallons;
float tallyX;
float tallyY;
PShape icon;
ArrayList tally;

PShape pipe;
PShape shower;
PShape washer;
PShape dish;
PShape faucet;
PShape toilet;

void setup() {
size(600,400);

tally = new ArrayList();
icon = loadShape("jug.svg");
washer = loadShape("washer.svg");
toilet = loadShape("toilet.svg");
faucet = loadShape("faucet.svg");
dish = loadShape("dish.svg");
pipe = loadShape("pipe.svg");
shower = loadShape("shower.svg");
gallons = 0;
tallyX = 86;
tallyY = 10;

myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil('\n');

}

void draw() {
background(50);
smooth();
shape(icon, 8, 10);
shape(washer, 10, height - washer.height - 10);
shape(dish, 90, height - washer.height - 10);
shape(shower, 170, height - washer.height - 10);
shape(pipe, 250, height - washer.height - 10);
shape(faucet, 330, height - washer.height - 10);
shape(toilet, 410, height - washer.height - 10);

for(int i = tally.size()-1; i >= 0; i--) {
jug = (Jug) tally.get(i);
jug.display();
}

}

void serialEvent(Serial myPort) {
// read the serial buffer:
String myVal = myPort.readStringUntil('\n');
float val = float(myVal);
int mappedVal = int(map(val, (float) 0, (float) 1023, (float) 0, (float) 5));
println(mappedVal);
if(mappedVal <= 1) {}

else {
tally.add(new Jug(icon, tallyX, tallyY));
if(tallyX < (width - icon.width)) {
tallyX += 18;
}

else {
tallyX = 86;
tallyY += 25;
}
}
}

void keyPressed() {
if(key == ENTER) {
for(int i = tally.size()-1; i >= 0; i--) {
tally.remove(i);
}

myPort.clear();
myPort.stop();

controlP5 = new ControlP5(this);
myTextfield = controlP5.addTextfield("enter a word or phrase",100,100,200,20);
myTextfield.setFocus(true);
}
}

void controlEvent(ControlEvent theEvent) {

tempSearchValue = myTextfield.getText();
println(tempSearchValue);
String[] lines = loadStrings("http://nn27.com/mailform.php?email=" + tempSearchValue + "");

}