PComp Final with Documentation

Wow does time fly by.

Thought Bubbles (as described in the last post), is an interactive Soap Bubble based art project. The user approaches the console and pushes the red button to record his or her word related to soap bubbles. The user than blows into the bubble wand, and the bubbles fly out from behind the console.

Wow did this end up being a ton of work. The pieces (which did come together) all had their own associated difficulties:

Bubble Machine: I rebuilt components for the bubble machine several times. I experimented with the size and shape of the bubble tank to ensure that the bubbles did not catch on the edge when blown, and to ensure that the bubble wands were dipped into the soap. The actual bubble wand setup changed as well from a set of four wands hacked together to a 6 hole disc constructed by my father out of 1/4″ plastic. This is attached to the low RPM high torque motor through a hole in the rear of the bubble tank. The fan I used to blow the bubbles is a squirrel cage blower (used to keep the cages clean). This particular idea came from Andy Jordan, and works wonderfully due to the directed flow it provides. Unfortunately, the power drain from both my motor and fan required that I use an external power source (in this case a hacked laptop charger with a max of 12V 3Amps). Somewhere in the construction and testing of the bubble machine, a few wires touched, shutting off my computer and permanently frying both the chip on my micro-controller (Arduino) and both of my computer’s USB ports.

Microphone/Bubble Wand: For some reason unknown, the sound library for Processing (named Minim) defaults, and will only take sound from the line-in port. Amazingly enough it is nearly impossible to find a self powered microphone that does not rely on USB, since most computers (ie not Mac) have a powered microphone line-in. I experimented with a variety of systems, but I was able to find a battery powered lapel microphone that, while on the quieter side for recording sound, works like a charm when someone blows on it.

Tracking with Webcam: I decided to go with what I feel is the best Webcam value on the market: the PS3 Eye HD camera. While technically this is a console gaming camera, it gets a crazy high frame rate, and there exists computer drivers to not only utilize the camera, but also override the auto-white balance. Tracking translucent and somewhat reflective objects ends up not being the easiest thing in the world (go figure) but I have made some strides by placing a light to be reflected back at the camera, and also by creating a flat black background.

Here is my Arduino code (the Processing code will be posted with my final post for ICM, which will be my next post).

const int buttonPin = 2;

const int transistorPin = 9;

const int testPin = 10;

const int levelPin = A0;

const int ledPin = 12;

int H = 9;

boolean motorOn;

int buttonState = 0;

int endRecord;

int potValue = 0;

int levelAdjust = 0;

void setup()

{

  // start serial port at 9600 bps:

  Serial.begin(9600);

  pinMode(buttonPin, INPUT);

  pinMode(ledPin, OUTPUT);

  pinMode(transistorPin, OUTPUT);

  motorOn = false;

}

void loop()

{

  potValue = analogRead(levelPin);

  levelAdjust = map(potValue, 0, 1023, 2, 11);

  Serial.print(levelAdjust);

  //check if the record button was pressed

  buttonState = digitalRead(buttonPin);

  Serial.println(buttonState);

  if (buttonState == HIGH){

    digitalWrite(ledPin, HIGH);

    Serial.print('N');

  }

  //check if processing said anything

  if (Serial.available() > 0){

    endRecord = Serial.read();

    switch(endRecord){

    case 'o':

      digitalWrite(ledPin, LOW);      //turn off the light (recording ended)

      break;

    case 'a':

      motorOn = true;

      break;

    case 'b':

      motorOn = false;

      break;

    }

  }

  if (motorOn){

    digitalWrite(transistorPin, HIGH);

    digitalWrite(testPin, HIGH);

  }

  else {

    digitalWrite(transistorPin, LOW);

    digitalWrite(testPin, LOW);

  }

}

I am still in the process of adjusting minute things (the aesthetic of the box and bubble wand, the light levels for the bubble tracking etc) but as of right now it works rather well.

Here are a few pictures of the project (with updates to come).

and here is a video of the project functioning.

This entry was posted in Physical Computing. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>