Home · Academy · Robotics & Coding · Sensors and Actuators · What Is a Stepper Motor?

What Is a Stepper Motor?

Learn how a stepper motor turns in precise steps and where it is used.

LESSON COMPASS

What will you use this page for?

Core idea

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.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

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…

Next connection

What Is a Relay?

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteDC Motors and Motor Drivers
ContentStandard lesson · 1,493 words
Last updated

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:

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

Quick comparison table
FeatureDC motorServo motorStepper motor
What it doesSpins freelyTurns to a set angleTurns step by step
Position controlWeakGood (limited angle)Very good (full turn)
Typical angleUnlimited turnsUsually 0–180°Unlimited turns, in steps
Needs a driverYesControl is built inYes
Where usedWheels, fansRobot arm, steeringPrinters, CNC

Which one, and when?

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.

  1. How many steps must the motor take to complete one full turn?
  2. How many steps are needed to turn the motor half a turn?
  3. If the motor took 50 steps, how many degrees did it turn?
  4. 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

Lesson summary

Review questions

  1. What is the key feature that separates a stepper motor from a DC motor?
  2. In a 200-step motor, how many degrees is each step?
  3. What do the STEP and DIR signals of a stepper driver do?
  4. Give two real machines that use a stepper motor.
  5. Why should we never power a stepper motor directly from a board pin?

Answers

  1. Instead of spinning freely, a stepper motor divides its rotation into countable, equal steps, which allows very precise positioning.
  2. Each step is 1.8 degrees (360 ÷ 200 = 1.8).
  3. STEP makes the motor take one step for each signal; DIR sets which direction the motor turns.
  4. A paper printer and a CNC machine (or a 3D printer) are correct examples.
  5. 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?

Start QuizBack to Sensors and Actuators
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.