User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

LAB6: Spirograph!

Submitted by eknight on Wed, 10/15/2008 - 17:14

Assignment: DC Motor: Actuation Assignment 1

Collaborators:

Author: Erin Knight

Description:

This week we worked with a DC motor - our most complicated (and potentially dangerous) circuit yet!

I built a propeller out of pipe cleaner and attempted to build one out of Play-Doh (which kept flying off)

Then I used an off-center cork to explore eccentric motion.  Because the weight of the cork was off center, the motor vibrated and buzzed instead of spinning.

Pictures from Lab:

Homework

Materials:

  • Arduino board
  • 10K resistor
  • Diode
  • Transistor
  • DC motor
  • Battery
  • Potentiometer
  • Cardboard
  • Pencil stubs

I attempted to make a Spirograph.  I attached to pencil stubs to a piece o cardboard with the motor in the middle. The thought was I could make circles on the page and as I moved the tool, the circles would make a spiral.  The pot controlled the speed of the spinning, and thus how close the circles were to one another as I moved the tool.

Code:

/*
* one pot fades one motor
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
*/

int potPin = 0;   // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0;      // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin);    // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}

Pictures:

 

Problems:

Because I had such short wires, I was limited in what I could use as the writing tool.  I wanted to use colored ink, maybe even marker, so that the circles would be more striking...but they were all too long to fit under the wires. I tried pushing them further down but eventually they were too heavy to keep the motor in the cardboard.

But it worked on some level!  And demonstrates how cool motors are!!