ULN2003 Stepper Motor Driver with 28BYJ-48 motor

The 28BYJ-48 is a 5 volt stepper motor that is available cheaply  eBay. They normally come complete with a  ULN2003 Stepper Motor Driver board. This board has two power connections and four connections (IN1 to IN4) for the motor windings. For a number of reasons this motor will not run smoothly using the standard Arduino stepper motor driver library and after much searching on the internet I found a number of useful sites.

Neil Kenyon’s blog here goes into some depth on the inner workings of this motor and suggests an idea for  ‘end stops’ to ensure the motor starts in the correct position.This is an idea well worth implementing, for example I intend to make an Ultrasonic Radar (SONOR?) and need to make sure the Ultrasonic unit always scans the same area.

Stepper Motor Wiring

Neil Kenyon suggests using  AccelStepper but I felt this was a little over the top for what I wanted. I need to specify the number of steps, the direction of rotation and the speed of rotation. The first sketch I came across was at 4Tronix which used no library, but eventually I found the code for a simple library at engyfun.blogspot. This site listed the code for a simple library and a small sketch, I have packaged all the files into a standard library page that is available on m GitHub page here. My example sketch has expanded the original sketch to allow easier control from within a sketch.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: