Description
In this lab, we used DC motors as output. This involved building a more complicated circuit which included a transistor and diode. We also tried attaching eccentric weights to the motor to create vibrations.
For the homework, I experimented with lots of different propeller materials and eccentric weights but ultimately decided on something very simple. I placed a small aluminum pie tin on the motor and elevated it slightly off the table using a small jar as a stand. The potentiometer controls how fast the tin rotates. If you put something in the tin and turn up the speed, the object will fly out. This is useful if you want to flip a coin or roll a die.
Alternatively, you can throw things into the spinning tin and try to catch them as they fly out in random directions. You can throw popcorn or goldfish into the tin and try to catch them in your mouth. Or you can throw a ping pong ball in the tin and work on your reflexes and catching abilities.
Components Used
1- Arduino UNO
1- breadboard
1- potentiometer
1- DC Motor
1- diode (1N4004)
1- transistor (TIP120)
1- 1k ohm resistor
1- battery case
2- batteries
1- small pie tin
1- small jar
wires
Code
/*
* This is the provided code from class:
* 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
*
* Sydney Mayes, Fall 2013
*/
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
}
- Login to post comments