DC Motor

Assignment: DC Motor: Actuation Assignment 1

Collaborators:

Assignment: DC Motor: Actuation Assignment 1
Collaborators:

 

For the homework, I made fan blades and attached them to the motor with wire to use wind as output.  I also added a 'cool' blue light.  If the fan is near the light, the fan interacts with the light.  The potentiometer was again used for input, although I experimented with the photocell with the thought that the fan would be "activated" when the sun was brighter.

 

Materials:

  • Breadboard
  • Arduino
  • Blue LED
  • DC Motor
  • Resistor
  • Diode
  • Transistor
  • Paper
  • Wire
  • Potentiometer

Code

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

* Modified by Heather Dolan
*/

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/6); // Limit the speed
}