Archive for September, 2009

Lab 3 Working without Arduino

This lab was mostly to focus on building circuits with out the Arduino

I started by first looking at my power adapter. The adapter I was using was Positive on the outside and Negative on the inside.

measuringwallwart

The power adapter is connected through the breadboard to a 7805 5-volt voltage regulator which drops the 9v to 5v

measuringaftervoltageregulator

This is my basic LED circuit with a switch.

Physcomp Lab3-Basic circuit from Zeven Rodriguez on Vimeo.

I then connected another LED in series

Physcomp Lab3-Components in Series from Zeven Rodriguez on Vimeo.

Then measured the first LED in the circuit
series1

Then the second

series2

Finally, I added with a third LED. When I did that the intensity of the LEDs dropped. The last led dims because most of the voltage is sucked up by the first 2 leaving the last LED with a smaller current.

Physcomp Lab3- series Led plus 1 from Zeven Rodriguez on Vimeo.

In the parallel circuit I measured the amperage after the LEDs.

parallelmilliamps

The last part I measured the resistance on a pot.

Physcomp Lab3-Pot Variable Voltage Measuring from Zeven Rodriguez on Vimeo.

Lab2 Working with Pots

This Lab worked with analog circuits. This first part was not too challenging. Here is the code that I used for this.

int potPin = 0; // analog pin that pot attaches too “blue wire”
int potValue = 0; //value initial
int led = 9; // displays what the pot is doing

void setup(){

Serial.begin(9600);

}

void loop(){

potValue = analogRead(potPin); //read pot value
analogWrite(led, potValue/4); //pwm led w/ pot value
Serial.println(potValue);//print value
delay(10);

}

Physcomp Lab2 part1 from Zeven Rodriguez on Vimeo.

For more info about this lab click here

Lab 2 Part 2

This second part was using another type of analog switch to control leds. I used a photocell and when you put your hand over it switches between the lights. The hardest part was figuring out how to get the arduino to read the photocell. I referenced week 4′s lab. What I figured out was on the board first to run the positive —>photocell(+)—> photocell(-)—>Arduino analog in—>220Ohm resister—>Ground. The analog in reads the resistance off the photocell. Another issue I ran into was dealing with the photocell reading to make it smoother because of the fluctuations in light.

This is the code I used for this.

int potPin = 0; // analog pin that pot attaches too “blue wire”
int potValue = 0; //value initial
int led = 9; // displays what the pot is doing
int led2 = 10;
int x = 0;
int y = 0;
void setup(){

Serial.begin(9600);

}

void loop(){

potValue = analogRead(potPin); //read pot value
x = potValue/4;// sets the value arrange between 0 and 255

if (x < 10){
// makes for smoother range control
x = 0;
}
x = map(x,0, 150, 0, 255);

y = -(x – 150);
if (y < 20){
// makes for smoother range control
y = 0;
}
y = map(y,0, 150, 0, 255);

analogWrite(led, x); //pwm led w/ pot value
analogWrite(led2, y); //pwm led w/ pot value

//Serial.println(x);//print value
Serial.println(y);//print value
delay(10);

}

Physcomp-Lab 2 part2 from Zeven Rodriguez on Vimeo.

Lab 2 part 3

This was a simple experiment using a pot to show changing lights from red–>yellow–>green–>yellow–>red

This is the code I wrote

int potPin = 0; // analog pin that pot attaches too “blue wire”
int potValue = 0; //value initial
int led3 = 3; // displays what the pot is doing
int led6 = 6;
int led9 = 9;
int led10 = 10;
int led11 = 11;

void setup(){

Serial.begin(9600);

}

void loop(){
/*
so I need potvalue/4 and divide by 7 to get the range

*/
potValue = analogRead(potPin); //read pot value
potValue = potValue/4;

if (potValue <= 42){ analogWrite(led3, 255); analogWrite(led6, 0); analogWrite(led9, 0); analogWrite(led10, 0); analogWrite(led11, 0); } else if((potValue > 42) && (potValue <= 84)){ analogWrite(led6, 255); analogWrite(led3, 0); analogWrite(led9, 0); analogWrite(led10, 0); analogWrite(led11, 0); } else if ((potValue > 84) && (potValue <= 126)){ analogWrite(led9, 255); analogWrite(led3, 0); analogWrite(led6, 0); analogWrite(led10, 0); analogWrite(led11, 0); } else if ((potValue > 126) && (potValue <= 168)){ analogWrite(led10, potValue); analogWrite(led3, 0); analogWrite(led6, 0); analogWrite(led9, 0); analogWrite(led11, 0); } else if ((potValue > 168) && (potValue <= 240)){
analogWrite(led11, 255);
analogWrite(led3, 0);
analogWrite(led6, 0);
analogWrite(led9, 0);
analogWrite(led10, 0);
}

//pwm led w/ pot value
Serial.println(potValue/4);//print value
delay(10);

}

Physcomp-Lab 2 part3 from Zeven Rodriguez on Vimeo.

Fantasy Machine: De-atomizer

This is my Fantasy machine for Tom Igoe’s Physical Comp class.

deatomizer

For a better view download here

processingWeek2

Well this is the 2nd week of processing and all is going well so far.

For my first assignment I went ahead and used randomization and mouse position to create rectangles, trapezoids, and circles. click the link to view the program.

http://www.zevenrodriguez.com/itp/icm/week2/

I decided also to do a second animation with my pirate

http://www.zevenrodriguez.com/itp/icm/week2/elpirata2/

Traffic light

So I tried to code a traffic light. This is a rough sketch. The idea is to have a toy car roll over the contacts and it initiate the traffic signaling.

Traffic Light from Zeven Rodriguez on Vimeo.

This is the code I used

int pinRed = 3;
int pinYellow = 4;
int pinGreen = 5;
int switchButton = 2; // button
int switchIni = 0; // Initial state of switch

void setup(){
pinMode(pinRed, OUTPUT);
pinMode(pinYellow, OUTPUT);
pinMode(pinGreen, OUTPUT);
pinMode(switchButton, INPUT); //takes in switch signal

}

void loop(){
switchIni = digitalRead(switchButton);

if (switchIni == 1){
digitalWrite(pinRed, HIGH);
digitalWrite(pinYellow, LOW);
digitalWrite(pinGreen, LOW);
delay(1000);
digitalWrite(pinYellow, HIGH);
digitalWrite(pinRed, LOW);
digitalWrite(pinGreen, LOW);
delay(1000);

digitalWrite(pinGreen, HIGH);
digitalWrite(pinYellow, LOW);
digitalWrite(pinRed, LOW);
delay(5000);

}

else{
digitalWrite(pinRed, HIGH);
digitalWrite(pinYellow, LOW);
digitalWrite(pinGreen, LOW);
}

}

Lab 1

This is my first PhysComp lab. It involved the alternating the states of two LEDs.

Here is the code I used

More details on the lab could be found here

int switchButton = 2; // button
int pinYellow = 3; // Yellow LED
int pinGreen = 4; // Green LED
int switchIni = 0; // Initial state of switch

void setup(){
pinMode(switchButton, INPUT); //takes in switch signal
pinMode(pinYellow, OUTPUT); //yellow output
pinMode(pinGreen,OUTPUT); //green output
}

void loop(){
// read the switch
switchIni = digitalRead(switchButton);

if (switchIni == 1) {
// if the switch is closed:
digitalWrite(pinYellow, HIGH); // turn on the yellow LED
digitalWrite(pinGreen, LOW); // turn off the red LED
}
else {
//if the switch is open:
digitalWrite(pinYellow, LOW); // turn off the yellow LED
digitalWrite(pinGreen, HIGH); // turn on the red LED
}

}
In the wiring I initially had an issue with this. I did not realize I had put the red wire in the same rail as the blue. Thus I was getting a short

IMG_0093

Physcomp – Lab 1 from Zeven Rodriguez on Vimeo.

Sensor Walk

I took a walk around my neighborhood around Wall street. As part of a assignment for my PhysComp class, I documented all the sensors I saw in the area.

Outside of my building this doorbell also contains a camera which picks up anyone who comes close.

Outside of my building this doorbell also contains a camera which picks up anyone who comes close.

Buttons and touch screen on both the cell phone and the ATM help users navigate through menus

Buttons and touch screen on both the cell phone and the ATM help users navigate through menus

Being on Wall St. a lot of tourists and the media are in the area. Most carry cameras which have sensors to detect light and touch screens and buttons to navigate through menus.

Being on Wall St. a lot of tourists and the media are in the area. Most carry cameras which have sensors to detect light and touch screens and buttons to navigate through menus.

Minutes after taking these pictures I tuned in to MSNBC and the scene I documents in the first picture was on TV following the Presidents address at the Federal Reserve.

I counted about 20 security cameras in my area all picking up data on the people on the street

I counted about 20 security cameras in my area all picking up data on the people on the street

The Postal Office has a teller for automatic mail services with buttons and touch screen

The Postal Office has a teller for automatic mail services with buttons and touch screen

This door signals an emergency when you push the lever

This door signals an emergency when you push the lever

The cashier uses the touch screen on the register to ring up the customer

The cashier uses the touch screen on the register to ring up the customer

This alarm has buttons to test the alarm, but function on sensors to sound the alarm

This alarm has buttons to test the alarm, but function on sensors to sound the alarm

El Pirata

This is a Pirate I made using processing.

El Pirata