« 101010 | Main | Photoshopery »

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);
}

TrackBack

TrackBack URL for this entry:
http://itp.nyu.edu/~scv201/cgi-bin/mt/mt-tb.cgi/8

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)