//Define which pin to be used to communicate with Base pin of TIP120 transistor
int TIP120pin = 11; //for this project, I pick Arduino's PMW pin 11
void setup() {
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
}
void loop() {
analogWrite(TIP120pin, 50); //By changing values from 0 to 255 you can control motor speed
}
Although we changed the value in analogWrite to supposedly control the motor speed, it was always running at full capacity.
Below is a video demonstrating the running of the fan:
We tried searching online for tutorials, and here is the original tutorial we were working off of:
http://www.instructables.com/id/Use-Arduino-with-TIP120-transistor-to-control-moto/
Although it was working in their demonstation, we are unsure why the code wasn't working for us in the same way. Some thoughts are that maybe since the code is set to 255 in the demonstration and already working at full capacity that it is unclear whether or not it is being affected by the Arduino.
Some further thoughts we had were the possibility of needing extra parts to actually accomplish this such as a L293D chip, which we don't have. There are many tutorials on running a motor with this type of chip since it can drive the motor. Our other thought is that our transistor is not effectively blocking the current.
Incorporating the code and the PIR sensor into this experiment will be simple since we completed that last week, however the lack of the motor communicating with the Arduino put us at a standstill since we have no other actuators on hand. We are hoping to get some more insight tomorrow in class into a possible way to get this to work!
5/2/12 UPDATE: After going to class and seeking advice to try to get our experiment to work, we realized that the fan has components inside of it with functions we are unaware of due to its modification. We are still unsure if it can be run with the set up that we have due to many unknowns. Our next step if we were to continue the fan experiment further is to purchase a smaller, simpler fan with just two wires instead of three, and continue on as planned with our setup, which should work in theory.
No comments:
Post a Comment