How to Use 28byj48 Stepper Motor with Arduino :

In this guide, we’ll walk you through everything you need to know about using the popular 28BYJ48 stepper motor with an Arduino, including wiring, code, and real-world applications. One of the most precise and affordable ways to achieve controlled movement is by using a stepper motor.

How to Use 28BYJ-48 Stepper Motor  with Arduino

Why Use a Stepper Motor?

Unlike regular DC motors, stepper motors rotate in fixed steps, allowing for precise control of angle, speed, and direction—perfect for applications like:

  • Smart Curtain Systems
  • CNC Machines
  • Robotic Arms
  • Camera Sliders
  • 3D Printers

What is a 28BYJ-48 Stepper Motor?

The 28BYJ-48 is a small, cheap, and widely used unipolar stepper motor ideal for beginners. It’s commonly found in printers, scanners, DVD drives, and automation projects.

Key Specifications:
  • Voltage: 5V DC
  • Reduction Ratio: 64:1
  • Steps per Revolution: 2048 (for full 360° rotation)
  • Current: ~240mA
  • Torque: ~34 mNm

The motor comes bundled with a ULN2003 driver module, which makes it easy to control with an Arduino.. 28byj48 can move 2048 steps per revolution. 28byj48 used with UNL-2003 stepper motor driver.

28BYJ-48 Stepper Motor

What is ULN2003 Driver Module?

The ULN2003 board acts as an interface between the Arduino and the stepper motor. It contains Darlington transistor arrays to amplify the control signals and protect your Arduino from overcurrent. UNL2003 is a stepper motor driver. Using this driver we can control stepper motor. It has 4 pins (IN1,IN2, IN3, IN4). By using these pins we can control the speed, direction and steps.

ULN2003 Motor Driver Pinout:

  • IN1–IN4: Control signals from Arduino
  • Stepper Motor Socket: Connects to 28BYJ-48 via 5-pin JST connector
  • +5V and GND: Power for the motor
  • Power LED and Step LEDs: For visual feedback
What is ULN2003 Driver Module?

Components needed for Connecting 28BYJ-48 Stepper Motor :

  • Arduino Board (Uno, Nano, Mega, etc.)
  • 28BYJ-48 Stepper Motor
  • ULN2003 Driver Board
  • Jumper Wires
  • Breadboard (optional)
  • External 5V Power Supply (optional but recommended)

Circuit Diagram for Connecting 28BYJ48 Stepper Motor with Arduino:

ULN2003 PinArduino Pin
IN18
IN29
IN310
IN411
VCC5V (or external)
GNDGND
MotorConnect 5-pin motor cable to socket

Important: If the motor stalls or gets hot, use an external 5V supply to power the motor, not directly from the Arduino’s 5V pin.

Circuit Diagram for Connecting 28BYJ48 Stepper Motor with Arduino

Installing the Stepper Library

To control the stepper easily, we’ll use the built-in Stepper.h library.

Steps:

  1. Open Arduino IDE.
  2. Go to Sketch > Include Library > Stepper.
  3. If not present, you can also use third-party libraries like AccelStepper for advanced control.

Code for 28BYJ48 Stepper Motor:

#include <Stepper.h>

// Define number of steps per revolution
const int stepsPerRevolution = 2048;

// Define motor control pins
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11); 
// (IN1, IN3, IN2, IN4) sequence

void setup() {
  myStepper.setSpeed(10); // RPM
  Serial.begin(9600);
  Serial.println("28BYJ-48 Stepper Motor Test");
}

void loop() {
  Serial.println("Clockwise Rotation");
  myStepper.step(stepsPerRevolution); // One full rotation
  delay(1000);

  Serial.println("Counter-Clockwise Rotation");
  myStepper.step(-stepsPerRevolution); // Reverse
  delay(1000);
}

28byj48 Stepper Motor with Arduino Video Tutorial:

Applications of Stepper Motor:

You can use the 28BYJ-48 with Arduino in:

  • Automated blinds or smart curtain systems
  • Safe or lock mechanisms
  • Precision robotic movements
  • Mini conveyor belts
  • Camera or sensor rotation mounts

Troubleshooting of 28byj48 Stepper Motor with Arduino:

ProblemSolution
Motor not rotatingCheck wiring sequence: IN1→8, IN2→9, IN3→10, IN4→11
Motor jitters or vibratesCheck power supply; consider using external 5V
Motor too slowUse setSpeed() to increase RPM (10–15 is safe for this motor)
Motor overheatingDo not hold the motor in a stalled position for long

Conclusion:

The 28BYJ-48 stepper motor is an incredibly affordable and beginner-friendly motor that opens the door to precise motion control in Arduino projects. Combined with the ULN2003 driver board and some simple code, you can start building real-world applications that move!

At ArduinoExpert.com, we always recommend this motor for anyone starting with automation or robotics. Stay tuned for future posts where we’ll show how to control this motor with a joystick, sensors, or even wirelessly!

Need Help in Setup of 28byj48 Stepper Motor with Arduino?

If you need any Help or Assistance for Setup of Stepper Motor 28byj48 with Arduinowith Modifications or Customization then you can contact us through WhatsApp. We can deliver you this Project in the Following Ways.

Learn More about the services we offer.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
YouTube
× Contact us