Controlling stepper motors with Arduino
SCHOOL OF MAKING
tepper motors are used in scanners,
ink-jet printers, 3D printers, laser
cutters, CNC machines, robots,
and all kinds of devices where
precisely controlled movement is
required. They’re motors that turn in
set increments, such as a quarter turn, rather than
regular motors which simply continue to rotate while
power is applied. Using this, you can move machinery
a precise distance.
Stepper motors are brushless motors with multiple
coils, so they require additional electronics to drive
and control them. There are two main kinds of
stepper motor: unipolar and bipolar.
UNI VS BI
The main difference between them is the way that
the coil windings are connected. A unipolar motor has
a connection at the centre of each of the two main
windings. This is called a ‘centre tap’ and is usually
connected to the positive voltage. The small 5 V
‘hobby’ unipolar steppers you see on eBay (e.g.
28BYJ-48) usually have five wires – one for each coil
end, and a common wire for both centre taps.
Unipolar steppers can use a simple, cheap
ULN2003 Darlington array chip to protect your
microcontroller and switch the coil phases on and off
in turn, thus rotating the rotor one step at a time.
The main disadvantage of the unipolar design is
that at any given time, only half of each winding
can be energised. This means that both torque
and efficiency are significantly lower than if the full
windings could be used. This is not usually much
of an issue for hobby projects, where cost is often
the deciding factor. A 28BYJ-48 and driver can be
bought on eBay for as little as £1.42, if you’re willing
to wait a few weeks for delivery from China (eBay or
AliExpress). If you’re in a hurry, you can buy locally for
a bit more.
Bipolar stepper motors don’t have centre taps, so
they only require four wires to connect them (the
two ends of each coil). This is a much more efficient
design and gives more torque, but it comes at a
cost. The required drive electronics are a bit more
Make precisely controlled, repeatable movements with steppers and Arduino
Controlling stepper
motors with Arduino
S
Alex Eames
RasPiTV
Alex Eames loves
making things and
regularly blogs/
vlogs at RasPi.TV.
He makes a living
designing and selling
RasP.iO products.
Above
Stepper motors are
available in a range
of shapes and sizes.
They can all be
controlled by Arduino
and driver board