Stepper motors are DC motors that move in discrete steps. They have multiple coils that are organized in groups called “phases”. By energizing each phase in sequence, the motor will rotate, one step at a time.
A stepper motor has the following characteristics:
A stepper motor can move in accurate angular increments knows as steps in response to the application of digital pulses to an electric drive circuit from a digital controller. The number and rate of the pulses control the position and speed of the motor shaft. Generally, stepper motors are manufactured with steps per revolution of 12, 24, 72, 144, 180, and 200, resulting in shaft increments of 30, 15, 5, 2.5, 2, and 1.8 degrees per step.
Stepper motors are either wired bipolar or unipolar.
4 Wire (= Bipolar) 2 phase 4 coils (per phase) stepper motor
This style is common in smaller unipolar motors. All of the common coil wires are tied together internally and brought out as a 5th wire.
5 Wire (= Unipolar) 2 phase 4 coils (per phase) stepper motor
The 8-wire unipolar is the most versatile motor of all. It can be driven in several ways:
Let’s have a look at how to drive stepper motors, starting with the bipolar stepper motor.
We can use a single H bridge circuit to drive a simple DC motor. By reversing the polarity (= reversing the direction of current flowing through the coil) we can make a motor spin both clockwise or counterclockwise.
We need to use two H-bridge circuits (dual H-bridge) to drive both coils of a bipolar stepper motor.
The field effect transistors (FET) Q1 to Q4 act like switches. The diodes D1 to D4 act like freewheeling diodes to channel back-electromagnetic force (back-EMF) of the motor coils. When the ‘switches’ Q1 and Q4 are closed (and Q2 and Q3 are open) a conducting path is created and current will flow from +9Vdc to Q1 to the coil to Q4 to GND. By opening Q1 and Q4 switches and closing Q2 and Q3 switches, a different conducting path is generated from +9Vdc to Q2 to the coil to Q3 to GND. If you pay close attention you will notice the current flowing through the coil in the opposite direction, allowing reverse operation of the motor.
Note however the switches Q1 and Q2 should never be closed at the same time, as this would cause a short circuit. The same applies to the switches Q3 and Q4. This is why we cannot simply use Arduino HIGH and LOW outputs to reverse the polarity; a H-bridge circuit is essential.
A popular driver board is the L298N dual H-bridge board:
Another popular bipolar (+unipolar) driver board is the EasyDriver board based on an Allegro A3967 dual H bridge chip.
http://www.schmalzhaus.com/EasyDriver
Let’s have a look at unipolar stepper motors next. Remember, unipolar stepper motors have bifilar wound coils that make these motors simple to drive (no reverse polarity required) at a cost of reduced torque.
Note: The “common” leads (a,b) will always have the same voltage (i.e. GND). The other leads (1a, 1b, 2a 2b) are then switched on and off in a logical sequence.
Note that the ULN2003A inverts the logical inputs. By connecting the common lead to +5V…+30V instead of GND we can counteract this logic inversion.