Prerequisites
Before you begin, make sure you have:- An ESP32 development board (ESP32‑DevKitC or compatible)
- A motor driver that accepts step/direction inputs
- A power supply sized for your motor and driver
- Basic tools: wire strippers, small screwdriver set, multimeter
Prototyping components (for custom wiring)
If you are wiring without the official PCB, you will typically need:- Logic level shifter (3.3V → 5V, 4+ channels)
- Solderless breadboard or proto board
- Dupont jumpers (male↔male and male↔female)
- 5V rail for the high‑side of the level shifter (often available from your driver or a separate regulator)
Official OSSM wiring
The reference OSSM PCB includes level shifting and standardized headers. This is the recommended approach for most builds.Reference board layout

OSSM reference board (version 1) - front view showing component placement
PCB connection diagram

Connection diagram showing motor driver and peripheral connections
ESP32 GPIO pinout (default)
These are the default firmware mappings for the OSSM PCB:
ESP32 GPIO pinout showing control signal routing

JST header locations with pin labels for easy identification
Alternative wiring configurations
TB6600 stepper driver
Use this when driving a stepper motor with a TB6600‑style external driver.Connect motor power and phases
Wire control signals (via level shifter)
- Step (GPIO 14) → PUL+
- Direction (GPIO 27) → DIR+
- Enable (GPIO 26, if used) → ENA+
- GND (ESP32/level shifter) → PUL‑, DIR‑, ENA‑
Set DIP switches

Wiring diagram for TB6600 stepper driver with OSSM controller
Servo motor with integrated driver (iHSV57, 42AIM30, etc.)
Many integrated servos accept step/direction/enable just like a stepper driver.
Servo motor wiring configuration showing step/direction interface
Additional stepper driver options
For more designs and archived schematics, see the repository’s hardware archive:Power and grounding best practices
- Use a single‑point (star) ground between ESP32, level shifter, and driver
- Keep step/direction/enable leads short; avoid running them parallel to motor power
- Twist each motor phase pair (A+/A‑ and B+/B‑) to reduce EMI
- Provide strain relief for all connectors to prevent intermittent faults
- If runs are long, consider shielded cable for control signals and connect shield to chassis/earth at one end only
Verifying your wiring
Perform these checks before applying power to the motor driver.Continuity and pin mapping
Isolation between signals and power
Power polarity and voltage
First power‑on checklist
- With the motor disconnected, power the driver and confirm status LEDs look normal
- Connect the motor, then command a very low speed move
- Verify direction changes when commanded
- If using an encoder, confirm counts change smoothly in one direction and reverse when direction changes
Troubleshooting
Motor misses steps at high speed
Motor misses steps at high speed
- The level shifter is powered on both sides (3.3V and 5V)
- Grounds are common between ESP32, level shifter, and driver
- Signal wires are short and routed away from motor power
Motor does not respond to commands
Motor does not respond to commands
- Check the enable input polarity; many drivers use active‑low enable
- Confirm step/direction pins match your firmware configuration
- Ensure the driver has adequate power (verify status LEDs)
Erratic or jittery motion
Erratic or jittery motion
- Keep signal wires separate from motor power cables
- Verify the driver supply remains within spec under load
- Add local decoupling near the driver inputs
Motor runs in the wrong direction
Motor runs in the wrong direction
INVERT_DIRECTION setting.
