xtk01
May 31, 2015, 6:40am
1
Help!! I am using Arduino Uno.
With this simple code:
void setup() {
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
}
void loop() {
}
I successfully turned on a LED.
However, when I try to use it on a DC motor like this:
I failed. The motor generates some nosie but it does not spin at all.
Then I pushed it a little with my hand, and it started to spin very slowly..
However, when I removed the cable from pin 9 to 5V, the motor started to spin at full speed.
Anyone help? Thanks!
You can't provide enough current from the Arduino digital pin.
You need to control it through a transistor, as shown here , which also shows the so-called fly-back diode.
MarkT
May 31, 2015, 11:32am
3
Also you should never connect directly to an inductive load without protection
circuitry, inductive loads (coils, relays, motors) can produce destructive voltage
spikes if not protected against.
Arduino output current absolute maximum: 40mA
Typical small motor stall current: ~1000mA
See the issue?