DESCRIPTION
In this lab, we used a pot to control the rotational speed of a DC motor. After, we switched to an FSR then a photocell to control the rotational speed. Lastly, we attached different materials to the end of the DC motor to explore rotational motion and vibration.
For homework, I built a mini handheld mixer by attaching a “beater” made of aluminum foil to the rotating part of the DC motor. I mounted the motor on a plastic container to serve as the mixer “handle.” I also used the container as a diffuser with a green LED inside, which dims as the rotational speed of the beater slows. A pot was used to control the speed of the mixer/brightness of the LED. Unfortunately, the motor didn’t have a high enough torque to actually mix any fluids.
For my circuit, I chose not to use 2 AA batteries. Instead, I powered my DC motor with the 3.3V supply on my Arduino. I also used a different transistor than provided in the course lab kit. By putting 2 transistors in parallel, I amplified the current provided to my motor. I also noticed that the motor normally needed a little “help” getting started by rotating it with my fingers. This could be because the Arduino supplies a smaller amount of power to the motor than one would get with 2 AA batteries.
COMPONENTS USED
1- Arduino Uno (plus laptop and USB cable)
1- LED
1- 220 Ω Resistor
1- 1 kΩ Resistor
1- 1N4004 diode
2- 2N3904 transistors
1- pot
22 gauge wire
1- breadboard
1- DC motor
CODE
/*
* one pot fades one motor and one LED simultaneously
* modified version of AnalogInput
* by DojoDave <http://www.0j0.org>
* http://www.arduino.cc/en/Tutorial/AnalogInput
* Modified again by dave
*/
int potPin = A0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int ledPin = 3; //select the pin for the LED
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(ledPin, val/4);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}
IMAGES
The attached images show mixer on, mixer off, and my circuit
- Login to post comments