Maker.io main logo

Controlling a 28BYJ-48 Stepper Motor with ULN2003 Driver

229

2026-06-22 | By Rachana Jain

License: Attribution Non-commercial Stepper Arduino

Stepper motors are widely used when accurate positioning and controlled movement are required. In this project, I interfaced the popular 28BYJ-48 5V stepper motor with an Arduino Uno using the ULN2003 driver module and explored different operating modes and speed control.

The 28BYJ-48 is one of the most beginner-friendly stepper motors available and is commonly used in robotics, automation, camera sliders, CNC mechanisms, and educational projects.

Project Objectives

  • Understand the working principle of a stepper motor.

  • Learn the difference between full-step and half-step operation.

  • Interface the 28BYJ-48 stepper motor with Arduino.

  • Control motor direction and rotational speed.

  • Calculate the number of steps required for one complete revolution.

Components Used

Arduino Uno

28BYJ-48 Stepper Motor

ULN2003 Driver Module

Jumper Wires

External 5V Power Supply

Understanding Stepper Motor Operation

Unlike a DC motor that rotates continuously, a stepper motor moves in small angular increments called steps. The rotation is achieved by energizing the internal windings in a specific sequence.

Changing the sequence of coil activation determines the direction of rotation:

  • Clockwise rotation → IN1 → IN2 → IN3 → IN4

  • Counter-clockwise rotation → Reverse sequence

Because movement occurs in discrete steps, stepper motors provide excellent positioning accuracy.

Operating Modes

1. Full-Step Mode (Single Coil Energized)

Only one winding is activated at a time.

Advantages

  • Lower power consumption

  • Reduced heat generation

Disadvantage

  • Lower torque

2. Full-Step Mode (Two Coils Energized)

Two phases are energized simultaneously.

Advantages

  • Maximum torque

Disadvantages

  • Higher current consumption

  • Increased vibration

3. Half-Step Mode

Alternates between one-phase and two-phase excitation.

Benefits

  • Smoother motion

  • Better resolution

  • Reduced vibration

The 28BYJ-48 commonly operates in half-step mode, providing 4096 steps per revolution.

About the 28BYJ-48 Stepper Motor

The 28BYJ-48 is a 5V unipolar permanent magnet stepper motor with an integrated gearbox that improves torque.

Key Specifications

  • Operating Voltage: 5V

  • Coil Type: Unipolar

  • Number of Phases: 4

  • Stride Angle: 5.625°

  • Gear Reduction Ratio: Approximately 64:1

  • Full-Step Resolution: 2048 steps/revolution

  • Half-Step Resolution: 4096 steps/revolution

Why Use the ULN2003 Driver?

The stepper motor requires more current than an Arduino pin can supply directly.

The ULN2003 driver board acts as an interface between the Arduino and the motor and contains seven Darlington transistor arrays, capable of driving loads up to 500 mA.

ULN2003 Driver

Important pins on the module:

  • IN1–IN4 → Control inputs from Arduino.

  • VCC → 5V supply.

  • GND → Common ground.

  • Motor connector → Connects directly to the 28BYJ-48.

Note: Ensure that the power jumper on the ULN2003 board is installed.

Step Calculation

The internal rotor requires 32 steps for one revolution.

Since the gearbox has a reduction ratio close to 64:1:

32 × 64 = 2048 steps

Therefore:

  • Full-step operation → 2048 steps/revolution.

  • Half-step operation → 4096 steps/revolution.

Hardware Setup

Stepper Motor with Arduino Uno Circuit Diagram

  1. Connect a regulated 5V power supply to the VCC and GND pins of the ULN2003 driver module.

  2. Connect the driver's control inputs IN1, IN2, IN3, and IN4 to Arduino digital pins 7, 6, 5, and 4, respectively.

  3. Plug the 28BYJ-48 stepper motor into the motor connector on the ULN2003 board.

  4. Connect the ground of the external 5V supply to the Arduino GND pin to establish a common reference.

After completing these connections, the Arduino can control the motor's speed and direction by energizing the motor coils in the appropriate sequence through the ULN2003 driver.

Applications

This type of stepper motor is suitable for:

  • Robotic systems

  • Camera sliders

  • Pan-and-tilt mechanisms

  • Small CNC projects

  • Automated valves

  • Educational motion control experiments

  • Precision positioning systems

Conclusion

This project demonstrates how easily the low-cost 28BYJ-48 stepper motor can be controlled using an Arduino Uno and a ULN2003 driver module. By understanding stepping sequences, gear reduction, and speed calculations, precise rotational control can be achieved for a wide range of automation and robotics applications.

Acknowledgement

This project is based on work originally published on PlayWithCircuit, where a more detailed explanation, diagrams, Arduino examples, and complete code walkthroughs are available.

Original article:

https://playwithcircuit.com/28byj48-stepper-motor-arduino-tutorial/

Play with Circuit focuses on practical electronics, Arduino, embedded systems, and hands-on engineering tutorials for students, hobbyists, and makers.

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.