9

This might be a simple, silly question, but I am wondering why I can't just connect a DC motor to an arduino board to have it running. One pin to the ground and the other to one of the PWM outputs.

I just did the sweep tutorial for a servo motor http://arduino.cc/en/Tutorial/Sweep and it works fine. I know that a servo has more electronics in there with pot providing feedback.

From what I understand to drive even a small DC motor I would need more circuitry (an H bridge?) or another shield dedicated to driving motors. I can understand this if I was driving some relatively big DC motors.

But I am trying to understand why a small DC motor with a ground and PWM input would not work. Especially for a brushed a motor like this one http://music.columbia.edu/~douglas/classes/motor_mania/DC_simple2.jpg

Surely its just a matter of DC current passing through the wire. Is it the inductive charge building up in the coils that can cause reverse current back to the board thats the problem.

Basically, from a conceptual point, given I have a ground and a voltage (albiet a pulsed one), what do I need to do it to make it drive a DC motor.

Chaitanya
  • 435
  • 1
  • 7
  • 15

4 Answers4

6

It's because of the amount of current you need to drive the motor, the arduino can't supply much.

nick
  • 76
  • 1
  • But I was under the impression that the motor inside a servo is pretty similar to the DC motor above. Clearly the ardunio seems to be able to drive that. – Chaitanya Jul 01 '10 at 13:30
  • 5
    With a servo, the motor is not powered by the Arduino. The Arduino is just providing a low power signal to tell it which way to turn. – Toby Jaffey Jul 01 '10 at 13:38
  • Hang on, when you say "Arduino" you mean the Atmel chip? Cause in the servo tutorial, there is no other power supply. The 5V and gnd are both coming from the arduino board. I take it you mean that the PWM output which is connected to the Atmel chip doesn't provide enough current? – Chaitanya Jul 01 '10 at 14:37
  • Indeed, I do. You're right. The servo power line comes off the Arduino's power supply, the PWM signal comes from an AVR pin. – Toby Jaffey Jul 01 '10 at 14:40
  • I know this is an old thread, but as a follow-up, could I control a large(high torque) servo with the arduino, or would I need to wire it differently? – LoveMeSomeCode Feb 15 '11 at 20:34
6

In addition to what everyone else said, you need protection circuitry to ensure that inductive kickback from the motor doesn't destroy the pins on your Arduino, which will happen eventually if it's not protected.

AngryEE
  • 8,669
  • 20
  • 29
4

As was stated earlier the Arduino PWM pin can not supply/sink the amount of current required to run even a small DC motor. The best way to do it would be to use an H-Bridge between the Arduino and the motor. A less expensive alternative would be to use a power MOSFET that is capable of supplying the current required by your motor. Microchip has an application note that describes these methods of motor control.

Toby Jaffey
  • 28,796
  • 19
  • 96
  • 150
mjh2007
  • 3,899
  • 24
  • 49
4

Do you need by-directional control of your DC motor? If that's the case, I would highly recommend the following circuit (even though you will use up one PWM pin for each direction, you will get more than enough current amplification from your power source that the Arduino cannot provide): alt text http://imagebin.ca/img/CKdfPB6n.png

stanigator
  • 251
  • 1
  • 6