Stepper Motors

3D printer in progress of printing a blue turbine on orange platform

Understanding Stepper Motors: How They Work and Where to Use Them

Stepper motors are a unique type of electric motor designed for precise positioning and repeatable motion control. Unlike regular DC motors that spin freely when powered, stepper motors rotate in discrete steps, making them ideal for applications where accuracy and repeatability are key.

1. What is a Stepper Motor?

A stepper motor is a brushless, synchronous motor that divides one full rotation into a set number of equal steps. Each electrical pulse sent to the motor moves it forward or backward by a single step, enabling precise angular control without the need for feedback.

different types of stepper motors

2. How Does It Work?

Internally, a stepper motor consists of multiple electromagnet coils arranged around a central rotor. Energizing the coils in a specific sequence causes the rotor to align with the magnetic field and rotate step by step.

Types of Stepper Motors

  • Unipolar Stepper Motors
    Feature a center-tapped coil per phase, allowing simpler driving but at the cost of reduced torque.
  • Bipolar Stepper Motors
    Use the full coil without a center tap, requiring an H-bridge driver but offering higher torque.
a bipolar stepper motor from inside

3. Step Angle, Resolution, and Gear Ratios

The angular movement of a stepper motor depends on two main factors: the motor’s internal step angle, and whether it has gear reduction on the output shaft.

28BYJ-48 Stepper Motor Breakdown

The 28BYJ-48 is a geared stepper motor, and its step count depends on both the internal motor and its gearbox.

  • Internal step angle: 11.25° per step
  • Steps per internal revolution: 360° / 11.25° = 32 steps
  • Gear ratio: Approximately 63.68395:1 (often rounded to 64:1)

Total Steps per Output Revolution:

  • Full-step mode: 32 steps × 63.68395 ≈ 2038 steps
    (commonly approximated as 2048 for simplicity in programming)
  • Half-step mode: 64 steps × 63.68395 ≈ 4076 steps
    (often approximated as 4096)

Note: Due to gear backlash and manufacturing tolerances, you may need to calibrate your motor by testing how many pulses it takes to complete a true 360° rotation.

stepper animation

4. Stepper vs. DC Motor

Key differences between stepper motors and DC motors:

  • Rotation Behavior:
    Stepper motors move in discrete steps. DC motors rotate freely when powered.
  • Position Control:
    Steppers offer built-in precision control. DC motors require encoders and closed-loop control.
  • Low-Speed Torque:
    Stepper motors maintain good torque at low RPMs. DC motors often need gearboxes for similar performance.
  • Control Complexity:
    Stepper motors require a driver and pulse signals. DC motors can be driven with simple PWM or voltage.
  • Power Consumption When Idle:
    Stepper motors draw current constantly to maintain holding torque. DC motors typically draw no power when idle.
small brushed dc motor

5. Stepper vs. Servo Motor

Key differences between stepper motors and servo motors:

  • Feedback:
    Stepper motors are open-loop. Servo motors use encoders for closed-loop control.
  • Torque at Speed:
    Stepper motors lose torque at high speeds. Servo motors maintain torque across RPM ranges.
  • Position Accuracy:
    Steppers may skip steps under load. Servos correct for load and position errors automatically.
  • Idle Power:
    Steppers use constant current. Servos use power only when needed.
  • Rotation Limits:
    Steppers can rotate freely. Hobby servos are typically limited to 180°–270°, unless modified.
  • Cost and Complexity:
    Stepper systems are simpler and cheaper. Servos are more advanced but offer better performance for complex tasks.
tower-pro-9g-micro-servo

6. Control Modes

Stepper motors can operate in various stepping modes:

  • Full-Step Mode: One step = one full motor angle step
  • Half-Step Mode: Alternates between one and two energized coils to double resolution
  • Microstepping: Uses PWM to apply partial currents to coils for smooth and precise motion

Microstepping is ideal for applications that require quiet operation and high-resolution control, such as 3D printers.

7. Driving a Stepper Motor

A stepper motor cannot be driven directly from a microcontroller. It requires a driver to handle high current and switch coil phases in the proper sequence.

Common Drivers:

  • A4988
  • DRV8825
  • TMC2209
  • ULN2003 (specifically for unipolar motors like 28BYJ-48)

Drivers typically receive:

  • STEP pin: one pulse = one step
  • DIR pin: determines rotation direction

Libraries like AccelStepper in Arduino allow speed, acceleration, and multi-motor control.

ULN2003-driver-board

8. Applications of Stepper Motors

Stepper motors are widely used in:

  • 3D printers
  • CNC routers
  • Laser engravers
  • Camera sliders
  • Robotics arms
  • Plotters
  • Automated feeders and dispensers
cnc in progress
stepper-motor-used-in-3d-printer.

9. Power Consumption at Idle

Unlike DC motors, stepper motors draw nearly the same current when idle as when moving, because they must remain energised to hold position (holding torque).

Why?

  • Coils stay energised by the driver
  • Most drivers are “chopper” types, regulating constant current
  • Both motor and driver generate heat even when stationary

How to Reduce Idle Power:

  • Use idle current reduction (many drivers support this feature)
  • Use the ENABLE pin to fully disable coils when not needed
  • Lower VREF voltage or apply PWM modulation to reduce holding current
  • Power off the motor (if holding torque isn’t required)

10. Using a Stepper Motor with Arduino: 28BYJ-48 Example

The 28BYJ-48 stepper motor is a great choice for learning. It pairs easily with the ULN2003 driver board.

Required Components

  • Arduino Uno/Nano
  • 28BYJ-48 stepper motor (rated for 5V)
  • ULN2003 driver board
  • Jumper wires
  • External 5V regulated power supply
stepper-and-driver-28BYJ-48

⚠️ Power Warnings

🔌 Don’t Power the Stepper from Arduino

Never a motor to the Arduino’s 5V pin.
Motors can draw more current than the Arduino can safely supply, especially under load, which could cause:

  • Arduino resets or crashes
  • Voltage regulator overheating
  • Permanent board damage

Instead, use a separate 5V power supply (e.g., USB power bank, 5V adapter, or battery pack).

🔋 Match Power Supply to Motor Rating

Even though the ULN2003 driver supports 5–12V input, you must use a power source that matches your stepper’s voltage rating.

For the 28BYJ-48 in our example, that’s 5V.
Supplying 12V will overheat and possibly destroy the motor — the ULN2003 does not regulate voltage.

stepper-motor-voltage-limit

Wiring

  • IN1 → Arduino pin 8
  • IN2 → Arduino pin 9
  • IN3 → Arduino pin 10
  • IN4 → Arduino pin 11
  • ULN2003 VCC → External 5V supply
  • ULN2003 GND → Shared GND with Arduino
  • Arduino GND → Connected to ULN2003 GND

Plug the motor directly into the white 5-pin socket on the ULN2003 board.

Arduino Example Code

1#include <Stepper.h>
2
3const int stepsPerRevolution = 2048; // Simplified, actual value ≈ 2038
4
5Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
6
7void setup() {
8 myStepper.setSpeed(10); // 10 RPM
9}
10
11void loop() {
12 myStepper.step(stepsPerRevolution); // Rotate clockwise
13 delay(1000);
14 myStepper.step(-stepsPerRevolution); // Rotate counterclockwise
15 delay(1000);
16}
17
28BYJ-48 driver and stepper motor in a circuit diagram

Final Notes

  • Use 2048 steps as an approximation — actual value depends on motor
  • Ensure motor and driver share a common GND with Arduino
  • Consider using AccelStepper for smoother acceleration and control
  • Never exceed the rated voltage of the stepper motor

Conclusion

Stepper motors are versatile, precise, and cost-effective, making them a great choice for countless electromechanical projects. With a good understanding of step angles, control modes, gear ratios, and power considerations, you'll be able to implement them effectively in DIY builds or professional systems.

The 28BYJ-48, despite its simplicity and low cost, can deliver impressive results — as long as it’s wired and powered correctly.

Or you can explore other categories

Arduino robot and rover

Electronics

A DIY made aircraft rc model with a transmitter

RC Flight Physics

Children looking into a microscop in turns

Microscopy