Contents
- Brief introduction
- Design ideas
- Why build this motor driver expansion board?
- Why this design idea?
- Basics of 5-wire 4-phase stepper motors
- Basics: step angle, gear ratio and supply voltage
- Basics: advantages of stepper motor drive modes — half-step drive
- Basics: stepper motor drive modes — two-phase drive
- Basics: stepper motor drive modes — single-phase drive
- Detailed description
- Tests
Brief introduction
Domino series: I2C bus unipolar stepper motor expansion board. Supports up to 2 stepper motors connected per board, controlled over the I2C serial communication interface.
Board features shown: I2C communication interfaces, a direct-plug interface for the main control board, channel index markings (CH Index 0123 and 4567), Type-C power supply, terminal-block power supply, and a supply voltage input of 5 to 24 V.

The I2C bus unipolar stepper motor expansion board uses a compact design. It works plugged directly into a XIAO-series main control board or on its own, and up to 16 modules can be cascaded. The board carries a ULN2003 Darlington driver chip (500 mA per channel / 2.5 A per chip) and can drive 5-wire 4-phase stepper motors such as the 28BYJ-48 (wide 5-24 V supply). It provides three drive modes (single-step, full-step and half-step), and has dual solid capacitor voltage regulation, reverse-connection protection and visual status indicator LEDs, combining stacking expansion with high reliability.
We provide MicroPython example code with thorough exception detection, supporting independent control of multiple motors.

Design idea: a unipolar stepper motor only needs switch control. The ULN2003 is a high-current Darlington transistor array, which acts as a power amplifier for the waveforms output by the PCA9685 chip. By setting different PWM duty cycles, the PCA9685 controls the on and off state of the different ULN2003 inputs. It can be used as an expansion board or as a standalone module, and it belongs to the Domino series of expansion boards that support XIAO main controllers.
Design ideas
Why build this motor driver expansion board?
Almost all common I2C motor expansion boards use the main control board to control a separate PWM chip over the I2C communication interface. The PWM chip generates multiple PWM signals and passes them to a TB6612 motor driver chip, which drives 42-size stepper motors.
For the 5-wire 4-phase unipolar stepper motor that beginners use to get started, there is no module with a similar standardized interface. The 28BYJ-48 stepper motor with a ULN2003 motor driver board has these problems:
- It occupies many pins
- Beginners must pay attention to the wire order when wiring
- It is inconvenient to test after it is made
- There is no foolproof (anti-misconnection) design
Motors compared: 42-size bipolar stepper motor; 28BYJ-48 5-wire 4-phase stepper motor.
A unipolar stepper motor generally has four coil windings and usually 5 or 6 pins (the middle common terminal is connected to the power supply, and the remaining four control the four coils). By energizing the coils in turn in a certain order, the step direction and step angle (single-step or half-step mode) of the stepper motor can be controlled.
Wire colours and coils: 1. Blue, Coil 4; 2. Pink, Coil 2; 3. Yellow, Coil 3; 4. Orange, Coil 1; 5. Red, +5V.
A unipolar stepper motor only needs switch control. The ULN2003 is a high-current Darlington transistor array that acts as a power amplifier for the waveform output by the PCA9685 chip. The PCA9685 controls the on and off state of the different ULN2003 inputs by setting different PWM duty cycles. When the OE pin is needed, simply remove R12.
Why this design idea?
In terms of function and pin count, the PCF8574 8-bit IO expansion chip seems more suitable. But the design follows the I2C DC motor driver board made earlier:
- Hardware design continuity: the PCB layout of the previous motor driver board (such as power supply filtering and I2C bus design) is reused, which reduces hardware changes.
- Software development efficiency: the same PCA9685 driver code is used, with no change to the low-level driver.
- Production considerations: it shares chip inventory with the previous I2C DC motor driver board (PCA9685 has already been bought in bulk), and it reduces the number of component types in stock.
Barrel effect: when designing multiple modules, consider the overall optimum. We do not pursue the ultimate length (performance) of a single board (module), but make sure that all boards (production, supply chain, development, market) work together to reach the system optimum.
The previously made I2C DC motor driver board is compared with the I2C stepper motor driver board made now.
Basics of 5-wire 4-phase stepper motors
Basics: step angle, gear ratio and supply voltage
This mainly covers 5-wire 4-phase stepper motors (for example 28BYJ48, 35BYJ46, 35BY412L).
- Step angle: the angle a stepper motor turns for each pulse signal received, one of the core parameters of a stepper motor. The standard step angle of a 5-wire 4-phase motor is 11.25 degrees. Taking the common 64:1 reduction as an example (the stepper motor turns 64 times and the geared output shaft turns once), the step angle becomes 11.25/64 degrees.
- Gear ratio: when a stepper motor has a gearbox, the ratio of the output shaft speed to the actual motor speed. The common gear ratio of 5-wire 4-phase stepper motors is 64:1 or 16:1, and that of the 35BY412L is 4:1.
- High gear ratio (such as 64:1): large output torque, low speed, small equivalent step angle, high precision.
- Low gear ratio (such as 16:1): small output torque, high speed, large equivalent step angle, low precision.
- Supply voltage: the power supply voltage that drives the stepper motor; it directly affects motor performance and heating. The common supply voltage of 28-size stepper motors is 5 V or 12 V, and that of 35-size stepper motors is 12 V or 24 V. Raising the voltage improves high-speed torque, but too high a voltage makes the coils heat up.
Basics: advantages of stepper motor drive modes — half-step drive
- Single-phase and two-phase drive are used alternately (A→AB→B→BC→C→CD→D→DA→A...).
- The step angle is halved (for example from 1.8° to 0.9°) and the resolution increases.
Half-step drive
Advantages:
- Resolution is doubled, with finer movement
- Smooth running at low speed, with minimal vibration
- Suitable for high-precision scenarios (such as 3D printing)
Disadvantages:
- The control algorithm is complex
- Torque is uneven (torque is lower on single-phase steps)
- Power consumption is between single-phase and two-phase
Basics: stepper motor drive modes — two-phase drive
- Two adjacent coils are activated at the same time each step (AB→BC→CD→DA→AB...).
- The rotor is attracted by the combined magnetic field of the two coils. The step angle is the same as single-phase drive, but the torque is greater.
Advantages:
- About 40% more torque than single-phase drive
- Runs more smoothly, with less vibration
- The most versatile and most commonly used
Disadvantages:
- Power consumption is 2 times that of single-phase
- More heat is produced
Basics: stepper motor drive modes — single-phase drive
- Only one coil is activated at a time, energized in sequence (A→B→C→D→A...).
- The rotor is always attracted by one coil, and the step angle is the motor's inherent step angle (such as 1.8 per step).
Advantages:
- Simple circuit, lowest power consumption
- Suitable for low-speed, light-load scenarios
- Little heat
Disadvantages:
- Small torque (only one coil works)
- Large vibration, easy to lose steps
- Does not run smoothly
Detailed description
We provide two I2C communication interfaces. When the board is used as a standalone module, connect the main control module and the expansion board with a PH2.0 cable, as shown below:
Connection: use a PH2.0-4P cable (SCL, SDA, +5V, GND).
You can also plug the main control board directly into the female header interface of the expansion board:
Shown with a Seeed Studio XIAO RP2040 main control board.
The PWM expansion chip address bits can be set by soldering the short-circuit points on the back of the expansion board. Note that all four address bits must be soldered; by default the address bits are floating:
PWM output chip address bit selection, shown with A3A2A1A0 = 1010.
You can power the board with a Type-C power adapter (note the maximum current of the adapter; a 15V 3A adapter is recommended), or use the terminal block, with the power positive connected to V and the power negative connected to G, as shown below:
Power supply options: Type-C power supply, terminal-block power supply.
All four control channels of the stepper motor drive have indicator LEDs, connected to VCC through 4.7K pull-up resistors. When a channel conducts, the corresponding LED lights up:
Indicator circuit channels: 1B-, 1A-, 1B+, 1A+ and 2B-, 2A-, 2B+, 2A+.
We use a 220uF solid capacitor as the voltage regulation element. A solid capacitor has low equivalent series resistance and fast charge release, and a lower impedance to high-frequency signals, so it filters high-frequency noise more efficiently. Compared with a traditional electrolytic capacitor it has more stable performance at high temperature and a longer service life. Together with a 100nf small capacitor it stabilizes the voltage for the Darlington chip, quickly removing the transient interference when the Darlington chip (ULN2003) switches, which suits applications where the stepper motor starts and stops frequently:
Power protection circuit: 220UF and 100nF capacitors.
This expansion board uses an XH2.54-5P interface to connect a 5-wire 4-phase unipolar stepper motor (such as the 28BYJ-48). This standardized interface is compatible with the common 5-wire 4-phase stepper motors on the market. The common terminal (red wire) must be connected to the motor power supply, as shown below:
Wire colours: red is the common terminal, orange is A+, yellow is B+, pink is A-, blue is B-. The board can only be used to drive 5-wire 4-phase unipolar stepper motors. The wire order of the stepper motor interface is blue, pink, yellow, orange, red.
Several expansion boards can also be stacked. In that case, the I2C communication interface on the lower board near the power terminal is connected to the I2C communication interface on the upper board near the power terminal. Pay attention to the wire order when connecting; a PH2.0 double-ended reverse cable is needed here, and we use M2 plastic standoffs to fix the two boards together:
Stacking connection uses a PH2.0 double-ended reverse cable.
Tests
We tested 5-wire 4-phase stepper motors with different gear ratios, diameters and supply voltages:
12V 35BY412L motor test
12V 28BYJ48 motor test
Motor 1 is a 5V 28-size stepper motor with a 16:1 gear ratio. Control motor 1: speed 100, forward, single-step drive, continuous motion.
Motor 1 is a 5V 28-size stepper motor with a 16:1 gear ratio. The REPL commands shown:
>>> bus_step_motor.start_step_motion(2,0,0,200,1000)
>>> stop_step_motion
>>> bus_step_motor.start_continuous_motion(1, BusStepMotor.FORWARD, BusStepMotor.DRIVER_MODE_SINGLE, 100)
>>> bus_step_motor.start_continuous_motion(2, BusStepMotor.BACKWARD, BusStepMotor.DRIVER_MODE_SINGLE, 100)
24V 35BY412L motor test
We also tested the different drive modes:
- Single-step drive
- Double-step drive
- Half-step drive
Video (in Chinese, Bilibili): I2C stepper motor driver board: design, theory and bench test
Related Anvol case: Stepper Motor Driver Board