User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Top Spin

Submitted by agreiner on Wed, 10/15/2008 - 20:40

Assignment: DC Motor: Actuation Assignment 1

Collaborators:

Assignment: DC Motor: Actuation Assignment 1
Collaborators: agreiner

Description

Gesture toward the top, and see it spin. This project uses a photocell to take input from the user and a DC motor to spin the top. The top, being metallic, adheres readily to a magnet that is hot glued to a plastic gear, which is in turn press-fit onto the drive shaft. You can spin anything that sticks to the magnet, and it's easy to switch. You can even sandwich a paper "top" between the magnet and another magnet.

Materials

Arduino board
breadboard
wires
battery pack with switch
1k resistor
10k resistor
transistor
zener diode
90-degree metal mounting bracket
rubber band
photocell
plastic gear
magnet

Arduino code

/*
* one photocell fades one motor
* motor with metal top tends to spin faster and faster, even at constant voltage,
* so this program only puts a relatively small amount of energy in when the user's hand
* covers the photocell. When the user moves their hand away, the top begins to slow.
* Annette Greiner 10/15/2008
*/

int potPin = 0;   // select the input pin for the photocell
int motorPin = 9; // select the pin for the Motor
int val = 0;      // variable to store the value coming from the sensor
int background = 0; //variable to store initial light reading, to work in all conditions
void setup() {
Serial.begin(9600);
background = analogRead(potPin);    // read the background light value from the sensor
}
void loop() {
val = analogRead(potPin);    // read the value from the sensor, 0 - 1024
Serial.println(val);
if(val < (background - 40)){ //you blocked enough light to make the top spin
analogWrite(motorPin, 64); // analogWrite can be between 0-255. We don't want too much.
}
else analogWrite(motorPin, 0);//stop increasing speed when light input goes up
}

 

Failed Experiment

Description

This was intended to be a Very Lazy Susan. I got a cheap (very, very cheap) lazy susan, glued a plastic gear to the bottom of it, and press fit a similar gear (but much smaller) to the motor. I used a rubber band as a belt drive, attempting to take mechanical advantage to turn the lazy susan. Alas, Susan was lazier than I thought. Though I succeeded in setting up the complete output side of the project, the torque required to turn the lazy susan was more than the motor could handle, even with the favorable gearing. The motor could easily spin when the rubber band was off, but it could not push that darn Susan anywhere. It simply whined about being asked to do so. I was planning to hide a force sensor under a placemat. The user would just have to grab a fork in a fist and press the end down on the sensor ("me want food!") to initiate turning the dish of food on the lazy susan.

Materials

Arduino board
breadboard
wires
1k resistor
transistor
zener diode
battery pack with switch
two 2x1x12 pieces of wood, nailed together
one scrap wood piece (motor mount)
rubber band
plastic gear
potentiometer
two nails
two screws
incredibly cheap lazy susan

Arduino code used in testing

/*
* 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
}