Making Furniture Interactive

October 27, 2007

Exercise 6: Kipum Lee, “Spin It!”

Filed under: Exercise 6: Motorized Mechanical Movement,Kipum Lee — Kip @ 11:49 pm

I started from scratch for Exercise 6. I built custom gears out of aluminum rods, nails, and aluminum wires. Also, the structure for the “toy” was built from foamcore and thumbtaks. I first tried to use a 3V DC motor, but it spinned too fast and lacked power. With the new geared motor, it definitely has more power to get the job done.

Instead of using a diode, I used an LED instead because functions the same way as a diode (hence the term, light-emitting diode). This was realized after a trip up to the code lab and through Mark’s advice.

It was a challenge trying to put together the motor with the rotational gears. Since the rotating axis/plastic has a unique shape, I had to figure out a way to fit the shape into my rotating aluminum apparatus. This was quite a challenge and involved a combination of wood, plastic and nails to get the right part made.

As of right now, a photosensor at the top of the toy is the switch that turns on and off the motor. I learned to constantly reiterate the parts and taking the right measurement for the parts was key to getting a smoothly working toy.

Aluminum Small Gears Gear Attachment LED as diode Battery PoweredPhotosensor

Code:

// Kipum Lee
// Exercise 6, Motor & Mechanism
// Oct 23, 2007, Instructor Mark Gross, Making Furniture Interactive

int motorPin = 8; // motor connected to analog pin 8
int sensorPin = 1; // LED connected to analog pin 1
int photoVal = 0;

void setup () {
pinMode (motorPin, OUTPUT); // sets the motor output
pinMode (sensorPin, INPUT); // sets the sensor output
Serial.begin(9600);
}

void loop () {
photoVal = analogRead (sensorPin);
Serial.println(photoVal);
if (photoVal >= 50) {
digitalWrite (motorPin, HIGH);
}
else {
digitalWrite (motorPin, LOW);
}
}

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: