Dr. Ew asks:
Making things move with an Arduino – How do you choose the correct size motor to drive your project? And the correct batteries or power supply to drive that motor.
Ahh…I love hardware questions!
There are a ton of ways to get your Arduino to turn a motor, but choosing the right method can get a bit tricky. In order to get started there are a few things you first want to nail down that will ultimately dictate the approach you take. (BTW there is a awesome overview on motors here)
- What kind of motors do you have available?
- DC motors (High speed)
- Probably the most common and widely available. It operates by spinning a coil of wire (armature) within a magnetic field. These can create a lot of electrical noise, and unless you use an encoder, cannot be positioned. They can be driven in a variety of ways including Transistor, Relay/SSR, Darlington Array, and H-Bridge. Depending on how much torque you require to move your project you can also find some with an attached gearbox.
- A little more complicated the the brushed version. The advantage though is that brushless DC motors do not produce the same amount of electrical noise as the brushed, as they spin a permanent magnet within a controlled electromagnetic field. They can be driven using a transistor array that sequentially cycles the coils. An advantage of this process is that the motors RPM can be easily calculated based on your pulse frequency.
- Stepper motors (Low speed, positionable, high torque at low RPM)
- Contains a series of coils that spin a permanent magnet. Each coil is attached to a common “tap” that is typically attached to the positive side of your power source. These typically have five or six wires and in the case of six-wire motors, the two “tap” wires can be both attached to the same power source. An advantage of the Unipolar motor is that they can be driven by a transistor array, unipolar stepper driver or bipolar stepper driver and have the ability to be driven to a specific angle, allowing for accurate positioning.
- Very similar to Unipolar steppers although their coils do not have a common tap. This type needs to be driven by a stepper driver or H-bridge as the polarity within the coil switches.
- Servo motors (Typically low speed, positionable, high torque, can be made for continuous rotation)
- Works by referencing the position of the output to the position of an internal potentiometer. This allows for very accurate positioning via the control frequency. Arduino has a very easy to use library for this. If you want to use them as a continuously rotating geared motor, you can remove the plastic stop inside the gearbox and decouple the potentiometer. This allows for bi-directional rotation as well as speed control.
- Essentially the same as the analog, but often have higher holding torque
- Super simple and scalable. The attached is a good tutorial that uses the infamous TIP120, although I would recommend a current limiting transistor on the base.
- Transistor Array
- Essentially a prepackaged series of darlingtons as mentioned above. A common one is the ULN2803.
- Allows for CW and CCW rotation of a DC motor. A common one is the L293D. These can also be used to drive a stepper and is a cheap alternative to a stepper driver.
- Allows for isolation between your Arduino and a large electrical load. If you need to move a really big motor, these might be the way to go. These can be used to drive a DC motor both CC and CCW if you use a DPDT relay.
- MOTOR SHIELD!
- Preconfigured for all your needs and might be your best answer. It includes 2 H-bridges (so you can drive steppers or DC motors) as well as servo headers.
- Each motor comes with its own sets of requirements. The maximum operating voltage and current requirements are usually listed on the motor. If they are not, you can easily determine the current draw of your motor by picking a low voltage on your power supply…say 5V…and put a multimeter configured for current sensing in series with the supply. Observe the current draw both with no load and while stalled (stopped). This will give you a good idea as to how you would want to drive it. You could also do your calculations using the motors internal resistance. I=V/R
- Servos can typically sometimes handle up to 7.2V which makes battery configuration easy. 6 x NiMh AA’s or 2 x LiIon packs, etc.
- Oh and make sure you measure the power coming out of a wall-wart as they are usually wrong. Use switching supplies as they tend to be much more accurate.
Next up is Kris with a question about diodes!
Don’t forget, everyone is invited to ask a question!
“Ask an Educator” questions are answered by Adam Kemp, a high school teacher who has been teaching courses in Energy Systems, Systems Engineering, Robotics and Prototyping since 2005.