One-sentence summary
A stepper motor is an electric motor that divides its rotation into small, equal steps instead of spinning freely, which lets it position very precisely and which needs a driver to control it.
Why does it matter?
When you power a DC motor it spins, and when you cut the power it stops. But you cannot easily tell exactly how far it turned. This uncertainty becomes a problem when a printer needs to move the paper forward by exactly one line, or when a 3D printer needs to move its head to an exact point.
A stepper motor solves this. It breaks its rotation into steps you can count. If you say "move 50 steps forward," the motor turns by exactly 50 steps' worth of angle. That is why stepper motors are a core part of machines where precision matters.
In this lesson we will learn what a stepper motor is, how it turns step by step, where it is used, and how it differs from a DC motor and a servo motor. We will focus on understanding the ideas; you should always build a real circuit together with an adult.
How does a stepper motor work?
The idea of steps
A stepper motor gets its name from the word "step." Inside it there are small magnets and coils arranged around a shaft. The driver sends current to these coils in a certain order. Every time the current changes, the shaft turns by a tiny angle. That small turn is called a step.
A full circle is 360 degrees. A common stepper motor divides each full turn into 200 steps. In that case each step is 1.8 degrees, because:
360 degrees ÷ 200 steps = 1.8 degrees / step
Counting steps means measuring the rotation. If you know how many steps the motor took, you can work out how far it turned.
It needs a driver
As you learned in the DC motor lesson, a motor needs a motor driver. A stepper motor needs one too, and it is a slightly smarter driver. The driver switches the coils in the correct order and with the correct timing. You send "step" and "direction" signals from your microcontroller (micro:bit or Arduino) to the driver.
A simple stepper driver has two main inputs:
- STEP: Each signal makes the motor take one step.
- DIR (direction): This signal decides which way the motor turns.
Everyday example 1: A printer
A paper printer must move the paper forward by a very small but exactly equal amount for each line. If this movement were slightly different every time, the lines of text would overlap or leave gaps. The printer uses a stepper motor to turn the roller that feeds the paper, so every line shifts by exactly the right amount.
Everyday example 2: CNC machines and 3D printers
A CNC machine and a 3D printer must move a head with precision down to a small fraction of a millimetre. These machines use a stepper motor for each axis. The computer says "so many steps to the right, so many steps up," and the motors turn by exactly that much. In the end, the design on the screen becomes a real object.
DC, servo and stepper motors compared
In earlier lessons you met the DC motor. Now let us compare the three quickly.
Quick comparison
| Feature | DC motor | Servo motor | Stepper motor |
|---|---|---|---|
| What it does | Spins freely | Turns to a set angle | Turns step by step |
| Position control | Weak | Good (limited angle) | Very good (full turn) |
| Typical angle | Unlimited turns | Usually 0–180° | Unlimited turns, in steps |
| Needs a driver | Yes | Control is built in | Yes |
| Where used | Wheels, fans | Robot arm, steering | Printers, CNC |
Which one, and when?
- If you only want something to spin (a car wheel, a propeller), a DC motor is enough.
- If you want to move something to a set angle and hold it (the wrist of a robot arm), a servo motor is a good fit.
- If you want to turn something in very precise, countable steps, a stepper motor is best.
Thinking about steps in code
The examples below are conceptual; real pin numbers depend on the board and driver you use. The goal is to see the logic.
Pseudocode
Start
Set direction to forward (DIR = forward)
Repeat 50 times
Send the STEP signal once
Wait a short moment
End
This pseudocode turns the motor 50 steps forward. On a 200-step motor that is a quarter of a full turn (50 ÷ 200 = 1/4).
Arduino-style example
// Simple stepper motor control (conceptual)
int stepPin = 3; // step signal
int dirPin = 4; // direction signal
void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
digitalWrite(dirPin, HIGH); // direction: forward
}
void loop() {
for (int i = 0; i < 50; i++) { // 50 steps
digitalWrite(stepPin, HIGH);
delay(5);
digitalWrite(stepPin, LOW);
delay(5);
}
delay(1000); // wait, then repeat
}
The code may look different, but the logic is the same: choose a direction, then send as many step signals as you need.
Mini practice
Solve this on paper first; if you are going to run a real motor, do it together with an adult.
Task: You have a 200-step stepper motor. Answer the questions below.
- How many steps must the motor take to complete one full turn?
- How many steps are needed to turn the motor half a turn?
- If the motor took 50 steps, how many degrees did it turn?
- You want to turn the motor a quarter turn in the opposite direction. How would you set the DIR signal and the number of steps?
Hint: One full turn is 360 degrees, divided into 200 steps.
Common mistakes
Powering the motor straight from the board
A stepper motor needs far more current than you can draw from a micro:bit or Arduino signal pin. Never power the motor directly from a board pin. Use a driver and a proper power source instead.
Forgetting the driver
Saying "I'll just wire the signal to the motor" does not work. The microcontroller commands the driver, and the driver runs the motor. Without a driver in between, the motor will not turn and the board can be damaged.
Confusing steps with degrees
"50 steps" is not the same as "50 degrees." First find out how many steps your motor takes in one turn, then do the maths.
Starting too fast
Running the motor at high speed on the first try can cause shaking and missed steps. Start slow, then increase the speed gradually.
Safety note
- The stepper motor's shaft turns; it is a moving part. Keep your fingers, hair and cables away from the spinning shaft and any gears.
- Never power the motor directly from a board pin. Always use a motor driver and a proper power source (a battery pack or the low-voltage supply your board recommends).
- Use only low-voltage, educational power sources (battery, USB, micro:bit, Arduino). Never use mains electricity (a wall socket).
- Motors can get warm after running for a while. If it feels hot, tell an adult before touching it.
- Turn the power off while connecting and disconnecting wires. Check all connections together with an adult.
Lesson summary
- A stepper motor divides its rotation into small, equal steps, which allows very precise positioning.
- One full turn is split into a set number of steps; in a common example, 200 steps make each step 1.8 degrees.
- A stepper motor needs a driver; you guide it with STEP and DIR signals.
- It is used in machines that need precision, such as printers, CNC machines and 3D printers.
- For safety, never power the motor straight from the board; a driver, a proper power source and adult supervision are essential.
Review questions
- What is the key feature that separates a stepper motor from a DC motor?
- In a 200-step motor, how many degrees is each step?
- What do the STEP and DIR signals of a stepper driver do?
- Give two real machines that use a stepper motor.
- Why should we never power a stepper motor directly from a board pin?
Answers
- Instead of spinning freely, a stepper motor divides its rotation into countable, equal steps, which allows very precise positioning.
- Each step is 1.8 degrees (360 ÷ 200 = 1.8).
- STEP makes the motor take one step for each signal; DIR sets which direction the motor turns.
- A paper printer and a CNC machine (or a 3D printer) are correct examples.
- Because a stepper motor draws far more current than a board pin can supply; powering it directly would damage the board. A driver and a proper power source are needed.
Source and verification note
For “What Is a Stepper Motor?”, verification focuses on whether the relationship between How does a stepper motor work? and It needs a driver remains consistent across examples. Sensor readings can change with the model, supply voltage and environment. Thresholds in the lessons are therefore examples; a real project should use a measurement table and calibration.
Next lesson
What Is a Relay?