Learning Goals 5 min
So far in L3 you've met two motor families: servos (precise position, 0–180°, built-in controller) and DC motors (spin freely, speed via voltage, no position feedback). Today you meet the third: the stepper. Steppers don't spin smoothly — they advance in discrete clicks, and you count the clicks to know exactly where they are. No feedback wires, just careful sequencing. By the end of this lesson you will:
- Explain how energising electromagnets in sequence makes a stepper's rotor click round one step at a time, and why not energising them lets the rotor freewheel.
- Tell the difference between unipolar and bipolar stepper motors — both visually (5 wires vs 4 wires) and electrically (centre-tap vs none).
- Define the four numbers that matter for any stepper: steps per revolution, rated voltage, phase current, and holding torque.
Warm-Up 10 min
Pull out a 28BYJ-48 stepper from your kit — the small silver cylinder with a blue cap and a 5-wire ribbon ending in a white plug. It looks tiny, but inside it's a 5-wire unipolar permanent-magnet stepper with a 1:64 reduction gearbox bolted on the front. Together that makes it one of the cheapest classroom steppers in the world.
Feel it by hand
- Hold the stepper's body in one hand and slowly turn the output shaft with your other hand. You should feel small detents — little "clicks" as the rotor settles into its preferred positions. There are many of them per turn.
- Count the detents in one full revolution. (On a 28BYJ-48 you'll feel a lot — the gearbox makes the felt resolution huge. We'll do the maths in §3.)
- Notice the stepper has no torque when no electricity is applied — but it has a clear preferred position when you let go between detents. That's the permanent magnet in the rotor catching on the iron poles of the stator.
Warm-up question
Each detent is a fixed angular displacement. If the motor has 2048 detents per revolution, what angular distance is each detent?
Reveal
360° ÷ 2048 ≈ 0.176° per step. That's about ⅙ of a degree — fine enough to position a needle on a clock face by counting steps, no encoder required. The headline advantage of a stepper.
New Concept · Coils, poles, sequences 25 min
Inside a stepper
A stepper motor has two main parts:
- Rotor: a permanent magnet shaped to have many alternating N and S poles around its rim.
- Stator: a ring of electromagnets (coils wrapped around iron teeth) facing the rotor.
When you energise one coil, its iron tooth becomes magnetic — N or S depending on the current direction. The rotor's nearest opposite pole snaps into alignment with that tooth. Click. To advance one step, energise the next coil around. The rotor's nearest pole snaps to align with the new tooth. Another click. Keep going around the coils in sequence and the rotor turns smoothly (well, click-smoothly).
Two motor families
| Type | Wires | How it's driven | Typical examples |
|---|---|---|---|
| Unipolar | 5 or 6 | Each coil has a centre tap connected to V+. Drive each half of each coil with a transistor to GND. | 28BYJ-48 (classroom); old printer steppers |
| Bipolar | 4 | Two coils, each driven with a full H-bridge so current can flow either way. | NEMA 17 (3D printers, CNCs); modern hobby steppers |
Unipolar motors are easier to drive — a simple transistor on each wire suffices. Bipolar motors are more efficient (each coil is always fully energised, not half) and produce more torque per kg.
The drive sequences (unipolar 4-step example)
A 4-coil unipolar stepper has four control wires plus a centre tap. Number the coils A, B, C, D. Energising one at a time gives the basic wave drive:
| Step | Coil A | Coil B | Coil C | Coil D |
|---|---|---|---|---|
| 1 | ON | off | off | off |
| 2 | off | ON | off | off |
| 3 | off | off | ON | off |
| 4 | off | off | off | ON |
| 5 | ON | off | off | off |
To rotate the other way, run the sequence backwards.
Energising two adjacent coils at a time gives full-step drive — more torque, same number of steps, the rotor sits between two coils:
| Step | A | B | C | D |
|---|---|---|---|---|
| 1 | ON | ON | off | off |
| 2 | off | ON | ON | off |
| 3 | off | off | ON | ON |
| 4 | ON | off | off | ON |
Alternating between "one coil" and "two coils" — eight states total — gives half-step drive: twice the resolution, slightly less torque per step. That's the 4096-steps-per-revolution number you sometimes see quoted for the 28BYJ-48 in half-step mode (its base is 2048 full steps; half-step doubles it).
The four numbers
You'll see these on any stepper datasheet:
| Spec | What it tells you | 28BYJ-48 value |
|---|---|---|
| Steps per revolution | How many full-steps for a 360° turn of the output shaft. (Multiply rotor steps × gearbox ratio.) | ~2048 (full step) / ~4096 (half step) |
| Rated voltage | What voltage to apply to the coils for normal operation. | 5 V |
| Phase current | Current per coil when energised. Sets driver requirements. | ~240 mA |
| Holding torque | Maximum torque the stepper can hold while stopped and energised, before a load forces it to slip a step. | ~300 g·cm (≈ 0.3 kg·cm) |
Note "phase current" vs "total current": a 4-coil unipolar stepper has at most two coils energised at once (full-step), so the total current draw is roughly 2 × 240 mA ≈ 0.5 A while moving.
Why you don't need encoders
The big appeal: you commanded 1024 steps clockwise → the shaft is now 180° clockwise from where it started. Exactly. No measurement needed. Provided you didn't overload the motor mid-move and cause it to skip a step. Once you trust the motor not to slip, you have absolute positional control without any feedback wires.
Worked Example · Maths and a paper sequence 25 min
Example 1 — angle per step
A NEMA 17 stepper has 200 full steps per revolution. What angle does each step represent? What about with half-stepping?
Reveal
360° ÷ 200 = 1.8° per full step. Half-step: 0.9°. (You'll see this on every NEMA 17 datasheet: "1.8°/step".) Microsteppers can drive these at 1/16 or 1/32 steps for ~0.05° resolution — far finer than the mechanical detents can actually hold.
Example 2 — number of steps to a target angle
You want to rotate a 28BYJ-48's output shaft by exactly 90°. How many full steps?
Reveal
2048 steps per revolution × (90 / 360) = 512 full steps. So stepper.step(512) in code. (We'll see the Stepper library next lesson.)
Example 3 — time for one revolution
The 28BYJ-48 can typically be driven at up to 15 RPM reliably. How long does one revolution take? At 2048 steps, what step rate does that imply?
Reveal
15 RPM = 1 rev every 4 seconds. 2048 steps in 4 seconds = 512 steps per second = one step every ~2 ms. That's the timing budget — between two steps you can't do anything that takes more than ~2 ms or the motor will lag. Faster drive rates risk skipped steps because the rotor doesn't have time to physically settle between commands.
Walk through a 4-step sequence on paper
Draw four coils arranged as a clock face: A at 12, B at 3, C at 6, D at 9. Draw the rotor as a small arrow inside. Now apply the wave-drive sequence from §3:
- Energise A → rotor arrow points to 12.
- Energise B → rotor arrow points to 3.
- Energise C → rotor arrow points to 6.
- Energise D → rotor arrow points to 9.
- Energise A again → back to 12, having completed one full revolution in 4 steps.
That's 90° per step in this drawing — not great resolution. Real steppers have many rotor poles, so each "A on" cycle moves the rotor by a small fraction of a degree, not 90°. The 28BYJ-48's internal stepper has ~32 rotor poles (giving ~32 full steps per revolution of the internal shaft), and the 1:64 gearbox multiplies that to ~2048 output-shaft steps per revolution.
Now reverse the drawing
Energise A → D → C → B → A. The rotor turns the other way. Direction = reverse the energise sequence. That's the entire "direction control" story for steppers; no H-bridge needed for unipolar.
Try It Yourself · Five paper questions 15 min
How many full steps does a 28BYJ-48 take to rotate its output shaft exactly 180°?
Reveal
2048 × 0.5 = 1024 steps.
You commanded the sequence A → B → C → D → A and the rotor turned clockwise. Now you want counter-clockwise. What sequence?
Reveal
Reverse: A → D → C → B → A. The energise order determines direction; there's nothing else to change.
The full-step sequence energises two coils at a time; the wave-drive sequence energises one. Which produces more torque, and why?
Reveal
Full-step produces more torque: two coils contribute, the rotor sits between them and feels pull from both. Wave drive uses ~half the current draw, but ~half the torque. Most code defaults to full-step for that reason.
A mystery stepper has four wires of colours blue, red, green, black. You measure: blue ↔ red = 30 Ω, green ↔ black = 30 Ω, all other pairs = open circuit. Is it unipolar or bipolar? How many coils?
Reveal
Two coils — one between blue/red and one between green/black. No centre taps (which would show as a third wire with half the coil resistance). So it's bipolar with two coils — needs an H-bridge per coil to reverse current direction. A NEMA-17-style motor is the classic example.
You drive a 28BYJ-48 (rated max 15 RPM reliable) at 2 ms per step. Does the math actually allow 15 RPM, or are you cutting it close?
Reveal
15 RPM = 0.25 rev/s × 2048 steps/rev = 512 steps/s = 1.95 ms per step. So at 2 ms/step you're at 14.6 RPM — comfortably inside the rated maximum. At 1.5 ms/step you're at 20 RPM, well into "may skip steps" territory; the motor will sometimes stall or whine instead of advancing.
Mini-Challenge · Identify your motor's spec sheet 10 min
- Look at the 28BYJ-48 you have. Find its datasheet (search "28BYJ-48 datasheet").
- Write down its four key numbers in your notebook: steps per revolution (note both full-step and half-step values), rated voltage, phase current, holding torque.
- Open the L298N datasheet you used in Cluster B. Could the L298N also drive a 28BYJ-48? (Hint: the L298N is two H-bridges. The 28BYJ-48 is unipolar. Yes you could wire it, but it's overkill — the ULN2003 we'll use tomorrow is much better matched.)
- Sketch a small diagram in your notebook of which wire colour goes to which coil. The 28BYJ-48's convention (and the colour of the wires from the white plug): Red = common (+5 V), then Orange = A, Yellow = B, Pink = C, Blue = D. Bring this to next lesson.
Recap 5 min
A stepper motor advances in discrete clicks — "steps" — by energising electromagnetic coils in sequence. Two flavours: unipolar (5–6 wires, transistor per coil) and bipolar (4 wires, H-bridge per coil). The headline benefit: count the steps, know the angle, no encoder needed. The four numbers from any datasheet: steps per revolution, rated voltage, phase current, holding torque. The 28BYJ-48 — our classroom stepper — is unipolar, 5 V, 240 mA per coil, 2048 steps per revolution thanks to its internal gearbox. Tomorrow we wire it up to its purpose-built driver, the ULN2003 — the cheapest and most common stepper driver in the world.
- Stepper motor
- A motor that advances in discrete angular steps by energising stator coils in sequence. Used where precise positioning matters and an encoder would be awkward.
- Step / detent
- One discrete angular advance of the rotor. Felt as a small "click" when you turn the shaft by hand.
- Steps per revolution
- How many steps to rotate the output shaft 360°. Includes any internal gear reduction. 28BYJ-48 = 2048, NEMA 17 = 200.
- Unipolar stepper
- A stepper with a centre tap on each coil (5 or 6 wires total). Drives each coil's halves with transistors to GND. Simpler driver, slightly less efficient.
- Bipolar stepper
- A stepper with two coils and no centre tap (4 wires). Requires an H-bridge per coil to reverse current. More efficient, more torque, more complex driver.
- Phase current
- Current drawn by one coil while energised. Sets the driver's current rating.
- Holding torque
- The maximum torque a stepper can hold while stopped and energised before a load forces it to slip.
- Wave drive / full-step drive / half-step
- Three control schemes. Wave: one coil on at a time, less torque. Full-step: two adjacent coils on, more torque. Half-step: alternates between the two, twice the resolution.
- Skipped step
- A commanded step that the motor failed to perform — usually because the load exceeded the holding torque, or the step rate was too fast. Silent and accumulates as a position error.
- Microstepping
- A driver technique that interpolates between full steps by varying the coil currents, giving sub-step resolution. Quality bipolar drivers (DRV8825, A4988) do 1/16 or 1/32 microsteps; cheap unipolar drivers can't.
Homework 5 min
- Photograph your 28BYJ-48 + ULN2003 pair side by side. Label each: the motor, its 5-wire ribbon, the driver board's 4 LEDs, the IN1–IN4 header pins, the +5 V / GND pins, the motor's plug receptacle.
- Look up two real-world uses of steppers and write a sentence each about why a stepper is the right choice there: 3D printer X/Y motion, CNC routers, ATM cash dispensers, camera focusing in DSLRs, microwave turntables.
- Skim ARD-L03-12 (28BYJ-48 + ULN2003). Tomorrow we wire and verify the "walking lights" pattern on the driver board's LEDs — your first visible stepper sequence.
Bring back next class:
- Your annotated photo.
- Your two real-world stepper examples.
- The 28BYJ-48 + ULN2003 + 4 × AA pack (separate supply for the motor; do not power it from the UNO's 5 V).