Noob here. If I plug in my DC motor into 5V and GRD, it will run. However, plugging the DC motor into GRD and an Arduino pin and then using digitalWrite(dc_pin, HIGH), the motor will not spin. It will spin if I set up the DC motor with a transistor and control the transistor with an Arduino pin. Why is this? Is the Arduino pin not giving out 5V when set to high?
What I was hoping to do is this: Plug both ends of the DC motor into Arduino pins. Then set one pin to HIGH and one to LOW, making the motor spin. Then I would switch the first pin to LOW and the second pin to HIGH, reversing the direction that the motor spins. Any reason why this wouldn't work?
420gandhi:
Noob here. If I plug in my DC motor into 5V and GRD, it will run. However, plugging the DC motor into GRD and an Arduino pin and then using digitalWrite(dc_pin, HIGH), the motor will not spin. It will spin if I set up the DC motor with a transistor and control the transistor with an Arduino pin. Why is this? Is the Arduino pin not giving out 5V when set to high?
Stop doing this as your damaging the Arduino pins. The UNO cannot supply the current out need to drive the motor and as stated can deliver a MAX of 40mA on a pin but think more like >20mA continuous draw to prevent long term damage.
in fact, almost all I/O pins are able to supply <15mA, but 100mA in total for all I/O pins.
so lats say 100/50=2mA
for Arduino Mega it is the same, 40mA max, and 150mA total maxumum for all I/O pins.....so you can connect LED with current 20mA, but you cannot connect these LEDs to 10 pins, because it would be 10 * 20 = 200mA