Stepper Motor (28BYJ-48) w/ Driver (LN2003AN)

From Xerocraft MakerSpace
Revision as of 17:22, 11 November 2017 by Nimaid (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These little stepper motors allow precise angular control, making them great for small robots. Each stepper comes with a Darlington transistor array on a small driver board, allowing you to control the stepper with an Arduino, or any microcontroller of your choosing.

Stepper Motor with Driver

Arduino Tutorial

Using this with an Arduino is very easy, as the code is already built into the Arduino IDE! To get to it, you simply go to "File>Examples>Stepper>stepper_speedControl". All you have to change is the following line from this:

const int stepsPerRevolution = 200;

To this:

const int stepsPerRevolution = 32;

Next, plug the white stepper motor connector into the white connector on the driver board. It should only fit in one orientation. In order to hook up the pins on the driver to the Arduino, you will need some female-male jumper wires, which can also be purchased from the Xerocraft Electronics Store. Below you will find the schematic to wire up the Arduino for this tutorial. For power, use the barrel connector on the Arduino to plug in a 7-12 volt DC wall adapter.

Stepper Driver Circuit

If you would like to power the stepper using only 5 volts, you can follow the diagram below. Note that the stepper motor will be notably weaker than if you used a higher voltage.

Stepper Driver Circuit Using 5 Volts

Now, you can turn the potentiometer to change the speed of the motor! For a more in-depth tutorial on using the Arduino stepper motor library, check out the official documentation here.