Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Motors & Motion
  4. ›28BYJ-48 Stepper Motor with ULN2003 Driver

How-to · Beginner · 3 min read

28BYJ-48 Stepper Motor with ULN2003 Driver

Wiring and Code

By Geekobot Learning Team · Updated 24 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWiring the ULN2003 boardThe pin order trap: 8, 10, 9, 11Arduino codePower, heat and saving energyWhen to move to a bigger stepperTry itCommon mistakesFAQsParts and next steps
Short answer

The 28BYJ-48 is a small 5 V geared stepper motor sold with a ULN2003 driver board. Wire IN1 to IN4 to four pins, power the board from 5 V that can give about 250 mA, and use the Stepper or AccelStepper library. One shaft turn is about 2048 full steps or 4096 half steps. It is slow, around 10 to 15 RPM, but precise and cheap.

Key specs at a glance

Voltage
5 V (12 V versions exist)
Gear ratio
About 64:1 (exactly about 63.68:1)
Steps per revolution
About 2048 full-step, 4096 half-step
Speed
About 10 to 15 RPM maximum
Current
About 200 to 250 mA with two coils on
Torque
About 300 g·cm (roughly 0.03 N·m)
01

Wiring the ULN2003 board

ULN2003 pinArduino UnoESP32Notes
IN1D8GPIO 19
IN2D9GPIO 18
IN3D10GPIO 5
IN4D11GPIO 17
+ (5 to 12 V)External 5 VExternal 5 VNot the Arduino 5V pin for more than one motor
-GNDGNDCommon ground with the board
Motor socket28BYJ-48 white plugKeyed, plugs in one way
IN1
Arduino Uno:
D8
ESP32:
GPIO 19
IN2
Arduino Uno:
D9
ESP32:
GPIO 18
IN3
Arduino Uno:
D10
ESP32:
GPIO 5
IN4
Arduino Uno:
D11
ESP32:
GPIO 17
+ (5 to 12 V)
Arduino Uno:
External 5 V
ESP32:
External 5 V
Notes:
Not the Arduino 5V pin for more than one motor
-
Arduino Uno:
GND
ESP32:
GND
Notes:
Common ground with the board
Motor socket
Arduino Uno:
28BYJ-48 white plug
Notes:
Keyed, plugs in one way
02

The pin order trap: 8, 10, 9, 11

The Arduino Stepper library energises coils in the order of the pins you give it, and the 28BYJ-48 needs IN1, IN3, IN2, IN4. So wiring IN1 to IN4 to pins 8, 9, 10, 11 means you must declare the pins as 8, 10, 9, 11. If the motor only vibrates or turns one way, this is almost always the cause.

03

Arduino code

The built-in Stepper library is enough for simple moves; AccelStepper adds acceleration and non-blocking control.

Turn one revolution each way (Stepper library) · Arduino C++Verify & upload in Electrolark
#include <Stepper.h>

const int STEPS_PER_REV = 2048;          // full-step mode
Stepper motor(STEPS_PER_REV, 8, 10, 9, 11);   // note the order

void setup() {
  motor.setSpeed(12);                     // RPM, keep under about 15
}

void loop() {
  motor.step(STEPS_PER_REV);              // one turn clockwise
  delay(500);
  motor.step(-STEPS_PER_REV);             // one turn back
  delay(500);
}

// AccelStepper version (half-step, smoother):
// #include <AccelStepper.h>
// AccelStepper m(AccelStepper::HALF4WIRE, 8, 10, 9, 11);
// setup(): m.setMaxSpeed(1000); m.setAcceleration(500); m.moveTo(4096);
// loop():  m.run();
04

Power, heat and saving energy

The coils draw current even when the motor is still, so the motor and the ULN2003 get warm. For one motor, USB power works; for two or more, use a separate 5 V supply of 1 A or more and share ground. When the motor does not need to hold its position, switch all four outputs LOW (for example with digitalWrite to each pin) to cut current to zero. ESP32 and Pico 3.3 V outputs drive the ULN2003 inputs fine.

05

When to move to a bigger stepper

The 28BYJ-48 is slow and has gear backlash of a degree or two, so it cannot drive a 3D printer axis or a fast robot. For more speed and torque, use a NEMA 17 motor with an A4988, DRV8825 or TMC2209 driver; see stepper drivers compared and the stepper motors guide. Advanced users can convert a 28BYJ-48 to bipolar by cutting the red common wire's PCB trace, which roughly doubles the torque with a bipolar driver.

06

Try it: Stepper steps per mm calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Declaring the pins as 8, 9, 10, 11 so the motor just buzzes.
  • !Setting the speed above 15 RPM, which makes it stall.
  • !Powering several motors from the Arduino 5V pin.
  • !Leaving coils energised all day and wondering why it is hot.
  • !Expecting exactly 2048 steps per turn for precise long-term counting; the real gear ratio is slightly different.
08

Frequently asked questions

How many steps per revolution does the 28BYJ-48 have?

About 2048 steps in full-step mode and 4096 in half-step mode at the output shaft. The exact gear ratio makes it about 2037.9 full steps.

Why does my 28BYJ-48 only vibrate?

The pin order is wrong. With the Stepper library and IN1 to IN4 on pins 8 to 11, declare the pins as 8, 10, 9, 11.

How fast can the 28BYJ-48 turn?

About 10 to 15 RPM at 5 V. Faster settings make it miss steps or stall.

Can I use the 28BYJ-48 with ESP32?

Yes. The ESP32's 3.3 V outputs drive the ULN2003 inputs. Power the motor board from 5 V and share ground.

Can an A4988 drive a 28BYJ-48?

Only after converting the motor to bipolar by cutting the trace for the red common wire. Otherwise use the ULN2003 board.

Parts for this guide

  • ULN2003 Stepper Motor Driver Board
    ₹36View
  • Breadboard Power Supply Module (3.3V / 5V)
    ₹71View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Stepper MotorsShop Stepper Motor Drivers

Calculators

Stepper steps per mm calculatorGear ratio calculator

Terms in this guide

StepperA motor that moves in fixed angular steps, allowing precise positioning without feedback.Holding torqueThe torque a powered stepper motor can resist without moving.TorqueTurning force, in N·m or kg·cm.MicrosteppingDriving a stepper motor's coils with intermediate currents to divide each full step into smaller steps for smoother motion.

Projects that use it

Put this into practice: 17 step-by-step builds in our project library use parts from this guide.

Intermediate · 2–3 hoursStepper photo turntableView projectIntermediate · 2–3 hoursAutomatic curtain openerView projectIntermediate · 2–3 hoursStepper-motor dial thermometerView project
Browse all 17 projects

Keep learning

Component guideIntermediateStepper Motors and DriversA stepper motor turns in precise fixed steps, so you can position it accurately without a sensor.4 min read · Motors & MotionComparisonIntermediateA4988 vs DRV8825 vs TMC2209All three are StepStick-size drivers controlled by STEP and DIR pins.4 min read · Motors & MotionComponent guideBeginnerServo Motors GuideA hobby servo is a small motor with a gearbox, position sensor and control circuit that moves to an angle you set with a pulse signal.3 min read · Motors & MotionComparisonBeginnerMotor Drivers ExplainedA motor driver lets a low-power microcontroller control the speed and direction of motors using an H-bridge.4 min read · Motors & Motion

Sources

  • Kiatronics 28BYJ-48 motor datasheet
  • Texas Instruments ULN2003A datasheet
  • Arduino Stepper and AccelStepper library documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWiring the ULN2003 boardThe pin order trap: 8, 10, 9, 11Arduino codePower, heat and saving energyWhen to move to a bigger stepperTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide3 items · ₹156

ULN2003 Stepper Motor Driver Board · Breadboard Power Supply Module (3.3V / 5V) · Dupont Jumper Wires (40 pcs)

Run itChange the inputs and watch the output
Output shaft 41 / 2048

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question