Stepper Motors
Stepper motors fall somewhere in between a regular DC motor and a servo motor. They have the advantage that they can be positioned accurately, moved forward or backwards one 'st
Last updated
Stepper motors fall somewhere in between a regular DC motor and a servo motor. They have the advantage that they can be positioned accurately, moved forward or backwards one 'st
Last updated
This tutorial uses a ULN2003A stepper motor driver chip. Other drivers do exist and operate on the same principles e.g L293D or a ULN2803. See the further reading section for a tutorial on these last two
A stepper motor converts electrical pulses into discrete mechanical rotation. That is because when electrical signals are applied, the stepper motor rotates in accurate and fixed angle increments known as steps. The motor consists of 4 coils that make a ring around the rotor. These coils are known as the stator, as they are stationary and static. Each coil is rated at +5V, making it easy to control with any microcontroller, such as an Arduino.
The rotation of stepper motors is incremental, slow and precise, while DC motors have a fast, continuous motion.
Stepper motors are known to generate some noise during operation while DC motors are quiet and relatively vibration-free.
The response time of the stepper motor is slower than the DC motor.
Stepper motors can be easily controlled with microprocessors like the Arduino. Compared to DC motors, they are more mechanically simple and easy to design and build. In contrast, DC motors are not so easily controlled with microprocessors
Stepper motors can move more accurately and precisely than the servo motor and are much easier to control.
Stepper motors are more suitable for applications with lower speeds of less than 2000 rpm (revolutions per minute), and servos are best suited for applications with high speeds greater than 2000 rpm.
Stepper motors operate at lower speeds than servo motors.
Stepper motors are cheaper than servo motors as they are less mechanically complex.
Precise Positioning – Stepper motors move in precise steps. As such, they do well in applications that require precise positionings, such as 3D printers and camera platforms.
Precise Speed control – Precise increments in movements enable excellent control of rotational speed for process automation and robotics.
High Torque at low speeds – Stepper motors are best suited for applications with low speed (less than 2000 rpm) as they have maximum torque at low speeds. In contrast, normal DC motors and servo motors do not have so much torque at low speeds.
Easy to control – Stepper motors can easily be controlled using a microcontroller like an Arduino. In fact, its ease of use has also been a major reason for its continued usage by stepper motor users.
Cheap – In applications where stepper motors would suffice, and using one could help you to realize better cost savings.
A stepper stepper motor consumes high current and hence, we will need to use a driver IC in order to control the motor with a microcontroller like the Arduino.
For example, a stepper motor that needs 9V and 300mA to operate cannot be powered by an Arduino. Hence, we connect this IC to source for enough current and voltage for the motor. If you have to power anything more than 5V and 80mA, a driver board should be used.
Take note that powering the stepper motor directly from the Arduino is not recommended
Known for its high current and high voltage capacity, the ULN2003 gives a higher current gain than a single transistor and enables the low voltage and low current output of a microcontroller to drive a higher current stepper motor.
The ULN2003 is one of the most common motor driver ICs that houses an array of 7 Darlington transistor pairs, each capable of driving loads up to 500mA and 50V. Basically, a Darlington pair is a pair of transistors, where the second transistor amplifies the output current of the first transistor. The ULN2003 IC is needed to drive the motor with an Arduino, but they come in convenient and cheap driver boards that are readily available complete with indicator LEDs. So it’s better to grab one of these rather than breadboarding the IC itself.
As shown in the diagram below, a ULN2003 driver board consists of a ULN2003 soldered onto a board, together with resistors, capacitors, and other bits and bobs that help create the circuit that takes the pulse signals from the controller and converts them into stepper motor motion.
Some boards have a switch / jumper that lets you toggle whether the motor get's it's +5V from the Arduino or an external supply.
Note that the Stepper constructor does not takes the pins in order IN1, IN2, IN3, IN4, but rather IN1, IN3, IN2, IN4.
On the Ariduino Mega I was unable to get the stepper motor working on the purely digital pins 22-53. Not sure why.