Making Things Interactive

February 19, 2008

Rotational Forms

Filed under: 6: More Motion,Assignments,Nadeem Haidary — nhaidary @ 2:09 pm

I’m using the potentiometer to control a DC motor. I made this as a tool to experiment with rotational forms. You can put a profile on the disc and the motor will spin it to give the illusion of a 3-dimensional form. I was looking at how fast the disc needs to be spinning to create the illusion. I was trying to see how fast the disc needs to be moving for an LED to look stable even though it is actually only seen once per revolution (through the hole).

I am having problems with the power to the motor dying periodically if I crank it up high. I reverted to thick paper after experimenting with foamcore-but the motor is not powerful enough to spin it quickly.


/*
ROTATIONAL FORM
by Nadeem Haidary

with help from ITP Physical Computing tutorials
*/

int transistorPin = 9;              // connected to the base of the transistor
int transistorValue = 180;          // initial value for motor speed (through transistor)

int potentiometerValue = 0;         // the value returned from the potentiometer
int potentiometerPin = 0;           // the analog pin reading the potentiometer
int motorSpeed = 0;

//-------------------------------------------------------------------

void setup() {
pinMode(transistorPin, OUTPUT);   // Set transistor pin as an output pin
Serial.begin(9600);
}

//-------------------------------------------------------------------

void loop() {

//-----DC MOTOR-----
potentiometerValue = analogRead(potentiometerPin);     // read the analog input
motorSpeed = potentiometerValue/4;                     // converts the potentiometer value (0-1023)
// to a range between 0 - 255 for the motor
transistorValue = motorSpeed;                           // Transfer windspeed to motor
Serial.println(transistorValue);
analogWrite(9, transistorValue);                       // Turn the DC motor on

}

About these ads

1 Comment »

  1. If you’re powering the motor off of the Arduino, you’re probably reaching the limits of the current that the Arduino can supply. An external battery pack will probably give the motor plenty of power.

    Comment by jet — February 20, 2008 @ 3:37 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

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

The Rubric Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: