system
April 15, 2011, 11:19pm
#1
Hey guys-
I have a Tamiya twin motor gearbox, and I know the motor works. When hooking one lead to ground, and one to the +5V pin on the Arduino Uno, it runs just fine.
However, if I try to run it off a single pin, say, Pin 8, nothing happens.
All my code does is set Pin 8 to be high, but the motor won’t spin.
void setup() {
pinMode(8,OUTPUT);
}
void loop() {
digitalWrite(8, HIGH);
}
Can the Arduino pins not provide the current required to spin the motor?
you could drive a transistor with your pin 8 that switches a separate power source.
system
April 15, 2011, 11:24pm
#3
So the arduino pins can't provide the current?
However, if I try to run it off a single pin, say, Pin 8, nothing happens.
The arduino pins can only supply 40ma max. Trying to run a motor off of an arduino pin is somewhat like trying to start your car with a watch battery.
system
April 15, 2011, 11:27pm
#5
Definitely not...you need a "motor driver" to provide bidirectional control over the motor or just a transistor switch for single-direction control.
Start with the "Physical/Mechanical" section of the Playground for some learning links:
http://www.arduino.cc/playground/Main/InterfacingWithHardware#Physical_Mechanical
--
The Rugged Motor Driver : two H-bridges, more power than an L298, fully protected
system
April 16, 2011, 12:33am
#6
Alright, thanks.
I have an Ardumoto Motor Driver Shield from Sparkfun, I've just never used it.
I guess I'll be needing to go to Frys this weekend and pickup some pin headers and the like though.
Thanks for the help again.
system
April 16, 2011, 5:48am
#7
Be aware that you might actually have damaged your Arduino or the pin you used for driving the motor.
You should test it with a LED and suitable current limiting resistor to make sure it still works as expected.