Fab Academy 2026 — Week 10

Output
Devices

Stepper motor control system using the DRV8825 driver and a custom XIAO RP2040 board — integrating signal control, power electronics, and mechanical output.

Group assignment documentation
01 / intro

Introduction

This week focuses on controlling output devices using a microcontroller. The objective was to interface and control an electromechanical actuator using a custom PCB developed in previous assignments.

This assignment demonstrates a complete stepper motor control system using the DRV8825 driver and a custom XIAO RP2040 board.

Group assignment documentation →

02 / stepper motor

Stepper Motor

Stepper motor setup
FIG. 01 — Stepper motor setup

A stepper motor moves in discrete steps, allowing precise control of position and speed.

03 / driver

DRV8825 Driver

DRV8825 driver
FIG. 02 — DRV8825 driver

The DRV8825 converts low-power control signals (STEP & DIR) into high-power outputs.

04 / power

Power Supply

Power supply
FIG. 03 — Power supply

A 9V external power supply was used with current limiting at the begnning. Though it was not sufficient therefore it increased to 12V.

05 / protection

Capacitor Protection

Capacitor
FIG. 04 — Capacitor

A 100µF capacitor stabilizes voltage and protects the driver.

06 / wiring

Wiring

Wiring
FIG. 05 — Wiring
MCUDriverFunction
D7DIRDirection
D8STEPStep
GNDGNDCommon Ground
07 / code

Code

Arduino
#include <AccelStepper.h>

#define DIR_PIN 7
#define STEP_PIN 8

AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

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

void loop() {
  if (stepper.distanceToGo() == 0)
    stepper.moveTo(-stepper.currentPosition());

  stepper.run();
}
08 / results

Results

Motor rotated smoothly in both directions confirming correct setup.

09 / video

Video

Stepper motor demo