Stepper motors are used in many applications that need high torque and determine positioning precisely such as; 3D printers, CNC machines, DVD players, and much more.
So, In this tutorial, you will learn how to control 28BYJ-48 Stepper motor with Arduino using ULN2003 Drive which is the most common driver used with the 28BYJ-48 motor.
In addition, you will learn everything you need to know about the 28BYJ-48 Stepper motor, how it works, the pinout, the datasheet, and of course the code at the end of this tutorial.
but before that, Let’s talk about the 28BYJ-48 module a little bit.
28BYJ-48 Stepper Motor
A Stepper motor is a DC motor that rotates in discrete small (steps), this type of motor is recognized as having high torque at low speed in addition it can determine positioning in a very accurate way which makes it the ideal choice for many applications: robotics, CNC machines, automation, 3D printer, and DVD players.
There are many types of stepper motors but in this tutorial, we will talk about the 28BYJ-48 stepper motor which is a small, low-cost stepper motor that is used in many small-scale robotics and Arduino projects.

One of the main characteristics of this Motor is the speed variation ratio (1/64) which we will talk about it after a while, and this motor is a uni-polar stepper motor with (34.3 mN.m) torque and (15 RPM) speed at 5V rated voltage.
The 28BYJ-48 stepper motor is commonly used with a ULN2003A driver which we will talk about it in this tutorial.
Stepper Motor Pinout
Let’s take a look at the 28BYJ-48 stepper motor pinout in this picture down below which have a 5-wire.

Coil 1 – Coil 4: These 4 coils are used to control the logical sequence (step sequence).
5V: This pin is used to supply the stepper motor by 5V.

The 28BYJ-48 stepper motor consists of two coils, each of these coils has a center tap, and these 2 center taps are connected internally.
Stepper Motor Speed Variation Ratio
The speed variation ratio is one of the most important aspects you need to consider when using a 28BYJ-48 stepper motor, this motor can rotate 32 steps per revolution (11.25° for each step).
The speed variation ratio for this module is (1/64), which means there are 2048 steps required to complete one full rotation of the shaft which is called steps per revolution, We have got this number by multiplying 32 and 64 (32×64=2048).
Stepper Motor Specifications
If you want to know more technical specifications for the 28BYJ-48 stepper motor take a look at the table down below.
Rated voltage | 5VDC |
Number of Phase | 4 |
Speed Variation Ratio | 1/64 |
Stride Angle | 5.625° /64 |
Frequency | 100Hz |
In-traction Torque | 34.3mN.m(120Hz) |
Pull in torque | 300 gf.cm |
Insulated electricity power | 600VAC/1mA/1s |
Stepper Motor Datasheet
Do you want to learn more details? You can read the stepper motor datasheet.
28-BYJ48 stepper motor datasheet
The file down below is the 28-BYJ48 stepper motor datasheet you can download it.
ULN2003 Motor Driver
The 28BYJ-48 stepper motor can’t be controlled by Arduino directly, because it’s a high current consumed. so we need another controller to drive it, so the ULN2003 driver IC is the best choice.

The ULN2003 driver contains ULN2003 IC, this IC consists of 7 pairs of high-voltage, high-current Darlington transistor arrays, each of these pairs is capable to drive a load up to 500mA and 50V. This board is used to drive stepper motors, relays, and other high-power devices.
The ULN2003 driver includes 4 input pins for controllers like Arduino and Molex connector to connect the motor Easily, moreover, it has 4 Led’s to indicate the stepping state, as well as an ON/OFF jumper which is used to isolate the power to the motor.
ULN2003 Motor Driver Pinout
Now let’s take a look at the ULN2003 Motor Driver Pinout in this picture down below and talk about it in detail.

IN1 – IN4: These pins are used to control the motor, we will connect them with the Arduino digital output pins.
Motor Connection: These pins are used to connect the motor.
GND: This pin is common ground.
VCC: This pin is used as a power supply for the motor, so we need to connect it to a 5V power supply but be aware, you shouldn’t use the 5V power from the Arduino.
ULN2003 Motor Driver Datasheet
Do you want to know more technical details about this drive? This file down below is the ULN2003 Motor Driver Datasheet you can download it.
Stepper Motor With Arduino
Now let’s connect the stepper motor with Arduino, but before that, you need to know all the required parts.
Parts Requirement
- Arduino Uno
- 28BYJ-48 stepper motor
- ULN2003 driver board
- (5V) power supply
- Hook-up wires
Interfacing Stepper Motor With Arduino Usnig ULN2003 Motor Driver
To interface the stepper motor with Arduino you need to connect digital output pins (7, 8, 9, 10) in the Arduino with (IN1, IN2, IN3, IN4) pins in the ULN2003 driver, then connect the 5V power supply to the VCC for the ULN2003 driver, and finally connect the common GND for power supply, ULN2003 driver and Arduino together.
Take a look at this picture down below to see all the details.

Stepper Motor Fritzing
This is the stepper motor Fritzing file you can download it.
Stepper Motor Arduino Code
Finally, this is the 28BYJ-48 Stepper Motor Arduino Code so you can use it in your project. with this code, you can control the motor to rotate at different speeds continually clockwise and counter-clockwise.
You don’t need to download any library, you can use the Arduino Stepper Library which comes with Arduino IDE.
#include <Stepper.h> //To Include the Arduino Stepper Library
const int STEPS_PER_Revolution = 2048; //To Define the Number of steps per rotation which is (32x64=2048)
//To Create an instance of Stepper Class
//The Pins entered in this sequence IN1 - IN3 - IN2 - IN4 (for proper step sequencing)
Stepper stepper_motor = Stepper(STEPS_PER_Revolution, 7, 9, 8, 10);
//There is nothing to do (Stepper Library will set all pins as outputs)
void setup() {
}
void loop() {
//To Rotate 1 turn clockwise slowly
stepper_motor.setSpeed(5);
stepper_motor.step(STEPS_PER_Revolution);
delay(1500);
//To Rotate 1 turn counter-clockwise quickly
stepper_motor.setSpeed(10);
stepper_motor.step(-STEPS_PER_Revolution);
delay(1500);
}
Frequently Asked Questions
Is The 28BYJ-48 Bipolar Or Unipolar?
The 28BYJ-48 is a (unipolar) stepper motor with (34.3 mN.m) torque and (15 RPM) speed at 5V rated voltage.
Are Steppers AC Or DC?
A Stepper motor is a DC motor that rotates in discrete small (steps), this type of motor is recognized as having high torque at low speed.
What Is Max Speed Of 28BYJ-48?
The maximum speed for the (28byj-48) stepper motor is about (10-15) rpm.
What Is The Main Purpose Of A Stepper Motor?
The main purpose of a stepper motor is to determine positioning in a very accurate way as well as having high torque at low speed which makes it the ideal choice for many applications: robotics, CNC machines, automation, 3D printer, and DVD players.
At the end of this tutorial, we need to thank you, we hope you find everything you need about controlling 28-BYJ48 stepper motor with Arduino using ULN2003 driver.
ROBOSANS is the ideal place to start your learning journey with a concise Arduino tutorial and straight to the point.
Do you want to learn more about motors? read these articles down below.
Interfacing L298N Motor Driver With Arduino & DC Motor
Interfacing and controlling a servo motor with Arduino
Sources: