9
\$\begingroup\$

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.

\$\endgroup\$

4 Answers 4

6
\$\begingroup\$

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

\$\endgroup\$
5
  • \$\begingroup\$ 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. \$\endgroup\$
    – Chaitanya
    Jul 1, 2010 at 13:30
  • 5
    \$\begingroup\$ 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. \$\endgroup\$ Jul 1, 2010 at 13:38
  • \$\begingroup\$ 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? \$\endgroup\$
    – Chaitanya
    Jul 1, 2010 at 14:37
  • \$\begingroup\$ 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. \$\endgroup\$ Jul 1, 2010 at 14:40
  • \$\begingroup\$ 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? \$\endgroup\$ Feb 15, 2011 at 20:34
6
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

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

\$\endgroup\$
1
  • 2
    \$\begingroup\$ image link is broken \$\endgroup\$ Mar 15, 2011 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.