Physical Computing


10
Dec 10

pcomp & icm final: the art of making bubbles

//CONCEPT

“I wonder how much it would cost to buy a soap bubble, if there was only one in the world.”
Mark Twain

Liquid bubbles are one of those things in life that are joyous in their simplicity and inexplicably fascinating. Not only fun to make, but equally as gratifying to chase around and pop. This project takes the real life experience of making bubbles and enhances it through technology by giving people the ability to make bubbles of various forms. A bubble wand can be dipped into one of three glass jars to select the type of bubble. Each glass jar represents one of three different bubble forms. The wand can be waved around or blown on to create bubbles which will appear on a screen projection in front of the person. Loud shouts or claps will pop the bubbles.

Early Design


//PHYSICAL CONSTRUCTION

Evolution of the Bubble Wand

VERSION 1: My first working prototype was constructed out of a plastic straw, plastic spoon, and jumper wire. Tested successfully with two sensors, a piezo and an accelerometer.

VERSION 2: The plastic straw was replaced by a stainless steel spoon straw. I tested color tracking with a glow stick to simulate the effects of EL wire as a light emitter. The main problem with the glow stick was that the bubbles did not originate from a single point but all around the wand, which was not the realistic effect I was looking for. I also removed the accelerometer because bubble generation through waving could be achieved with color tracking in Processing. This was a relief as the accelerometer itself would have proved difficult to attach to the wand aesthetically.

VERSION3: Tried a third version of the wand hoop using 3 flat IR LEDs and limiting the surface area of the wand that would emit light but still covering three main points, especially at the top to trigger the photocell that would be placed underneath the jar. The effects were still unnatural with bubbles appearing from three distinct and far apart points. Also it seemed that these smaller emitters were not as powerful as the 3mm IR LEDs.

VERSION 4: The final version of the bubble wand has two IR LEDs placed side by side near the bottom of the hoop to provide a single point light source. (The threshold of the photocell was adjusted so that the IR LEDs could be sensed even from a diameter’s distance.) Jumper wires were replaced with a thick copper wire for the hoop to be sturdy enough to withstand constant impact with the glass jars.


Box Construction

My first step was sketching out the dimensions of the box. Several parameters were considered: it needed to be long enough for three glass jars, the size of the wood needed to fit within the bed of the laser machine, and lastly, it also needed to be deep enough to house an Arduino and wires comfortably. I chose to use a compressed wood purchased from Home Depot.

The ITP laser cutter in action.

Boards cut and ready to be pieced together with Elmer’s wood glue.

Final box, with multi-colored mirrored plexiglass to better hide the photocells and refract light to give the jars a more bubble-like appearance. Three visible light filters are fitted over each photocell to limit ambient light interference between the IR LEDs on the bubble wand and the photocell.


//ARDUINO TO PROCESSING

The Processing component to this project involved the use of three libraries – serial, video and minim (sound). One of my first steps was getting the Arduino and all four sensors (3 photocells and 1 piezo) to speak to Processing. After successfully doing that, I proceeded to design the bubble shapes and finesse the movement of the bubbles and implement the bubble popping interaction. For testing purposes, a piece of visible light filter was taped over my Macbook’s iSight camera to limit the interference from other bright light sources and allow for more precise IR detection.

An early version of a visible light filter using developed 35mm film, which proved ineffective.

Testing photocells and color tracking.

Testing the Minim library. Used AudioSample for the sound of bubbles appearing and bubbles popping. Used AudioInput to detect loud sounds to trigger the popping.


//FINAL PRODUCT



//FUTURE CONSIDERATIONS

Moving forward, I would like to figure out a way to incorporate a Bluetooth component to the wands to make it wireless. This was experimented with briefly, but was not incorporated into the final presentation due to some last minute coding/technical issues involving whether Processing could process two serial events (one from the wand’s bluetooth for the piezo) and another from the photocells. I also would like to take this project to a much larger scale. To do this, I would need to incorporate a better infrared transmitter or look into a wide-range camera for better infrared detection.


8
Dec 10

p-comp final proposal #3: “bubbles”

After spending week 1 researching and acquiring thermochromic paints for my original concepts, the issue of finding the right heating source and time needed to experiment with unfamiliar materials seemed unrealistic for a 2-3 week time frame. I decided in the second week to rethink my idea completely and focus on something that was simple, compelling and at the same time within my abilities so that it could be executed well. During a short walk through the park, I saw a family playing with liquid bubbles and became fascinated by how this simple toy could provide such a source of joy and entertainment for both adults and kids. Thus, the bubble wand idea was born.

This bubble piece will involve 2 interactions between two or more people.

Interaction #1: Making bubbles.
I will create a bubble wand with one or more sensors to detect sounds or vibrations (possibly an electret microphone or piezo vibration sensor) and/or accelerometer. These sensors will address the two ways people generally use a bubble wand, either by blowing on it or waving it around. When blown on, either an electret microphone or piezo sensor will tell Processing to generate bubbles. The accelerometer will read when the wand is being waved around. The sensors could also be able to detect how forcefully the wand is being blown on/ waved and generate more/less/smaller/bigger bubbles accordingly. The color of the wand will allow Processing to track through a webcam the location of the wand and therefore where the bubbles should originate. The idea is to have the Processing sketch projected on a wall with a webcam facing users to detect the wand color. (Multiple color wands could also represent differently shaped bubbles). As in real life, less bubbles will appear through time and will need to be replenished. When bubbles stop appearing, the wand will need to be dipped into a jar to recharge it. This could also be taken further with different jars for different color options of bubbles. I’d also like to consider incorporating a musical element as well based on the speed at which the bubbles appear.

Interaction #2: Popping bubbles.
This second part of the interaction is ICM based. Also using the webcam and either OpenCV or Blob Detect, Processing will detect where bubbles and shadows meet and “pop” the bubbles, as well make a popping sound.


16
Nov 10

p-comp final proposal #2: “reflection”

Similar to my first concept, this second idea for my Physical Computing final also involves the use of thermochromic inks in creating a “live, reflective painting.” This will be achieved using a piece of canvas with a layer of body temperature-activated thermochromic ink. Behind the canvas will be an intricate grid of tin or copper hexagons, each individually controlled/heated by resistive wire. Above the canvas will be a small webcam that will detect shapes of people or objects placed in front of the canvas. A Processing sketch will then translate the feed into grayscale values and through serial communication, the Arduino will in turn read those values and send a current to heat its respective hexagon pixel behind the canvas. As a result, the person would then see their own reflection emerging on the canvas.

A PWM multiplexer may be needed to control each hexagonal piece individually. Using a relay, I hope to be able to control the amount of heat emitted and therefore manipulate the color changes to create shading and depth. The first step is to experiment with the ink itself and determine which heating mechanism is 1) safe and 2) allows for the most control over the ink. Other heating element options to consider: incandescent C7 lightbulbs, peltier units, electric socks hack.


16
Nov 10

p-comp final proposal #1: “growth”

For my Physical Computing final project, I want to experiment with thermochromic inks to create a print of a tree that will appear/grow gradually as more hands, and therefore more body heat, is placed at the roots. The growth of the tree is the result of an act of collaboration by multiple persons, as the tree will only fully appear when the amount of heat transferred surpasses a certain threshold.

When a person first approaches the blank canvas, they will see only a small dot on the canvas, a seed. When a hand is placed on the seed, the Lilypad temperature sensor behind the seed will send a current through sections of the conductive thread or fabric behind the print, from bottom to top which are mapped to the amount of heat received by the sensor. Roots will appear to grow from behind the person’s hand. As more hands are placed on the roots of the tree and the more heat input the sensor receives, the conductive thread or fabric will activate the thermochromic ink in sections from the trunk to the leaves, giving the illusion that the tree is growing.

Though the concept itself is simple, I’m slowly realizing the execution of this idea is quite problematic, especially in regards to electrical control of the thermochromic ink. The heating mechanism itself will be the most time-consuming issue for me to tackle as I am looking for an effect that is very specific. I’m thinking that I will need to find something that can be controlled to emit heat slowly and gradually in specific sections to achieve the organic growth effect that I am hoping for. Another problem involves the properties of the thermochromic inks. There are typically three standard types of this ink: Low Temperature thermochromic ink (activated at 15° Celcius), Body Temperature (activated at 31° Celcius or with body heat), and High Temperature (activated at 45° Celcius, or just below the threshold of skin.) I would be using the Body Temperature activated ink for this project. Unfortunately, both Body Temperature and High Temperature inks, or any ink that is activated with heat, will only change from color to colorless with heat whereas I was hoping to find an ink that would change from colorless to brown or a dark gray. (Edit: I discovered that white to colorless ink can be custom-made, but would take a few weeks to manufacture.) To address this problem, I could begin with a solid colored canvas on which the print would fade in as white, therefore creating some sort of negative space effect, but I am not crazy about it for several reasons. First, it then begins to approach the sort of kitschiness associated with “disappearing ink” and secondly, is drastically different from the minimalistic, natural look I originally envisioned for the piece.


8
Nov 10

lab: transistors & h-bridges

This lab consisted of two parts that explored the use of transistors and h-bridges for dc motor control.

Transistor Lab

H-Bridge Lab

An H-Bridge circuit allows the DC motor to spin in both directions, while using a transistor only allows it to spin in one direction. Red and green LED indicators were added to easier tell when the motor changed direction.

Code:
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
const int redledPin = 12; // red LED indicator (CCW)
const int greenledPin = 13; // green LED indicator (CW)

void setup() {
// set the switch as an input:
pinMode(switchPin, INPUT);

// set all the other pins you’re using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
pinMode(redledPin, OUTPUT);
pinMode(greenledPin, OUTPUT);

// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);

}

void loop() {
// if the switch is high, motor will turn on one direction:
if (digitalRead(switchPin) == HIGH) {
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
digitalWrite(redledPin, HIGH);
digitalWrite(greenledPin, LOW);

}
// if the switch is low, motor will turn in the other direction:
else {
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
digitalWrite(greenledPin, HIGH);
digitalWrite(redledPin, LOW);
}
}


29
Oct 10

pcomp midterm: pinwheel progress report

Chien and I partnered up for the Physical Computing midterm to create an interactive pinwheel piece. In Chinese culture, a spinning pinwheel symbolizes an outward flow of bad fortune and inward flow of good fortune. In other words, a reversal of luck. We wanted to apply that concept to an art school context to create an “inspiration generator” of sorts. For students, fast deadlines and other high-stress situations can have a myriad of negative effects on the brain and body, including creative deadlock. A student in search of a reversal of such non-productivity can blow on a pinwheel to find a helpful strategy for creative renewal displayed on the center screen. Working in a team? Partners can spin both pinwheels at once to generate strategies tailored for 2 or more people.

For visual effect, a queue of LEDs will also light up in sequence as the pinwheel spins.

Our Processing interface will feature an animated pinwheel (yes, repurposed from an assignment that I submitted for ICM) that will spin when data, via serial communication with the Arduino, is generated through interaction with the Piezo vibration film sensor. Strategies will be placed into strings and displayed at random.

Prototyping in progress…

If we have time, we’d also like to explore adding a musical component…


27
Oct 10

serial communication lab

This lab introduced us to the idea of serial communication between Arduino and Processing. Serial communication allows us to take output data from, in this case, a single sensor and generate a graphical representation of that data in Processing.


5
Oct 10

stupid pet trick: sad LED needs a hug

Sad LED needs LOVE

For my stupid pet trick, I made a stuffed toy fashioned after an LED and placed a homemade fabric pressure sensor inside to create a hug-o-meter of sorts. The fabric sensor was built using two pieces of conductive lamé fabric (tested first with a multimeter at Mood Fabrics) with a piece of Velostat (antistatic material) sandwiched in between. Hugging the LED toy would trigger a series of (real) LEDs to light up in sequence based on the amount of pressure applied by the hug. A velcro opening at the bottom right of the stuffed toy allows the sensor to be easily inserted/removed.

The circular sensor was the second of two attempts. I had originally created a more rectangular sensor to better accomodate the shape of the LED, but found that it was only effective when pressure was applied directly between the two points of wire contact. I had hoped that creating a circular shape for the second sensor would help this problem, but it also seemed only to work when the pressure was placed between the two points.

The code programmed into the Arduino was modified from the analog input lab from Week 2. When placed inside the toy, the fabric sensor generated an output range of approx. 0-500.

And finally, a paper casing for the Arduino to hide the wires.


28
Sep 10

soft light switch (magnetic snaps)

This week, I wanted to experiment with using magnetic snaps as a switch. The magnetic snaps were purchased from Mood, a fabric store in the Garment District. Using a sewing machine, I created a soft light switch using cloth and polyester filling, attached jumper wires to the magnetic snaps (no soldering necessary) and connected the wires to the Arduino. When the magnets snapped into place, the four yellow LEDs on the Arduino would light up.

Code:
// declare variables:
int switchPin = 8; // digital input pin for a switch
int yellowLedPin1 = 4; // digital output pin for yellow LEDs
int yellowLedPin2 = 5;
int yellowLedPin3 = 6;
int yellowLedPin4 = 7;
int switchState = 0; // the state of the switch

void setup() {
pinMode(switchPin, INPUT); // set the switch pin to be an input
pinMode(yellowLedPin1, OUTPUT); // set the yellow LED pins to be outputs
pinMode(yellowLedPin2, OUTPUT);
pinMode(yellowLedPin3, OUTPUT);
pinMode(yellowLedPin4, OUTPUT);

Serial.begin(9600);
}

void loop() {
// read the switch input
switchState = digitalRead(switchPin);

Serial.println(switchState);
if (switchState == 1) {
// if the switch is closed:
digitalWrite(yellowLedPin1, HIGH); // turn on the yellow LEDs
digitalWrite(yellowLedPin2, HIGH);
digitalWrite(yellowLedPin3, HIGH);
digitalWrite(yellowLedPin4, HIGH);
}
else {
// if the switch is open:
digitalWrite(yellowLedPin1, LOW); // turn off the yellow LED
digitalWrite(yellowLedPin2, LOW);
digitalWrite(yellowLedPin3, LOW);
digitalWrite(yellowLedPin4, LOW);
}
}


18
Sep 10

lab: analog input

First attempt at soldering.

It’s not pretty and the right side is a little charred. But what matters for now is that it still conducts.

This week’s lab introduced us to Analog Input. This first round utilized the Analog In code provided in the Arduino Examples. What I was hoping to accomplish was an LED that would turn on when the FSR (force sensitive resistor) was pressed and completely off when not pressed. However, the LED seemed to stay on dimly even when the FSR was not in use. When the FSR was pressed slightly, the LED would increase in brightness. When more pressure was applied to the FSR, the LED would flicker.

Code:
int sensorPin = 0;
int ledPin = 9;
int sensorValue = 0;

void setup() {
pinMode(ledPin, OUTPUT);
}

void loop() {
sensorValue = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorValue);
digitalWrite(ledPin, LOW);
delay(sensorValue);
}

In this second round, I incorporated IF and ELSE statements into the code, which seemed to fix the problem of the flickering lights. Although I’m still not entirely sure why the previous code did not work.

Code:
int sensorPin = 0; // select the input pin for the potentiometer
int ledPin = 9; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);

if(sensorValue > 90) { //maximum value at about 112 (when pressed hardest)
digitalWrite(ledPin,HIGH);
}
else {
digitalWrite(ledPin,LOW);
}
Serial.println(sensorValue);
}

Finally, I also explored using the FSR in controlling the brightness of the LED based on how much pressure was applied to the sensor.

Code:
int fsrPin = 0;
int sensorValue = 0;
int led = 9; //PWM: Pulse Width Modulation (Basically a digital pin that can provide analog results.)

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
// declare the led pin as an output:
pinMode(led, OUTPUT);
}

void loop() {
sensorValue = analogRead(fsrPin); // read the FSR value
int brightness = map(sensorValue, 10, 112, 0, 255); // FSR values max at 112

analogWrite(led, brightness); // set the LED brightness with the result
Serial.println(sensorValue);
delay(10);
}

And finally, 1 FSR and 3 LEDs.