Wednesday, July 08, 2009

Breath-over-IP


The "Breath-over-IP" project is a PHY2PHY project to deliver someone's breath across the Internet. It is based on an Arduino with a double stack of shields. The first shield is a SparkFun Arduino protoshield where I mount some resistors and a solid-state relay. I used wire-wrap sockets to provide a stand-off from the Arduino:

Protoshield with wire wrap sockets

Then on top of that I added an AdaFruit Xport shield, which I populated with a Lantronix Xport Direct:


Stacking Arduino, Protoshield, and Ethernet shield

Arduino, Protoshield, and Ethernet shield

Now I had to build the Breath sensor. I tried using gutted case fans, but they were always a bit too hard to blow. Here I am testing an IR led and IR phototransistor on a breadboard with a gutted case fan:

IR emitter/detector pair and fan

I eventually decided on using a replacement Kestrel anemometer impeller. To provide some kind of structure to mount the IR LED and phototransistor to, I used FastSteel:

FastSteel FastSteel Kestrel Anemometer Impeller Impeller encased in FastSteel

Then I added the side-looking NTE 3029B IR LED and NTE 3034A IR Phototransistor detector, held in place with a bit more FastSteel:

Breath Impeller

And for flexibility, I mounted it on a mini-tripod:

Breath Impeller Breath Impeller System

For the "first side" of Breath, I used a solid-state relay capable of AC or DC operation. I figured I might want the Breath to drive a full-sized AC fan, so the "output" is an AC plug. I found a powerful, yet compact AC fan for standard operation. Then I tested it and mounted it in a box:

Breath box in testing

Breath Box


"Home Base" Breath System

I realized that I would be shipping the "other side" of Breath all over the planet, so perhaps it should be a little more compact, and DC only so I wouldn't have to worry about different AC voltages/frequencies in other countries. So I found a powerful 12VDC fan. I mounted the impeller and IR LED and phototransistor into a piece of PVC pipe, and JB Welded the pipe on top of the fan. The pipe is long enough so that the wind from the fan doesn't make the impeller spin, as it is very sensitive! The result:

"Mobile" Breath System

Here is the Arduino program, which used the NewSoftSerial library to talk to the Xport Direct:
#include NewSoftSerial.h

// breath

unsigned long time = 0; // time of last edge
int minTime = 25; // minimum time for edge
int good = 0; // number of consecutive good (fast) edges
int minGoods = 20; // minimum number of consecutive good (fast) edges to indicate breath

int ledPin = 13; // on-board LED pin
int irLedPin = 10; // IR LED attached to pin 12 with 220 ohm resistor
int irDetPin = 0; // IR phototransistor attached to analog 0 with 5V and 10K
int relayPin = 11; // solid-state relay pin

unsigned long onTime = 0; // relay on time'
unsigned long pingTime = 0; // time to "ping" server

int i=0; // counts up received breath packets for diagnostics
int light=0; // whether IR detector sees light or dark
int lastLight=0; // what IR detector saw last time

unsigned long sendTime=0; // last time breath packet was sent out

NewSoftSerial xport(3,2);

void setup()
{
pinMode(relayPin,OUTPUT);
digitalWrite(relayPin, LOW);

Serial.begin(57600);
xport.begin(9600);

pinMode(ledPin, OUTPUT);
pinMode(irLedPin, OUTPUT);
digitalWrite(irLedPin, HIGH);
Serial.print("Starting"); //for debugging
}

void loop()
{
if(analogRead(irDetPin)>850){
light=0;
}
else{
light=1;
}

if(light != lastLight){
// edge
if(millis()-timeminGoods) {
// enough good (fast) edges
digitalWrite(ledPin,HIGH);
if(millis()-sendTime>100){
// send a breath, not too fast though
xport.print("B2");
sendTime = millis();
}
}
else{
// not enough good (fast) edges
digitalWrite(ledPin,LOW);
}

if(millis() - onTime > 100){
digitalWrite(relayPin,LOW);
}

if (xport.available()) {
if((char)xport.read()=='B'){
// receive a breath
digitalWrite(relayPin,HIGH);
onTime = millis();
//Serial.println(onTime);
}
}
if(millis() - pingTime > 1000){
xport.print("A2");
pingTime=millis();
}
}
The last thing needed is a "meet in the middle" server. The two sides of breath send UDP packets to the server. Every second they send a "ping" to make sure the server knows where they are (and this also helps to "punch out" through a firewall). Then when the sides sense a breath, they send a "breath" signal to the server, which relays the breath signal to the other side. Here is the Python program:
from socket import *
s=socket(AF_INET,SOCK_DGRAM) # create UDP socket
s.bind(('[ip address]',[port])) # bind to port
count=0
a1=('10.0.0.0',80) # will hold address of Breath side 1
a2=('10.0.0.0',80) # will hold address of Breath side 2
while 1:
[msg,addr]=s.recvfrom(128) # receive packet of up to 4 bytes
print(addr,':',msg)
if(msg[0:2] == "A1"): # address "ping" from Breath side 1
a1=addr
if(msg[0:2] == "A2"): # address "ping" from Breath side 2
a2=addr
if(msg[0:2] == "B1"): # breath sensed on Breath side 1
a1=addr
s.sendto("B",a2) # relay breath to Breath side 2
if(msg[0:2] == "B2"): # breath sensed on Breath side 2
a2=addr
s.sendto("B",a1) # relay breath to Breath side 1

Monday, July 06, 2009

Dorkbot SoCal 37

Dorkbot SoCal 37

***** Saturday, July 11, 2009
***** 1:00pm
***** Machine Project
***** 1200 D North Alvarado Street
***** Los Angeles, CA 90026
***** Google map of Machine Project

Heather Knight
http://www.marilynmonrobot.com/
A newbie Angelino and recent alumnus from the Personal Robots Group at the MIT Media Lab, Heather is a Social Roboticist who works at the Jet Propulsion Lab. She has two degrees from MIT in Electrical Engineering and Computer Science and a minor in Mechanical Engineering, working in Robotics since 2002 under Professor Cynthia Breazeal. This dorkbot she will present her work enabling robots to understand nonverbal human gestures and talk about the potentials for interactive technology incorporated into everyday objects, such as clothing.




Jody Zellen
http://www.jodyzellen.com/
Jody Zellen is an artist living in Los Angeles, California. She works in many media simultaneously making photographs, installations, net art, public art, as well as artists' books that explore the subject of the urban environment. She employs media-generated representations of contemporary and historic cities as raw material for aesthetic and social investigations.



Xuan "Sean" Li
http://www.way2sky.com/portfolio/
Xuan "Sean" Li creates works that merge concepts and ideas from different disciplines into new digital and electronic expression. He has worked in the areas of web design, game level design, product design, and 3D rendering and animation. His most recent work attempts to expand the role of information visualization as an art form through a novel combination of physical sensors with generative visuals, exploring new aesthetic possibilities by expressing the nature of the wireless data flow.

Sunday, June 14, 2009

Analog TV Termination Results

From the event at Machine Project, first a mechanical television that uses a Nipkow Disk:

Mechanical Television @ Machine Project

So there was a stack of analog TVs:
Analog Termination event @ Machine Project

And just before midnight, they turned off the lights:
Before the analog termination

Then as the minutes ticked away, the analog signals winked out, until finally at midnight:
After the ananlog termination

Thursday, June 11, 2009

Analog TV Termination Party in LA - Friday, June 12

Friday June 12th at 10pm - a talk by Jason Torchinsky about mechanical televisions, to be followed by a midnight countdown to the demise of analog TV. Sometime Friday night (depending on the station) all the old analog television broadcasts will stop, to be replaced by digital signals. That means old TVs without converter boxes won’t work anymore. In memoriam of the TVs we all have known and loved/hated, we’ll be gathering a pyramid of old TVs together for a countdown as they go to static. Please join us, and if you promise to bring it home with you afterwards, bring a TV for the pyramid.

Machine Project 
1200 D North Alvarado 
Los Angeles, CA 90026 

Gel Electrophoresis Artwork

Here is a neat web page about using restriction digestion of DNA samples to make artwork using gel electrophoresis:

Latent Figure Protocol

Thursday, June 04, 2009

Dorkbot SoCal 36

Dorkbot SoCal 36

***** Saturday, June 20, 2009
***** 1:00pm
***** Machine Project
***** 1200 D North Alvarado Street
***** Los Angeles, CA 90026
***** 
Google map of Machine Project

Design Algorithms: Skeuomorphs, Spandrels & Palimpsests 
This event will explore how cultural objects shift over time, with each presenter exploring a single term related to patterns of cultural change. 

Skeuomorphs - Garnet Hertz - UC Irvine
"An ornament or design on an object copied from a form of the object when made from another material or by other techniques" 

Garnet Hertz is an interdisciplinary artist, Fulbright Scholar and doctoral candidate in Visual Studies at UC Irvine. He also holds an MFA from the Arts Computation Engineering program at UCI, has completed UCI's Critical Theory Emphasis and is currently an affiliate of the Laboratory for Ubiquitous Computing and Interaction in the Department of Informatics. His dissertation research explores the creative, historical and cultural advantages of reusing obsolete information technologies in the media arts, and uses these examples to construct a critical theory of a cluster of related activities: circuit bending, D.I.Y., critical design and media archaeology. He has shown his work at several notable international venues in eleven countries including Ars Electronica, DEAF and SIGGRAPH and was awarded the prestigious 2008 Oscar Signorini Award in robotics. He is founder and director of Dorkbot SoCal, a monthly Los Angeles-based DIY lecture and workshop series on electronic art and design. His research is widely cited in academic publications, and popular press on his work has disseminated through 25 countries including The New York Times, Wired, The Washington Post, NPR, USA Today, NBC, CBS, TV Tokyo and CNN Headline News. 

Spandrels - Tim Durfee - Art Center 
"The roughly triangular space between the left or right exterior curve of an arch and the rectangular framework surrounding it" 

Tim Durfee is an architect based in Los Angeles. His independent and collaborative work has produced buildings, exhibitions, temporary installations, furniture, urban sign systems, interfaces, videos, and maps. 

He is a partner of the Los Angeles office Durfee | Regn and teaches at Art Center College of Design in the Graduate Media Design Program. He was director of the Visual Studies Program at the Southern California Institute of Architecture (SCI-Arc), and recently completed a Visiting Professorship at Woodbury University. 

Current projects include several houses, a penthouse loft and rooftop in downtown LA, signs for the Gallery Row district in Los Angeles, and a museum on the history of transportation in Los Angeles near the Port of Los Angeles. With Durfee Regn Sandhaus (DRS), Tim Durfee has also created award-winning exhibitions for museums across the country. 

Palimpsests - Norman Klein - CalArts / Art Center
"A manuscript, typically of papyrus or parchment, that has been written on more than once, with the earlier writing incompletely erased and often legible."

Norman Klein is a cultural critic, and both an urban and media historian, as well as a novelist. His books include "The History of Forgetting: Los Angeles and the Erasure of Memory," "Seven Minutes: The Life and Death of the American Animated Cartoon," and the data/cinematic novel, "Bleeding Through: Layers of Los Angeles, 1920-86" (DVD-ROM with book). His next book will be "The Vatican to Vegas: The History of Special Effects." (Fall, 2003). His essays appear in anthologies, museum catalogs, newspapers, scholarly journals, on the web -- symptoms of a polymath's career, from European cultural history to animation and architectural studies, to LA studies, to fiction, media design and documentary film. His work (including museum shows) centers on the relationship between collective memory and power, from special effects to cinema to digital theory, usually set in urban spaces; and often on the thin line between fact and fiction; about erasure, forgetting, scripted spaces, the social imaginary.

Friday, May 29, 2009

Monochrom on Computers in Popular Music @ Machine Project

The Monochrom folks are awesome...this is worth checking out....

“I can count every star in the heavens above but I have no heart I can’t fall in love…”

The image of computers in popular music

Machine Project
1200 D North Alvarado
Los Angeles, CA 90026
Saturday, June 6th, 2009
8pm

A talk (with audio examples) by monochrom, presented by Johannes Grenzfurthner

Bourgeois culture was paralyzed and finally overrun by modern technologies which broke through the traditional class barriers. It went into a panic and produced these very stupid technophobic manifestos and images e.g. of “the computer”. Pop music discovered and explored the computer not only as a musical instrument but also as something to sing and reflect about in a less aversive way. In doing so it influenced the conception people had of computers. The public image of computers was shaped by groups such as Kraftwerk as well as through obscure Schlager songs such as France Gall’s “Computer No. 3”. Not only was that image influenced by high culture computer panic but also by naïve technomania, and so it delivered the very dialectics of the computer as a means of cultural technology in capitalist society.
monochrom is an art-technology-philosophy group having its seat in Vienna:

Thursday, April 02, 2009

OSC control from iPhone to pd on Mac

Everyone seems to be using Open Sound Control (OSC), so I figured I'd try controlling pd (aka Pure Data) on my MacBook from my iPhone using the TouchOSC app.

Here is how you do it...

1) Get a recent build of pd, I used this build.

2) Set up a new computer-to-computer WiFi network:

Create Computer-to-Computer network

Create Computer-to-Computer network

3) Connect to the WiFi network "osc" on your iPhone.

4) Find your PC's IP address on that computer-to-computer WiFi network:

Check your IP address

5) Put your IP address into the "Host" configuration on TouchOSC on your iPhone, and set your outgoing port:

TouchOSC Configuration

6) Set up your pd patch:

OSC pd Example

"dumpOSC 9999" receives on port 9999, "OSCroute" parses the command, and I use "unpack" to grab the second element of the message, which is the fader value or toggle setting:

6) Play!