Created by: gwideman, Jan 27, 2015 11:40 pm
Revised by: gwideman, Oct 26, 2016 4:47 pm (31 revisions)

Overview

This article captures some notes on an inexpensive stepper motor with reduction gear which is available in various forms at several vendors, including Adafruit, robotics retailers, eBay from US sellers and from China etc.
Obviously at <$5 these are not intended to be high-precision, high-power motors. Nonetheless, without ballpark specs it's difficult to know where they might be useful. Not finding specs on this motor (at least, specs I believed), I set out to investigate.

Identification

One would think that the part number "28BYJ-48" would identify a specific model, but it does not. There are several different versions associated with this part number. Part of the distinction is made by the voltage rating associated with the motor, either "5V" or "12V". But even for particular voltage ratings, there are different models available with, for example, different winding resistances. There may also be models with different gearing, as the photos below suggest.
As some indication of the variety that might be out there, this site lists seven other models with the same part number, all different from the Adafruit and RioRand ones that I tested:
28byj48_models_table.jpg
(Typical of internet specs: it seems highly unlikely that the several 12V models with different winding resistances will be able to produce the same pull-in torque, so this table is already suspect.)

Starting Point

I looked at the two models from Adafruit, and one model sold under the brand "RioRand".
Note that the Adafruit and RioRand 5V units have indistinguishable part numbers, despite having different gearing and torque specs, as we will see.
Ada_vs_RR_IMAG0435_small.png
(The long number at the bottom of the label appears to be a serial number or date code, as it's different on every motor.)

Mechanical

Stepper motor: The stepper motor itself has 32 steps per revolution.
Gearing: There are different models of motor which genuinely have different gear ratios. But from there, different sites have a variety of incorrect information about the probably limited variety of actual gearing
There are various claims on different websites about the gearing. Adafruit claims either 16.032 or 16.025. In any case, overall 513 steps per turn of the output shaft.

Gearing

Adafruit's catalog picture (Small Reduction Stepper Motor -5VDC 32-Step 1/16 Gearing. made the claimed 16.something gearing seem quite unlikely. This mystery is explained by comparing Adafruit's catalog picture with my picture of the internals of Adafruit's motor, and that of the RioRand motor. It's evident that Adafruit's catalog picture is actually of the model of motor that RioRand (and many other vendors) sells.
Adafruit online catalog photo (as of current writing)
Adafruit internals
RioRand motor
adafruit-858-01-cropped.jpg
adafruit-858-gw01.jpg
RR_topdown_IMAG0438_small.png

Picture of actual Adafruit 858 motor.
RioRand motor looks like Adafruit's catalog picture!

Another view of each motor

Adafruit
RioRand
adafruit-858-gw02.png
IMAG0415_small.png

Actual gearing details

Adafruit gear train
adafruit-gears-gw02.jpg
[Figure corrected 2015-01-28]
RioRand gear train
RioRand_GearTrain.png

Gear trains calculated and compared


1
2
3
4
5
Multiplication

Overall ratio
Required steps per output turn
Adafruit









In
1 motor turn
32
22
16
31
349184


513.0343
Out
9 teeth
11
22
10
1 shaft turn
21780

1/16.032
513 steps 0.999933 turns










RioRand









In
1 motor turn
32
22
26
31
567424


2037.886
Out
9 teeth
11
9
10
1 shaft turn
8910

1/63.68395
2038 steps 1.000056 turns










3. Petr's motor









In
1 motor turn
32
22
27
24
456192



Out
9 teeth
11
9
8
1 shaft turn
7128

1/64
2048 steps 1.0 turns
(Motor #3 added thanks to email from Petr in the Czech Republic, who purchased a "28BYJ-48" from a local internet vendor. Very interesting due to its exact ratio)
Conclusion: These motors share many of the same gears, varying only in one or two of them.

Electrical

The main specs of interest concern the resistance per winding, the consequent current per winding, and the current limit beyond which the motor will get undesirably hot.
These specs are prone to confusion because:
  • There are two winding circuits.
  • As a "unipolar motor", each coil has a center tap, the two center taps are tied together inside the motor and is intended to be the common (V+ pin 5) connection
    • To energize a winding, switch its wire (pins 1..4) to ground.
So, when discussing resistance of a winding, it's important to be clear whether talking about one entire winding, or just resistance from the center tap to one end terminal. In the following table, the resistance figures pertain to a half winding; that is from pin (1..4) to common pin 5.
Vendor
Model
Resistance,
1/2 winding
Adafruit
spec

At PSU volts
Note 1
Current per
half-winding
Total PSU current
Note 2
Adafruit
5V
26 ohm
42 ohm Note 3

5V
165mA
330mA
RioRand
5V
27 ohm


5V
165mA
330mA
Adafruit
12V
90 ohm


12V
125mA
250mA





7V
70mA
140mA





5V
50mA
100mA
Note 1: With typical darlington driver (L293D, ULN2003), driver will absorb about 0.75V-0.85V of the overall supply voltage. So operation with a 5V supply results in about 4.2V across the motor (half) windings.
Note 2: Assumes two half-windings driven at all time. Ie: Four-phase stepping pattern.
Note 3: [As of current writing. Hopefully Adafruit will update.] Adafruit spec doesn't say whether this is for a half winding or a whole winding. Adafruit doesn't list a resistance spec for the 12V model

Driving this motor

ULN2003Breakout-rotcrop.jpgThe default way to drive this motor seems to be with a ULN2003 quad darlington driver, for which there are many cheaply available breakout boards (some with LEDS which are highly convenient for programming), often sold with the motor, as was the case with the RioRand. This driver would be connected via four wires to a controller such as an Arduino, and the sequencing performed by software.
When the motor specs say "513 steps per rotation of the output shaft", this refers to using the four-phase sequence below, where one step corresponds to advancing one row in the table. So, 128.25 cycles of the complete stepping sequence.

ULN2003 driver board comments

Annoyance: This popular driver board has a row of 4 input pins for the four phases, and separately, 2 pins for power, which will probably come from a power source other than the Arduino (or other controller). There is no convenient point to which to attach a ground between the Arduino and this driver board. Other similar driver boards avoid this flaw (do provide a ground pin next to the input signals).
On this board, a work-around would be to solder in an additional header pin for ground at location "IN5", and under the board solder a wire from this pin to a ground trace (for example, pin 8 of ULN2003). Grounding an unused ULN2003 input will have no ill effect.
Explanation of power pins and jumper
Schematic: http://www.uctronics.com/uln2003-stepper-motor-driver-board-p-637.html
  • With jumper absent, the positive supply on pin 2 is routed only to the UNL2003 positive supply pin ("Common").
  • With the jumper installed, the same positive supply gets routed also to the motor common (on the motor socket), and the LEDs.
Vendors who provide an explanation for the jumper say it's to conveniently disable the motor. (Install or remove the jumper only with power down, to avoid transients from the motor inductance damaging the ULN2003.)
The jumper is not, for example, a way to provide separate supplies for the ULN2003 and the motor. That's not needed and will not work properly. See the ULN2003 internal circuitry, notably the protection diode which is the only function attached to the ULN2003 COM terminal.
Pin #
Function
Descr
1
Minus
Power supply ground
2
Plus
Positive power supply for ULN2003, and also the LEDs and motor when the jumper is installed
3
Plus
For use by jumper
4
Motor supply
Use jumper to enable the motor and LEDs (usual case).
Here's the internal schematic for one section of ULN2003, from a TI datasheet:
ULN2003.png
The only connection of the ULN2003 to the plus supply (here marked "COM", as in the common positive supply) is via the protection diode.

Four or Eight phases

There is some discussion that the motor works better when driven with eight phases (alternating 2 windings on, 1 winding on...), but I didn't notice the 8-phase sequence to be an improvement. Indeed, I got the impression that the 8-phase sequence may actually produce less torque, though I didn't explore this exhaustively.

Sequences vs wiring

For four phases, the following sequence works:
bool motorPhases[MOTOR_PHASE_QTY][MOTOR_PIN_QTY] = { // [phase][pin]
// -------- pins ----------
// Winding    A  B  A  B
// Motor Pin  1  2  3  4
// Color      Bl Pi Ye Or
  {           1, 1, 0, 0},
  {           0, 1, 1, 0},
  {           0, 0, 1, 1},
  {           1, 0, 0, 1}
};
And for eight phases:
bool motorPhases[MOTOR_PHASE_QTY][MOTOR_PIN_QTY] = { // [phase][pin]
// -------- pins ----------
// Winding    A  B  A  B
// Motor Pin  1  2  3  4
// Color      Bl Pi Ye Or
  {           1, 1, 0, 0},
  {           0, 1, 0, 0},
  {           0, 1, 1, 0},
  {           0, 0, 1, 0},
  {           0, 0, 1, 1},
  {           0, 0, 0, 1},
  {           1, 0, 0, 1},
  {           1, 0, 0, 0}
};

PWM motor controllers

There are some popular motor controller boards, such as these from Pololu (based on A4988 and similar chips), which are widely used for controlling bipolar stepper motors. These offer clever H-bridge PWM control of stepper current, which allows use with a higher power supply voltage, in turn producing faster rise of current at the onset of each step (hence faster stepping), and also allows microstep positioning. However, those controllers require separate control of the two windings, and are not suited for driving unipolar stepper motors, whose coils are joined by their center taps. The Pololu controllers would thus be unable to control the current to each winding separately.
It probably is feasible to use a Pololu driver with a unipolar motor provided that the driver is not allowed to perform PWM (that is, PWM constantly at 100%). In that situation, the controller would apply unchopped full voltage to each winding in one direction or the other, with the center tap at the midpoint voltage, prompting no (or minimal) current between the windings.
To get the driver to operate at 100% PWM requires adjusting its current-setting potentiometer to max. This will also require using a power supply voltage that is what you intend to deliver to the motor. So, the 5V motor could be used with a 5V supply. The driver will supply 5V across each winding, switching the polarity step by step. All four "winding halves" will be energized, compared to the unipolar four-phase situation energizing only two winding halves at a time. The bipolar controller applies the 5V across each series pair of winding halves, so each half winding sees only half the voltage (and thus half the current) compared to the unipolar case. So the overall power supplied to the motor will be the same.
Most of the benefit of a Pololu-style driver will be lost, since no PWM means no faster stepping, and no microstepping (the latter being pointless given the slop in this motor anyway). However, you still get the benefit of control with only two wires (Direction and Step) instead of four.
Note that most of these controller chips (and breakout boards) require a minimum motor supply voltage of >8V. For use with a lower PSU voltage, see the DRV8834-based ones.

Heat dissipation

Example:
  • The 12V motor with 12V PS: 12V * 0.25A = 3W
  • Ambient temp 73 degrees F
  • Motor stabilized at about 110 degrees F ~= 40F ~= 23C
  • 23C/3W = about 7C/W

Torque measurements

Totorque-measurement-01.jpgrque is relatively difficult to measure, which is apt to permit a proliferation of specs on the web that are incomplete and highly suspect.
I set up a crude apparatus to get a ballpark estimate of torque from these motors, running at different supply voltages.
The apparatus consists of a support for the motor, an arm mounted to the motor shaft, and on the end of the arm (at 10cm from the shaft) a basket into which can be placed weights. I used recent US one-cent coins, which weight 2.5g, and also weighed the various loads on a digital scale.
With this we can make two measurements:
  • Pull-in torque: Max torque that the motor can exert when commanded to advance from one position to the next. To test this, with the arm horizontal we place a load in the basket and command the motor to lift it. We increase the load until the motor misses steps upon lifting.
  • Holding or pull-out torque. With the motor stationary and the arm horizontal, we add weight to the basket until the motor can no longer support it. This is generally a much higher torque value than the pull-in torque.
The torque values will be in units of gram-force * cm (g-f * cm). Since the basket is located on the arm at 10cm from the motor shaft, a 15g weight corresponds to 10*15 = 150 g-f * cm of torque.
I repeated the measurements several times, in both directions (the weight on one or other end of the arm). The results shown below aren't statistically solid (only one 5V and two 12V sample motors), but are perhaps representative, and are certainly interesting to compare to the spec listed by Adafruit.
Note that these are very low speed measurements. At higher speeds, pull-in torque reduces due to there being less time per step for the change in current to "overcome" the winding inductance and reach its full value.

Torque results

All torques in gram-force * cm.
Vendor
Model
PSU V
Pull-in
(step)
Pull-out
(holding)
spec
Pull-in
spec
Pull-out
Adafruit
5V
5V
170-190
950-1050

150







RioRand
5V
5V
740-820
2000 Note 1









Adafruit
12V
12V
370-400
1450-1550

250


10V
310-340
1350-1450




9V
270-300
1200-1300




7V
190-220
900-1000




5V
120-140
690-800









Most notably:
  • Note 1: My test for pull-out get to about 200g x 10cm, and at that point broke teeth in the gear train. See images below.
  • Note 2: Neither Adafruit nor RioRand [as of current writing] list a pull-in spec, a spec which is crucial for actually moving a load.
  • Note 3: Adafruit's spec for pull-out torque is low by a factor of six! That is, the motor is six times more powerful (in holding) than Adafruit says it is.
  • Note 4: Perhaps unsurprisingly, the RioRand 5V motor's pull-in torque was about 4x that of the Adafruit 5V motor, corresponding to the 4x greater step-down gearing.

Broken teeth while testing pull-out torque

RioRand motor. Because the RioRand motor has so much larger a gear ratio, it is able to withstand more torque without pulling out of position. However, the application of this larger torque is evidently too much for the teeth. So the effective maximum torque that it can withstand while holding position is not determined by the pull-out spec of the stepper, but by the tooth strength.
RR_tooth_broken_Gear_4_IMAG0438.png
RR_tooth_broken_Gear_5_IMAG0416.png
Gear 4
Gear 5

Measurement caveats

  • In performing these rudimentary torque tests, it seemed to me that some phases of the motor were stronger than others. For each motor, certain phases or positions seemed consistently to be the ones that produced least torque. This applied to both pull-in and for pull-out tests.
  • It is quite likely that calling upon the gearbox output shaft to exert a lateral force (not purely rotational) introduces some binding friction. (Some lateral force is inevitable if gears are used, as they might be externally, and obviously are internal to the gearbox.) That friction probably works against pull-in torque, and in favor of pull-out torque.

Observations; application suggestions

5V? or 12V motor at 7V?

For applications that involve an Arduino or other small controller board, it is likely that the user will avoid running the motor from the board's +5V supply, but instead will wish to attach it to the upstream +7V or higher supply. It is worth noting that the 12V motor running on the >7V supply provides better torque than the 5V supply on 5V, and at lower current consumption.

Slop

Because of the gear train, there is
  • rotational slop in the position of the output shaft, about +/- 3 degrees (total 6 degrees)
  • in addition to the slop, some rotational "give" under load. For example, for the 12V motor operating with a 12V PSU, a load slightly less than the pull-out torque created an additional rotation of about 9 degrees.
So, although the reduction gearing creates a rotation rate much slower than that of the basic stepper motor, and at a higher torque, it does not create a proportional increase in precision of position. Compare the just-mentioned slop and give figures to the stepping increment of a typical 200-steps-per-rotation stepper (1.8 degrees -- better with a microstepping driver).
Nonetheless, these motors can work quite well to:
  • position light objects, such as in an animated mechanical display like a clock face
  • operate levers or rods (as in a servo) having a consistent load
  • Turn threaded rod, where precise rotational position is of little importance

Other links

Other folks examining 28BYJ-48's: