ULN2003 & 28BYJ-48 Stepper Motor

7-ch Darlington Sink Driver — .6A@50v peak — Ardu-Serie#61

J3
Jungletronics
5 min readNov 15, 2018

--

Hi, this board has a ULN2003 chip which is a Darlington array.

ULN2003 and 28BYJ-48 Stepper Motor

It’s basically a Toshiba’s ULN2003APG.

That has seven different Darlington pairs inside it:

Darlington pairs circuit is really just a pair of transistors where the second transistor is used to amplify the output current to the first transistor.

The benefit is that we can drive a higher demand current from our stepper motor with the low voltage low current output from our microcontrollers' digital i/o pins. Here we’ll be using an Arduino board (w/ it’s ATMega328p uC inside:)

Now the board itself:

Beyond the chip, there’s also a handy little socket that you can use to just plug your motor right into;

There are four digital i/o pins that you can use to hook up to your microcontrollers — IN1 through IN4 ;

There’s a power supply — in the range of 5 to 12 volts;

There’s even a little jumper that you can remove to break the power circuit to the motor; you could hook a switch up to that if you wanted to have sort of an on/off switch for the motor without affecting the microcontroller.

And then, finally, there are some LEDs with their current limiting resistors; those LEDs are used to visualize which half of a coil is turned on; so if you energize the blue half of the coil the A light turns on; energizes the pink light on the B; the yellow turns on the C and the orange turns on the D so this gives you a handy way to tell which coils are currently being energized on the motor. Note: there are 3 ULN2003 connections not broken for the heads, but we can do engineering and take advantage of these outputs too\o/ These are the three leftovers of the 7 Darlington channels from ULN2003:)

28BYJ-48 Stepper Motor’s coils

What Are The Ways I Can Run This Stepper Motor?

There are 3: Wave Drive, Full Step & Half Step

Use ULN2003 Board like this schema:)

This code below is for Wave Drive: we’re going to fire just a single phase at a time;

When you run this code you will see that one LED at a time lights up; you can pass the wait time to 5 milliseconds and watch the engine running faster. Watch the video if you wish so ;)

Wave Drive is probably the simplest method but it’s likely the least used because the other two methods have some advantages with wave driving again we’re only going to fire a single phase at a time;

Full stepping is going to give me the same step angle as wave driving so I’m going to get the same precision with full step as I do with wave drive but I’m going to get double the torque because with full stepping we’re going to energize two phases at a time so at any one given time slice; here is the code:

The third choice that you have is Half-stepping; with half stepping, we’re going to sort of make a combination of wave driving and full stepping; this is going to give us a little bit less torque than full stepping because half of the time two phases will be energized but half of the time only one phase will be energized so it’s not going to have as much torque as full step; the benefit of half-stepping though is that we’re going to get half the step angle so we get double the precision if you will with half stepping. Here is the code:

Let’s stay here for now. We are hobbyists and we gradually learn the theories, don't we?! If you like it in practice, watch the video, please…

So cheers, my friend:)

You can grab all my code from my GitHub repo Project #61 :)

Download All Files For This Project

Credits & References

Meet DoRobot — Assembly Techniques J3 Caterpillar-Crawler-Chassis v 1.0 — ArduSerie#46

28BYJ-48–5V Stepper Motor datasheet

ULN2003,04APG/AFWG 1 2010–12–03 TOSHIBA Bipolar Digital Integrated Circuit Datasheet

Sparkfun — Motors and Drivers

Stepping Motor Types by Douglas W. Jones from THE UNIVERSITY OF IOWA Department of Computer Science

Related Posts:

Stepper Motors — Precise Position Control -The Great Benefit of Stepper Motors — No-H-Bridge or Closed Loop Needed — Ardu_Serie#51

Meet DoRobot — Assembly Techniques J3 Caterpillar-Crawler-Chassis v 1.0 — ArduSerie#46

L9100S — Toy Driver Easy To Use — Toy-low-voltage-h-bridge-easy-to-use-motor — .8A@12v peak — Ardu_Serie#47

EASYDRIVER: 4-Wire-Stepper Motor DriverBrian Schmalz Design on A3967 IC — Bi-Polar Motors — .75A@30v peak — Making Using These a Breeze! Ardu_Serie#48

DRV8825 — High Current Stepper Motor Driver Carrier — Stepper Motor — Bipolar Mode — 2.5A@45v peak — Ardu_Serie #59

L298N — Dual Full-Bridge Driver — Darlington Transistor Arrays Based — 3A@50v peak — Ardu-Serie#52

TB6612FNG: Dual DC Motor Driver — SparkFun Motor Driver — 3.2A@13.5v peak — Ardu-Serie#49

A4988 — Stepper Motor Driver Carrier — Allegro’s A4988 — Bipolar Stepper Motor Driver — 2A@35v peak — Ardu-Serie#53

Adafruit Motor Shield v1 & v2–4 DC Motors or 2 Stepper Motor or 2 Servos — 1.2A@25v & 3.2A@15v peak — Ardu-Serie#54

IFR 520 MOS — Module + DoRobot — Switch Heavy DC Loads — 10A@100v peak — Ardu-Serie#60

ULN2003 & 28BYJ-48 Stepper Motor — 7-ch Darlington Sink Driver — .6A@50v peak — Ardu-Serie#61

L9110 H-bridge module — DC Stepper Motor Driver Board — .8A@12 v peak — Ardu_Serie#62

BTS7960B- High Current PN Half Bridge — High Current Motor Drive Applications — NovalithIC T M — 43A@24v peak — ArduSerie#64

VNH2SP30 — Monster Moto Shield — Use This Board In Extreme High-Demand Application — Full-Bridge Motor Drivers — 30A@16v peak — 30 Ardu_Serie#63

<reviewed Jan 2024 — minor text fix>

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!