Skip to main content

Quick Start

Getting a stepper turning takes three things: a logic connection to your controller, a separate supply for the motor, and a current limit set to suit the motor you have. Do the current limit first, before the motor ever turns, so the coils are never asked to carry more than they are rated for. The procedure is on Hardware Details.

The examples here use the NULA DeepSleep ESP32-S3 as the controller. Any board with five spare digital pins and 3V3 or 5V logic works; only the pin numbers change.

You program the controller connected to this breakout. The breakout itself is not flashed.

1. Connect the breakout board​

RESET and SLEEP both have to sit high for the driver to run, and both have internal pulldowns, so an unconnected board stays in reset and asleep. The Arduino library never touches them. Tie them to 3V3 and leave them there.

ControllerStepper Motor Driver DRV8825 Board
GNDGND (the pad next to FAULT)
3V3RST
3V3SLEEP
IO5STEP
IO4DIR

Motor power is separate and does not come from the controller:

Motor supplyStepper Motor Driver DRV8825 Board
8.2 V to 45 VVIN
GNDGND (the pad next to VIN)

Put a capacitor across the motor supply at the board. The MicroPython module's own example notes this; check your motor's datasheet for the value.

2. Install the library​

Install Soldered Basic Stepper Driver Arduino Library using the Arduino IDE Library Manager, or download it from the source below.

🔗Soldered Basic Stepper Driver Arduino Library

AccelStepper-based Arduino library by Soldered

→

Tip: downloading from GitHub. On the library's GitHub page, click the green Code button and choose Download ZIP, then add it in Arduino IDE with Sketch → Include Library → Add .ZIP Library....

3. Run the first example​

This is ConstantSpeed.ino with one change: the shipped sketch is constructed with the FULL4WIRE default, and this board needs BasicStepper::DRIVER with your STEP and DIR pins. Nothing else differs.

Select Board
ConstantSpeed.ino
#include <Basic-Stepper-Driver-SOLDERED.h>

#define dirPin 4
#define stepPin 5

BasicStepper stepper(BasicStepper::DRIVER, stepPin, dirPin);

void setup()
{
stepper.setMaxSpeed(1000);
stepper.setSpeed(200);
}

void loop()
{
stepper.runSpeed();
}

4. Check the result​

The motor turns continuously in one direction at 200 steps per second, which is about one revolution per second on a 200-step motor in full step. There is no serial output, so watch the shaft.

If it buzzes or judders instead of turning, runSpeed() applies no acceleration and the motor may not be able to start at that speed under load. Lower setSpeed() until it turns, then work back up.

5. If it does not work​

Continue with Troubleshooting and retry this smallest example after each change.