Motor Shield V1.x FAQ

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Motor Shield V1.x FAQ

Post by adafruit_support_bill »

Note! This post contains information specific to the Adafruit V1.x Motor Shield. Pinout and maximum current information in this post does not apply to the V2 motor shield. For V2 motor shield information, please refer to the V2 Motor Shield Guide: http://learn.adafruit.com/adafruit-moto ... rduino/faq

Motor Selection
What kinds of motors can I run with the Motor Shield?

The motor shield will run:
  • Brushed DC motors
    DC Gear Motors
    Stepper motors
    Standard RC Servos
    Continuous Rotation Servos.
What is the difference?

Brushed DC motors
A brushed DC motor is the most common small DC motor and can be found in everything from toys to tape-decks and battery-powered drills. They typically run at high speeds with relatively low torque. It has 2 leads and the Motor Shield can control the speed in both forward and reverse directions.

DC Gear Motors
A DC Gear Motor is a brushed DC motor with a built-in gear train. These deliver high torque at medium to low speeds. These are typically found in drive-trains for robots and remote-control vehicles. They have two leads and are controlled the same as a regular brushed DC motor.

Stepper Motor
A stepper motor is a specialized type of motor for precise position control. They are commonly found in disk drives and printers. Steppers may have anywhere between 4 and 8 leads and anywhere from 4 to more than 200 steps per revolution. The Motor Shield can control these in single or multiple steps for precise positioning.

RC Servo
RC Servos are another specialized motor for precision positioning. Originally designed for operating Radio Controlled model cars and airplanes, they are now used extensively in hobbyist robotics too. An RC Servo has a 3-wire interface and most can be positioned over a range of 0-180 degrees with a precision of approximately one degree. The Motor Shield has header connections for 2 RC servos.

Continuous Rotation Servo
Continuous Rotation Servos are basically RC servos with the position feedback and limit mechanisms removed (Technically, with no feedback they are not really "servos" anymore.). Although they share the same 3-wire interface as the RC Servos, they have no position control. They function much like DC gear motors with speed control in forward and reverse.

Will my DC motor work with the shield?

The motor shield is designed to work with DC motors between 4.5v to 25v and up to 0.6A stall current.

But my motors are only 3v.

It is possible to get some lower voltage motors to run with the shield, but they will be hard to start and you won't have much speed control.

Low voltage gear-train motors are especially hard to start due to the combination of low starting torque and the gear-train friction. One technique for getting these motors to start is to use a higher voltage power supply. You can give it full power to start, then throttle back to a safe level once it is going. (A bit of light oil on the gear-train doesn't hurt either). If you are having trouble getting your low-voltage hobby gear motors to run, we have 4.5-9v replacement motors that fit many of these drivetrains in the store. http://www.adafruit.com/products/711

Will my stepper motor work with the shield?

The motor shield is designed to work with most unipolar and bipolar stepper motors between 4.5v to 25v and up to 0.6A per phase.

What if my motor needs more current?

Running higher current motors will cause the chip to overheat and shut-down or (in extreme cases) burn out. If your motor needs more than 0.6A, check out the "I Need More Power" section below.

Powering your Motor

What power supply should I use for my DC motors/Steppers?

A power supply needs to supply enough voltage and enough current to drive your motor.

Voltage - For best performance, select a supply voltage 1-2v higher than your motor's rated voltage. There is a 1.2v drop in the L293D H-bridge, so for a 6v motor, the ideal supply is 7.2v.

:!: Note that for voltages higher than 25v, you should replace the 25v capacitors C7 and C8 with higher voltage parts of the same or higher capacitance. The absolute maximum voltage for the H-bridge chips is 36v :!:

Current - Choose a power supply with a current rating equal-to or greater-than the combined current requirements of all the motors you plan to run. More current is normally not a problem (the motors will draw only what they need). But use caution because a short circuit with a high-current supply can cause a lot of damage.

Can I run from batteries?

With the exception of button-cells and rectangular 9v batteries, most commonly available cells have enough current to power motors suitable for the Motor Shield.

AA and C size alkaline or NiMH batteries are great for running motors. You can purchase battery holders for anywhere from 2 to 8 cells and build a pack with the voltage you need.

There are also many rechargeable battery packs of various voltages and capacities designed for RC cars, planes etc that are great for running motors. Just be sure to use the appropriate charger for the pack.

:!: For your safety, a proper charger is essential for charging LiPo packs. :!:

What about 9v batteries?

9v batteries are not suitable for running any but the smallest of motors. They have fairly low capacity for their size and cost and can't deliver very much current either.

But it seems to run fine on a 9v battery.

They might work for a short time, but they will fade quickly. 9v batteries are a frustrating and expensive way to run motors.

Can I use power from the Arduino?

Sharing power with the Arduino works for many smaller motors. With the jumper installed, your motors will get power from the VIN pin. This is the same as what is connected to the DC power jack on the Arduino, so make sure that your motor voltage rating is compatible with the 7-12v supply you are using for the Arduino. (Note - when powering the Arduino via USB, the VIN pin will be at 5v. There is limited power available from USB and this is generally not a good way to run motors)
Power Jumper.jpg
Power Jumper.jpg (188.24 KiB) Viewed 58682 times
Powering motors from the Arduino supply is simple, Just install the power select jumper next to the external power terminals. But for larger motors, or if you experience erratic operation, you should consider using a separate power supply.

Why would I need a separate power supply?

DC motors (including servos) are electrically very noisy and this noise can cause erratic operation of the Arduino processor. These motors also have very high peak current demands that can cause 'brownouts' that will actually reset the processor. The best way to avoid these problems is to use a separate power supply for the motors.

How do I connect an external supply?

(This applies to DC motors and steppers. For servo power supplies, see below.) To use a separate power supply, you must remove the power select jumper. Then connect the power supply leads to the External Power terminals. CAUTION! Double check the polarity before connecting the external supply. Reverse polarity will damage the shield.
External Power.jpg
External Power.jpg (162.69 KiB) Viewed 58682 times
I connected a 6v supply but I only see 4.8v at the motor terminals.

There is typically a 1.2v drop across the L293D H-bridge chip. If you need a full 6v to the motor, you should use a 7.2v supply.

Should I use a separate supply for my Servo?

Most small to medium size servos will run OK on the Arduino supply. But sometimes the servo loads can cause voltage fluctuations that will reset your Arduino. If you have multiple servos, large or high-torque servos, or your Arduino is behaving strangely, you should consider a separate power supply for your servo.

How do I add a separate supply for a Servo?

Check the specifications for your servo for recommended voltages. Cut the trace as shown in the first photo and solder your power supply leads to the adjacent holes as shown in the second.
Cut Trace.jpg
Cut Trace.jpg (147.46 KiB) Viewed 58682 times
Servo Connections.jpg
Servo Connections.jpg (176.22 KiB) Viewed 58682 times
What pins are used by the motor shield?
What pins are available for other uses?


See this post for details on pin usage:

I need more power!

There are several things you can to do to squeeze more power out of your Motor Shield:

Add a heat sink - Heat is what kills chips and a good heatsink will help keep your chips running cooler and allow you to operate around the chip's maximum rating for longer periods of time. Glue-on and clip-on heat-sinks are available for DIP packages. Be sure to use a good thermal adhesive or thermal grease to assure maximum heat transfer. Aavid 5802 clip-on heat-sinks are a good choice.
Heatsink.jpg
Heatsink.jpg (92.47 KiB) Viewed 58682 times
Go socket-less - The L293D is designed to dissipate heat through the ground pins to the PC board ground plane. Soldering directly to the board will give you lower thermal resistance than using a socket. But be forewarned - if you are experimenting with surplus motors, you are bound to blow a chip and wish you had used sockets.

Use an SN754410 - This part is plug-compatible with the L293D, but is rated to 1A continuous/2A peak. There is some debate about whether the output protection diodes are sufficient for kickback protection, but many people have used these chips with no problems.

Piggy Back - Stacking two chips will give you nearly twice the power. Just stack them as shown (both notches at the same end) and solder each pin. More chips are possible - with diminishing returns. Heat dissipation will be the limiting factor.
Piggyback.jpg
Piggyback.jpg (73.81 KiB) Viewed 58682 times
Find a higher voltage motor - Power (watts) is volts * amps. Since current is the limiting factor for most motor controllers, you can get more power by going to a motor rated for a higher voltage. A 24v - 0.5A motor will have twice as much power as a 6v - 1A motor - and the shield will run cooler besides!

Note that for voltages higher than 25v, you should replace the 25v capacitors C7 and C8 with higher voltage parts of the same or higher capacitance. The absolute maximum voltage for the H-bridge chips is 36v

Any combination of the above - You can piggyback SN754410's and add a heat-sink too! The Aavid 5802 clip-on heat sink makes a nice sandwich that can draw heat from both the top and bottom chips. (Don't forget to use thermal compound between the chips & the heat sink)
Piggyback with sink.jpg
Piggyback with sink.jpg (91.85 KiB) Viewed 58682 times
What are the limits?

2A seems to be about the practical limit. At that level, you are exceeding the contact ratings of the sockets and should solder the chips directly to the board. If you really need more power than that, you should consider investing in some higher current controllers.

Troubleshooting:

Servo Doesn't Run:

Is the servo connected correctly?
The yellow wire should be closest to the label.
Servo Connections.jpg
Servo Connections.jpg (176.22 KiB) Viewed 58682 times
Is the sketch using the right pin?
"Servo1" is connected to pin 10. "Servo2" is connected to pin 9.

Motor Doesn't Run:

Is the green LED on?
The green light indicates power to the H-bridges. DC motors and steppers will not run unless the green LED is brightly lit. If it is not on, see "Powering the Motor Shield".

The green LED is on, but dim.
Some H-bridge chips leak enough current from the 5v logic side of the chip to dimly light the LED. If it is not brightly lit, see "Powering the Motor Shield".

Are you getting power to the motors?
Run one of the example sketches and test the output voltage. If the green LED is on and you are not getting any voltage at the output, you probably have a build problem (see below)

Is the motor wired correctly?
See the "Use It" part of the tutorial for information and illustrations on how to connect your motor. http://www.ladyada.net/make/mshield/use.html

Is the code correct?
Test the shield with one of the example sketches first.

Is your build correct?
  • *Compare your board with the photos in the "Make It" part of the tutorial. http://www.ladyada.net/make/mshield/make.html
    *Verify that all parts are in the correct locations and that the notches in the chips are aligned with the silkscreen.
    *Examine the soldering and touch up any joints that are not smooth and shiny, or have not flowed well onto both the pin and the surrounding solder pad.
My program acts strange!
My Arduino keeps resetting!

You are most likely seeing either power 'brownouts" or electrical noise from your DC motors. These can disrupt or even reset the Arduino processor.
  • *Consider a separate power supply if you are not using one already
    *Add noise suppression capacitors to your motor as in the photo below. Use 0.1uF capacitors. One between the two power lugs and one from each power lug to the motor case. Soldering to the motor case can be difficult. It is best to scratch a spot on the surface first with a file or sandpaper.
motor capacitors.jpg
motor capacitors.jpg (71.97 KiB) Viewed 57211 times
It still doesn't work!
There is always help in the forums! Post clear photos of the front and back of the board and describe the problem you are having.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”