Announcements

November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!


Revision of Wheel Music from Thu, 11/08/2007 - 01:10

Project Members: 
Jonathan Breitbart
Seung Wook Kim
Sooyeon Han
Wesley Willett

Description

For this lab, we created an instrument out of a small bicycle wheel. We originally used potentiometer to control a dc motor that turned the wheel. But the wheel was not powerful enough and the wheel turned too slowly. So we manually turn the wheel instead. Sound is created in a couple different ways. Two photocell sensors are rigged to the wheel aparatus. A screen with sections cut out lines up with the photosensors. A light shining on the other side of the screen activates the photcell sensors at different intervals depending on the speed of the wheel. Input from the photocell sensors activate piezo speakers. The pitch of the speakers can be varied by turning potentioemeters. A second source of sound comes from three different materials attached to a servo motor. As the wheel turns, items attached to the edge of the wheel strike the the materials attached to the servo motor to make different sounds.

Materials

Small bicycle wheel, metal posts, erector set pieces, dc motor, servo motor, photocell sensors, potentiometers, Arduino boards, wooden stick, metal rods, piezo speakers

Photocell/Speaker Arduino Code

int cellPin0 = 0;
int cellPin2 = 2;
int potPin = 4;
int speakerPin0 = 7;
int speakerPin2 = 13;
int val0 = 0;
int val2 = 0;
int val4 = 0;

void setup() {
pinMode(speakerPin0, OUTPUT);
Serial.begin(9600);
Serial.println("ready");
}

void loop() {
digitalWrite(speakerPin0, LOW);
digitalWrite(speakerPin2, LOW);

val0 = analogRead(cellPin0);
val2 = analogRead(cellPin2);
val4 = analogRead(potPin);

for (int i=0; i<500; i++) {
if (val0 > 300) {
digitalWrite(speakerPin0, HIGH);
delayMicroseconds(val4);
}
digitalWrite(speakerPin0, LOW);
delayMicroseconds(val4);

if (val2 > 300) {
digitalWrite(speakerPin2, HIGH);
delayMicroseconds(val4*2);
}
digitalWrite(speakerPin2, LOW);
delayMicroseconds(val4*2);
}
Serial.print(val0);
Serial.print("\n");
Serial.print(val2);
Serial.print("\n\n");
}

Pictures

Videos

http://tels.berkeley.edu/~breity/P1010003.MOV

http://tels.berkeley.edu/~breity/P1010004.MOV

http://tels.berkeley.edu/~breity/P1010005.MOV


Powered by Drupal - Design by Artinet