Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
As a PCB engineer who’s designed motor control circuits for over a decade, I’ve tested dozens of stepper motors across various price points. The 28BYJ-48 ULN2003 Arduino combination stands out as the absolute best entry point for anyone learning about stepper motor control. At under $3 for the complete kit, this setup delivers more educational value per dollar than any other motor I’ve encountered.
What makes this combination particularly brilliant for beginners is its plug-and-play nature. Unlike NEMA stepper motors that require current limiting and complex driver configuration, the 28BYJ-48 with its ULN2003 board lets you go from unboxing to controlled rotation in under ten minutes. In this comprehensive guide, I’ll walk you through everything from basic wiring to advanced control techniques, including the critical details that many tutorials skip.
Understanding the 28BYJ-48 Stepper Motor
What Makes This Motor Special
The 28BYJ-48 represents the perfect intersection of affordability and functionality for learning projects. Originally designed for controlling air conditioner vanes and automotive mirror adjustments, this motor has found widespread adoption in the maker community because it does one thing exceptionally well: providing precise, repeatable positioning at minimal cost.
The “28” in the model name refers to the motor’s 28mm diameter body. The motor features a permanent magnet rotor surrounded by electromagnetic coils, operating on the fundamental principle of electromagnetism. By energizing these coils in specific sequences, we create magnetic fields that pull the rotor through discrete steps.
Key Physical Characteristics:
Specification
Value
Engineering Notes
Body Diameter
28mm
Compact design for space-constrained projects
Shaft Type
Double-D (flat on two sides)
Prevents wheel slippage when secured with set screw
Here’s where things get interesting from an engineering perspective. The manufacturer’s datasheet claims a 64:1 gear reduction ratio, giving you 2048 steps per revolution in full-step mode (32 internal steps × 64 gear ratio). However, members of the Arduino community actually disassembled these motors and counted the gear teeth.
The Real Gear Ratio:
The actual gear ratio is 63.68395:1, calculated from the internal gear train:
For most hobby projects, this 0.5% difference won’t matter. But for precision applications like clock mechanisms or long-running position tracking, using 2038 instead of 2048 prevents cumulative positioning errors over time.
Important Note: Some manufacturers produce variants with different gear ratios. I’ve seen 1:16 reduction motors labeled as 28BYJ-48 that deliver only 512 steps per revolution. Always verify your specific motor’s performance if precision matters.
Unipolar vs Bipolar: Why This Motor is Beginner-Friendly
The 28BYJ-48 uses a unipolar configuration, which fundamentally simplifies the driver electronics compared to bipolar stepper motors.
Technical Breakdown:
Inside the motor, you’ll find two center-tapped electromagnetic coils. This center-tap connection allows current to flow through only half of each coil at a time, always in the same direction. The driver simply switches which half of the coil is energized.
Comparison with Bipolar Motors:
Feature
28BYJ-48 (Unipolar)
NEMA 17 (Bipolar)
Winding Type
Center-tapped coils
Single winding per phase
Current Direction
Unidirectional
Must reverse (requires H-bridge)
Driver Complexity
Simple transistor array
Complex H-bridge circuit
Torque Output
Lower (~70% of bipolar)
Higher (full coil utilization)
Cost
$2-3 complete kit
$8-20 motor + $2-5 driver
Setup Difficulty
Beginner-friendly
Intermediate (current limiting required)
This is why the 28BYJ-48 ULN2003 Arduino combination is perfect for learning—you get reliable operation without wrestling with current adjustment potentiometers or risking motor damage from incorrect settings.
Understanding the ULN2003 Driver Board
Why You Absolutely Need This Driver
Many beginners ask: “Can’t I just connect the motor directly to Arduino?” The answer is an emphatic no, and understanding why teaches important lessons about current capacity and motor control.
The Current Problem:
Arduino digital pins can safely source approximately 20-40mA per pin. The 28BYJ-48 stepper motor draws roughly 240mA per phase during operation. That’s six times more current than Arduino can provide. Attempting direct connection will:
Cause immediate voltage drops on the Arduino 5V rail
Trigger brownout resets (the Arduino will keep restarting)
Potentially damage the ATmega328P microcontroller
Create erratic motor behavior and missed steps
The ULN2003 Solution:
The ULN2003 chip contains seven Darlington transistor pairs, functioning as high-current switches. Each pair can handle up to 500mA at 50V—more than sufficient for our motor. The driver board uses four of these pairs, one for each motor coil.
ULN2003 Board Architecture
Pin Configuration Table:
Pin Name
Function
Connection
Voltage Level
IN1
Coil A control
Arduino Digital Pin
5V logic
IN2
Coil B control
Arduino Digital Pin
5V logic
IN3
Coil C control
Arduino Digital Pin
5V logic
IN4
Coil D control
Arduino Digital Pin
5V logic
VCC (+)
Motor power supply
5V power source
4.5-5.5V
GND (-)
Ground reference
Common ground
0V
Motor Connector
5-pin JST
28BYJ-48 motor plug
–
Additional Board Features:
Status LEDs: Four LEDs (one per coil) provide visual feedback showing which coils are energized during stepping. This is invaluable for debugging step sequences.
ON/OFF Jumper: A removable jumper allows you to disable motor power without disconnecting wires—useful for programming and testing.
Protection Diodes: Internal flyback diodes protect against back-EMF voltage spikes generated when coils de-energize.
Darlington Pair Explained
Understanding the Darlington configuration helps you appreciate why this simple driver works so well. Each Darlington pair consists of two NPN transistors connected such that the first transistor amplifies the Arduino’s low current signal, and the second transistor amplifies it again. This double-stage amplification provides current gain typically around 1000×.
Practical Result: A 20mA Arduino output can control 500mA motor current through a single Darlington pair.
Limitation to Know: Darlington pairs have a voltage drop of approximately 1.2-1.5V. This means when Arduino outputs 5V, the motor coil actually receives ~3.5V. For the 28BYJ-48, this reduction doesn’t significantly impact performance, but it’s why we need adequate supply voltage headroom.
28BYJ-48 ULN2003 Arduino Wiring Guide
Complete Connection Diagram
Step-by-Step Wiring Process:
1. Motor to Driver Connection: Simply plug the 28BYJ-48’s 5-pin connector into the matching socket on the ULN2003 board. The keyed connector prevents incorrect insertion—if it doesn’t fit easily, rotate 180°.
2. Driver Control Pins to Arduino:
ULN2003 Pin
Arduino Uno Pin
Wire Color (suggested)
IN1
Digital Pin 8
Red
IN2
Digital Pin 9
Orange
IN3
Digital Pin 10
Yellow
IN4
Digital Pin 11
Green
3. Power Connections:
This is the critical part where beginners often make mistakes.
Option A – External Power (Recommended):
5V Power Supply (+) → ULN2003 VCC
5V Power Supply (-) → ULN2003 GND AND Arduino GND
Arduino 5V → Not connected to driver
Option B – Arduino Power (Learning Only):
Arduino 5V → ULN2003 VCC
Arduino GND → ULN2003 GND
Power Supply Decision Tree
When you can use Arduino 5V:
Single motor operation
Short duty cycles (not continuous running)
Arduino powered by 9V wall adapter (not USB)
Educational testing only
When you MUST use external 5V:
Multiple motors
Continuous operation
Battery-powered Arduino
Production/permanent installations
Any USB-powered Arduino
Recommended External Power Sources:
Power Source
Specifications
Cost
Best Use Case
5V 2A Wall Adapter
5V DC, 2000mA
$5-8
Permanent installations
MB102 Breadboard PSU
Dual 5V/3.3V, 700mA
$3-5
Prototyping on breadboard
USB Power Bank
5V, 1000-2400mA
$8-15
Portable/battery projects
4× AA Battery Holder
6V nominal, step down to 5V
$2-4
Autonomous robots
Critical Rule: Arduino GND and external power supply GND must be connected together. This common ground reference is essential for the ULN2003 to correctly interpret Arduino’s control signals.
Programming 28BYJ-48 ULN2003 Arduino
Using the Built-In Stepper Library
Arduino IDE includes a Stepper library that handles the step sequencing for you. While limited in features, it’s perfect for understanding fundamental concepts.
Basic Control Code:
// 28BYJ-48 Stepper Motor Control – Arduino Stepper Library
// Accurately calibrated for 63.68395:1 gear ratio
#include <Stepper.h>
// Define accurate steps per revolution (32 steps × 63.68395 gear ratio)
Notice the Stepper initialization uses pins in this sequence: 8, 10, 9, 11 instead of 8, 9, 10, 11. This specific order is required to match the motor’s internal coil activation sequence. The library needs coils energized in the pattern: Coil A → Coil C → Coil B → Coil D for proper rotation.
Speed Considerations
The setSpeed() function specifies motor speed in RPM (revolutions per minute). The 28BYJ-48’s mechanical limitations restrict maximum speed to approximately 12-15 RPM at 5V.
Practical Speed Guidelines:
Speed (RPM)
Motor Behavior
Best Use Case
1-5 RPM
Very smooth, quiet
Precision positioning, clock movements
6-10 RPM
Smooth, slight vibration
General automation, camera sliders
11-15 RPM
Maximum speed, noticeable vibration
Fast repositioning (not continuous)
16+ RPM
Unreliable, may skip steps
Not recommended
Advanced Control with AccelStepper Library
For production projects, I strongly recommend the AccelStepper library. It provides acceleration/deceleration, non-blocking operation, and multiple motor coordination.
// Run motor with smooth acceleration/deceleration
while (stepper.distanceToGo() != 0) {
stepper.run(); // This function must be called repeatedly
}
Serial.println(“Position reached!”);
delay(1000);
// Return to starting position
Serial.println(“Returning to home position”);
stepper.moveTo(0);
while (stepper.distanceToGo() != 0) {
stepper.run();
}
Serial.println(“Home position reached!”);
delay(1000);
}
AccelStepper Advantages:
Smooth Motion: Automatic acceleration prevents jerky starts and resonance issues
Non-Blocking: Motor runs in background; Arduino can perform other tasks
Position Tracking: Always knows current position relative to zero point
Multiple Motors: Easily control 2+ steppers simultaneously
Half-Step Mode: Doubles resolution to 4076 steps per revolution
Practical 28BYJ-48 ULN2003 Arduino Projects
Project 1: Automated Camera Slider
Hardware Requirements:
28BYJ-48 motor with ULN2003 driver
GT2 timing belt and pulleys
Linear rail (400mm recommended)
Camera mount plate
Arduino Uno
Application: Time-lapse photography with smooth, repeatable camera movements.
Code Features:
Set slider travel distance in steps
Configure movement duration
Implement pause for shot capture
Return to start position
Project 2: Motorized Curtain Opener
Perfect weekend project for home automation.
Mechanical Setup:
Mount motor to curtain rail
Attach pulley to motor shaft
String connection to curtain
Control Options:
Time-based (open at sunrise, close at sunset)
Light sensor triggered
Remote control via IR sensor
Wi-Fi control with ESP8266 add-on
Project 3: Analog Clock Display
The 28BYJ-48’s precision makes it ideal for clock mechanisms.
Key Considerations:
Use 2038 steps (accurate gear ratio) for precise timekeeping
Account for cumulative error over extended operation
Implement periodic resynchronization
Battery backup to maintain position during power loss
Troubleshooting Common Issues
Problem 1: Motor Vibrates But Doesn’t Rotate
Symptoms: Motor hums/buzzes, LEDs flash, but shaft doesn’t turn.
Causes and Solutions:
Cause
Diagnostic
Solution
Incorrect wiring
Check LED pattern
Verify IN1-4 connections match code
Wrong step count
Motor overshoots
Change from 2048 to 2038 steps
Speed too high
Loud buzzing
Reduce setSpeed() to 5-10 RPM
Insufficient power
Arduino resets
Use external 5V power supply
Code using wrong pins
LEDs don’t light sequentially
Match code pins to physical wiring
Problem 2: Motor Runs One Direction Only
Root Cause: Step sequence inverted or pin order incorrect.
Fix: Reverse two of the motor coil connections or adjust pin order in Stepper() initialization.
Problem 3: Inconsistent Performance
Symptoms: Motor works sometimes, fails randomly, or loses position.
Diagnostic Steps:
Measure supply voltage under load (should stay above 4.5V)
Check for loose connections
Verify common ground between Arduino and driver
Test with fresh power supply (USB can be insufficient)
Problem 4: Motor Overheating
Analysis: The 28BYJ-48 normally runs warm (40-50°C) due to continuous coil energization. However, excessive heat (too hot to touch) indicates problems.
Gear Ratio Calculator: Verify your motor’s actual step count
RPM to Steps/Second Converter: Calculate AccelStepper speed values
Arduino Pin Reference: Quick lookup for pin capabilities
Breadboard Layout Tool: Plan your wiring before connecting
Frequently Asked Questions
1. Can I power the 28BYJ-48 motor directly from Arduino’s 5V pin?
Technically yes, but it’s not recommended for anything beyond initial testing. The motor draws approximately 200-240mA during operation, which is near the Arduino 5V regulator’s limit when powered via USB (typically 500mA total budget). If you’re powering Arduino through the barrel jack with a 9V/1A adapter, you have more current headroom, but it’s still marginal. For any continuous operation, multiple motors, or production use, always employ an external 5V power supply rated for at least 1A. The most common failure mode I see from beginners is inconsistent motor behavior, Arduino resets, and eventually damaging the Arduino’s voltage regulator by running motors directly from the 5V pin while USB-powered.
2. Why does my motor rotation count become inaccurate over time?
This cumulative positioning error typically stems from using the manufacturer’s claimed 2048 steps per revolution instead of the actual 2038 steps. Over many rotations, this 0.5% error accumulates significantly. For example, commanding 100 rotations using 2048 steps/rev means you’re actually commanding 204,800 steps, but the motor physically requires 203,800 steps for true 100 revolutions—you’ll overshoot by about half a revolution. The solution is simple: change your code to use 2038 steps per revolution (or 4076 for half-step mode). For ultra-precision applications like clock mechanisms, consider periodic recalibration against a reference position using a limit switch or optical sensor.
3. How do I control multiple 28BYJ-48 motors simultaneously with one Arduino?
Each motor requires its own ULN2003 driver board and four digital pins for control. Arduino Uno has 14 digital pins (pins 0-13), so theoretically you can control three motors (12 pins) while preserving pins 0 and 1 for Serial communication. Arduino Mega with 54 digital pins can control 13+ motors. For the power supply, calculate total current: each motor draws ~240mA, so three motors need approximately 720mA minimum, recommend 1.5A supply with safety margin. Use the AccelStepper library to coordinate multiple motors—it allows independent speed and position control while managing step sequences efficiently. Create separate AccelStepper objects for each motor with unique pin assignments.
4. What’s the difference between full-step and half-step modes?
Full-step mode energizes one coil at a time (or two coils simultaneously in some sequences), providing 2038 steps per revolution with the 28BYJ-48. Half-step mode alternates between single-coil and dual-coil energization, effectively doubling resolution to 4076 steps per revolution. The advantages of half-step mode include smoother motion with less vibration, finer positioning resolution, and reduced resonance at certain speeds. However, half-step mode provides slightly less holding torque (approximately 70% of full-step) because half the steps use only one coil instead of two. For most 28BYJ-48 applications, half-step mode is preferable due to the smoothness benefit. The AccelStepper library makes implementing half-step mode trivial—just specify AccelStepper::HALF4WIRE when creating the stepper object.
5. My motor works fine for a few minutes then stops responding. What’s wrong?
This classic symptom indicates thermal shutdown or power supply issues. The ULN2003 driver has internal thermal protection that disables output when the chip overheats (typically around 150°C junction temperature). This usually results from continuous high-current operation without adequate cooling or from operating above the motor’s rated voltage. First, verify you’re using 5V supply, not 6V or higher, as the motor is rated for 5V maximum. Second, ensure the driver board has airflow—placing it in an enclosed case without ventilation causes heat buildup. Third, if your application requires continuous operation, consider adding small heatsinks to the ULN2003 chip or implementing a duty cycle (run for a period, pause to cool, repeat). Finally, check your power supply’s actual voltage and current capacity under load with a multimeter—cheap power adapters often sag below their rated specifications.
Conclusion
The 28BYJ-48 ULN2003 Arduino combination represents the perfect entry point into stepper motor control. For under $3, you get a complete system that demonstrates fundamental motor control principles without the complexity and cost of industrial stepper solutions.
Throughout this guide, I’ve shared insights from years of PCB design experience, focusing on the practical details that make the difference between a frustrating experience and successful implementation. The key takeaways are straightforward: use the accurate 2038 steps per revolution, always employ proper power supply practices, and don’t hesitate to upgrade to the AccelStepper library for serious projects.
Remember that while this motor has limitations—relatively low speed, modest torque, and unipolar configuration reducing efficiency—these constraints actually make it better for learning. You’ll understand step sequencing, acceleration curves, and position tracking without getting overwhelmed by current limiting, microstepping configurations, or motor tuning parameters required by professional drivers.
Start with the basic Stepper library examples to understand fundamentals. Once comfortable, transition to AccelStepper for smoother motion and advanced features. Build simple projects first—a rotating platform, automated slider, or analog clock display. As your skills grow, you’ll know when it’s time to graduate to NEMA steppers with A4988 drivers for applications demanding higher torque and speed.
The 28BYJ-48 ULN2003 Arduino system will serve you well through your learning journey and remain useful for countless small automation projects. Its combination of affordability, simplicity, and adequate performance makes it an enduring favorite in the maker community, and understanding its operation provides a solid foundation for working with any stepper motor system.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.