Main | October 2006 »

September 27, 2006

Intergalactic Love-O-Meter

My interpretation of the carnival classic….

(or maybe it belongs in a low-budget sci-fi film)

love_meter.jpg

The input comes from three thermistors under a brass finger pad that, when touched, change the color of a 6 LED array using a program written in Arduino. My proudest achievement with this project was the glass color orb. It’s a tea-light holder which I inverted and chromed to diffuse the light.

love_led_array.jpg

Ultimately, thermistors while easy to use are slow to repond and predictable. If I were to move this design beyond prototype I think it would be fun to try detecting changes in skin conductivity (e.g. lie detector).

crome_paint.jpg

code follows

int hotPin = 0; // Analog input pin that the thermistor is attached to
int hotValue = 0; // value read from the thermistor
int hotRead = 0;
int hotChange = 100;
int roomTemp = 100;
int blue1 = 9; // PWM pin that the blue1 BLUE1 is on
int blue2 = 2;
int yellow1 = 3;
int yellow2 = 4;
int red1 = 5;
int red2 = 6;
long randNumber;

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(hotPin, INPUT);
pinMode(blue1, OUTPUT);
pinMode(blue2, OUTPUT);
pinMode(yellow1, OUTPUT);
pinMode(yellow2, OUTPUT);
pinMode(red1, OUTPUT);
pinMode(red2, OUTPUT);
roomTemp = analogRead(hotPin); // records the ambient room temp
}

void loop() {
hotValue = analogRead(hotPin); // read the pot value
hotRead = (hotValue - roomTemp);
if (hotRead >= 2)
{
if (hotRead <= 3) {
analogWrite(blue1, 10);
digitalWrite(blue2,HIGH);
digitalWrite(yellow1,LOW);
digitalWrite(yellow2,LOW);
digitalWrite(red1,LOW);
digitalWrite(red2,LOW);
}
if (hotRead > 3 && hotRead < 6)
{
analogWrite(blue1, 0);
digitalWrite(blue2,HIGH);
digitalWrite(yellow1,HIGH);
digitalWrite(yellow2,LOW);
digitalWrite(red1,LOW);
digitalWrite(red2,LOW);
}
if (hotRead >= 6 && hotRead < 9)
{
analogWrite(blue1, 0);
digitalWrite(blue2,LOW);
digitalWrite(yellow1,HIGH);
digitalWrite(yellow2,HIGH);
digitalWrite(red1,LOW);
digitalWrite(red2,LOW);
}
if (hotRead >= 9 && hotRead < 12)
{
analogWrite(blue1, 0);
digitalWrite(blue2,LOW);
digitalWrite(yellow1,LOW);
digitalWrite(yellow2,HIGH);
digitalWrite(red1,HIGH);
digitalWrite(red2,LOW);
}
if (hotRead >= 12 && hotRead < 14)
{
analogWrite(blue1, 0);
digitalWrite(blue2,LOW);
digitalWrite(yellow1,LOW);
digitalWrite(yellow2,LOW);
digitalWrite(red1,HIGH);
digitalWrite(red2,HIGH);
}
if (hotRead >= 14)
{
analogWrite(blue1, randNumber);
digitalWrite(blue2,LOW);
digitalWrite(yellow1,LOW);
digitalWrite(yellow2,LOW);
digitalWrite(red1,HIGH);
digitalWrite(red2,HIGH);
}
}
else
{
randNumber = random(1,10);
analogWrite(blue1, randNumber);
digitalWrite(blue2,LOW);
digitalWrite(yellow1,LOW);
digitalWrite(yellow2,LOW);
digitalWrite(red1,LOW);
digitalWrite(red2,LOW);
delay(300);
}
hotChange = analogRead(hotPin);
Serial.println(hotRead);
}

101010

In his essay, “The Work of Art in the Age of Mechanical Reproduction,” Walter Benjamin has an uncanny ability to foreshadow the discourse concerning mass production in the digital age. Remove his work from the timestamp of his Marxist / Socialist underpinnings and set him up with a word processor and a digicam and we’ve got a relevant op-ed for the New York Times on the lost aura of art in the new millennium.

Indeed, we have reached the pinnacle of his expectation. With digital reproduction it is impossible to distinguish the replica from the original. Does it even make sense to use the term “original” while talking about digital mediums? What of our auras?

I look around me in search of something original that I own. Sadly (though not surprisingly), I can only be sure that a couple paintings and maybe a clay pot are, in fact, unique. Am I bothered? Not really. Am I detached somehow from the analogness of life? I don’t think so. But, how would I know for sure? I’ve never really known any different.

Certainly, digital mediums have changed and disrupted the course of art and communication but have we completely lost touch with what is special about the making of art and about the viewing of it? Of course, there are problems (illegal distribution, intellectual property, digital manipulation (see photos) blah blah) but I’m not so sure that the Ludities have the game cornered just yet. Accessibility is a word that all socialists should love. Digital has done more to make art, literature… knowledge accessible than any other innovation in human history. Now that can only improve our auras.

http://www.nytimes.com/2006/08/14/technology/14photoshop.html?ex=1159416000&en=7a7e43fda1dca3f9&ei=5070

Credit to Hany Farid at Dartmouth for a nice collection of manipulated imagery:

http://www.cs.dartmouth.edu/farid/research/digitaltampering/

September 20, 2006

Observation: Using Technology

I was asked to conduct some observations of New Yorkers interfacing with technology. Initially, I just needed to “hang-out” and watch people using some sort of kiosk. Well, I thought, I could just copout and monitor a set of pay phones at 48th and Broadway over webcam. Interesting but not very fruitful. Mostly people checking for returned change and an assortment of other suspicious transactions. The next day, I made the trip of to Tower Records and found a smallish line gathered at the “scan and listen stations.” These kiosks are advertised all over the store. The idea is that you can just pick up any CD in the store and then stroll over to a station, scan it with the bar code reader and preview the album. Brilliant. The problem is: this is a particularly terrible implementation. To be sure, these machines produced a lot of interest – when someone else was using them. I scanned a few of my own CD selections and found several people looking over my shoulder studying my every move. Perhaps they had tried to use the machine before and failed. As it turned out, the first machine I used was broken (or at least I declared it so and moved on). The next machine I tried did eventually work. The combination of a convoluted, busy and blinking interface and a finicky bar code reader presented a challenge. Again, people were watching – So I listened to my selections (staying well within the 10 minute time limit) and moved back to observe. Slowly and carefully people would creep up (with or without an actual disc to scan). Some would just study the machine, some would push a few buttons, and some would just grab a random CD from the selection in front of the machine. Some users managed to call up the CD and listen; others struggled, gave-up and resumed their isle browsing. Those who had a positive experience would often return with more CDs with a new found confidence in themselves and what could be a rather useful selection tool.

Human meets technology (stages)

- Observe other human using
- Envy human; want technology
- Approach
- Play, pretend, experiment
- Discovery
- Operate

Other common consumer electronics I observed over the course of a day:

Mobile Phones and PDA

100s - Razors(23), Blackberries (5), Sidekicks (2): It’s not a revelation that they’re everywhere. If you pause and try to count them all you won’t be able to. Or rather, you’ll stand and count indefinitely. Unfortunately, they are not transparent to us as most people seem to have trouble even walking while in use – especially text messaging. I believe text messagers have become the scourge of the sidewalk; followed by the people counting them.

Phone and PDA users are:

- Stupid. Make stupid faces at their device – like babies drooling.
- Walk slow
- Are separate from this plane of reality (even when walking with someone else)
- Talk loudly

Music Players

Also 100s (14 users) (31 confirmed IPODs) – A lot of people have something in their ears (myself included). They were almost as numerous as the people with phones. Eventually, I tried to count only the people that I actually saw interfacing with their player. Most activity was quick and seemingly fruitful. People rarely actually remove their devices from its bag, pocket, or holster to use it. Next song.

Mobile Music Mavens are:

- Smart
- Scheming
- Walk fast
- Talk to themselves (or sing)
- Look around a lot – people watch
- Think different

ATMs

There were 8 people who came into the bank (Citibank) while I was there. All of them going about their transactions privately; almost ignoring the fact that other people were in the room. Deliberate. I’d say most of them had been there before and knew what they were doing.

Bank Patrons Are:

- Wealthy
- Private
- Deliberate
- Practiced

Computers (Laptops)

28 (24 Apple) - All over the ITP floor. Easily half the floor has their face in one at any moment. Also at the coffee shops. Starbucks patrons seem especially fond of their laptops and expensive coffee beverages.

Other Stuff

Cameras (14)
Video Cameras (3)


Beautifying the Blog

Truth be told – I have never had any experience with Cascading Style Sheets so a hot new (read: original) look for my blog has not yet come to fruition. I did come upon this handy plug-in for Moveable Type called StyleCatcher which has allowed me to plagiarize off the abilities of others. In the process, I did learn a lot about Moveable Type and more generally what the hell is going on with CSS. So that is good. For now, just marvel in the simplicity of it all…

http://itp.nyu.edu/~scv201/mt-static/themes/theme-minimalist/theme-minimalist.css

September 19, 2006

Combination Lock (though 'lock' may be a bit of an overstatement...)

This is my first real breadboard project, and my first Arduino program - with modest results. Regrettably, I have not yet produced a stylish enclosure for it as I spent too much time fiddling with code which proved slightly beyond my present capabilities…

Problems include the use of the delay function and that the program does not generate an error when an incorrect button is pressed. As a result, simply pushing all the buttons will foil the lock. I think the best approach will be to poll all of the swithes using an array to store the digits (as Gian suggested). A few helpful 2nd year ITPers provided some helpful tips which I will attempt to develop as my programming abilities improve. Their comments are posted below.

It looks like this:

The program is as follows:

int switchPin1 = 2; // switch 1
int switchPin2 = 4; // switch 2
int switchPin3 = 3; // switch 3
int switchPin4 = 5; // switch 4
int greenLedPin = 6; // green led
int redLedPin = 7; // red led
int switchState = 0; // first switch state

void setup() {
pinMode(switchPin1, INPUT); // switch 1 set to input
pinMode(switchPin2, INPUT); // switch 2 set to input
pinMode(switchPin3, INPUT); // switch 3 set to input
pinMode(switchPin4, INPUT); // switch 4 set to input
pinMode(greenLedPin, OUTPUT); // green LED pin set to output
pinMode(redLedPin, OUTPUT); // red LED pin set to output
}

void loop() {
switchState = digitalRead(switchPin1); // monitor first switch in sequence

if (switchState == 1) { // when pressed check next switch in sequence
delay(900); // requires a rather precise human
if(digitalRead(switchPin2) == HIGH) {
delay(900);
if(digitalRead(switchPin3) == HIGH) {
delay(900);
if(digitalRead(switchPin4) == HIGH) {
digitalWrite(greenLedPin, HIGH); // green LED on
digitalWrite(redLedPin, LOW); // red LED off
delay(5000); //savor the victory
}
}
}
}
else {
digitalWrite(greenLedPin, LOW); // green LED off
digitalWrite(redLedPin, HIGH); // red LED on
}
}


Some feedback:

---- Thanks to Christopher Paretti

I would set up the correct sequence ahead of time.
So the combo might be 4231 or something.
If you don't hit 4 first, throw an error and reset.
If you hit 4, trigger a boolean to be true ( lock1 = 1 ), then check the other buttons against this variable.

So a button 2 press might say

int lock1 = 0;
int lock2 = 0;

// button press code here
if( lock1 == 1)
{
lock2 = 1;
else {
digitalWrite(errorLight, HIGH);
// and then reset all the booleans back to 0.
lock1 = 0;
lock2 = 0;
}

then button 3 might say

if ( lock1 == 1 && lock2 == 1)
// blah blah

---- Thanks to Gian Villamil

The way I coded mine (it's a simon game, but not so different) is like this:

I basically poll each switch in sequence and see if it is down. If a
switch is down, I save its number in an array, and move to the next
digit. When all the digits are entered, I compare against the
combination.

By doing the compare when the entire combo is entered, I defeat
attempts to guess the code by testing permutations.

---- Thanks to Andrew Schneider

Since "delay" is a blocking function, you might look into using
"millis":

http://www.arduino.cc/en/Reference/Millis

and an example from Tom that works as a non-blocking delay:

void loop() {
if (millis() - lastTimeVar > 500) {
//do something
lastTimeVar = millis();
}

September 14, 2006

9-11-2006

A shot I grabbed from my roof the other night...

September 12, 2006

Truth Tellers?

Since this will be my first blog entry, it seems only appropriate to blog about blogging. While writing this (offline), my first observation is that this program (Word) doesn’t even seem to know what a “blog” is (I’m getting red squiggles). Yet this is a medium that has become so enormously powerful…

So the journalists are all up tight about bloggers and how they’re encroaching on their credibility as the sole distributors of truth. To be sure, this is a complex issue which I can not hope to tackle in one entry. Simply put, I believe that we are only better served when more people have a voice. This, obviously, creates a huge problem for many of the deeply entrenched institutions of society. Maybe even for society itself. Soldiers (for example) aren’t supposed to have a “voice,” after all, they’re supposed to shut the F up and follow orders. How can we effectively assert our power in the world if an inconvenient truth enters the collective? What if it were something which might lead some people to comment (in similar entries) that maybe things have gone very wrong? As it turns out (indeed, as we see every day), these institutions with a truth to protect have turned the full force of their instrument to tackling this problem. Main-stream journalism, corporations, governments - have all gone on the offense. How does a military which had been accustomed to opening every letter, eavesdropping on every call, and corralling every media interview respond when soldiers have access to a two megabit broadband connection in the rec. room? Well, at first there’s confusion and chaos: as we see now. It’s doubtless that the Pentagon brass blame such mediums (email, blogs, etc.) as a primary source for all this foul sentiment. We hear over and over that the good news just isn’t getting out. Maybe they’re even deluded enough to believe that bad news pouring out of Iraq is the actual cause of their struggles. For now, they respond by printing more “Support Our Troops” bumper stickers - which sounds like a nice thing but really means shut the F up and follow orders. So what comes after confusion and chaos?: New rules and legislation. The mortar which holds all of these independent thinkers into something called a society.

My concern is that in their efforts to subjugate this relentless chatter, these intuitions will begin to divide up and “refine” corner stones of this “freedom” we are all said to be enjoying. What if new laws begin to carve away at stuff like that first amendment? Shrouded in something like a bill called “the patriot act,” they would begin to define the modes of communication that are actually held to be free. Or who was or was not press. Sure, people have always feared that the sky was falling in this respect (and I realize that this entry is beginning to sound alarmist and angry)… I do worry that it is much easier to plunk some rules down when no one is really looking or really knows what the hell is going on. My mother just learned about Wikipedia today after all. This new wave of mass-mediums does seem to be that kind of an environment – where no one really knows what’s going on. Take the Digital Millennium Copyright Act, for example. A sneaky piece of law that was passed before anyone (most people) knew what DRM was. This basically tried to retrofit existing intellectual property laws (for physical items) into the digital domain. It seems to me that what we needed was a complete reworking of what property is.

And then we have these massive multi-player online games with their virtual properties and goods and GDPs equaling small nations… What is a true piece of property? What is a true truth? Who will tell us? Or do we simply have to trust in the democracy of it all and become better, more informed, consumers of things (real or not) and knowledge (true or not). I’m afraid that we all have a lot of learning to do.