Stepper Motor Wiring Diagram

Stepper Motor Wiring Diagram — circuit diagram showing component connections+12V SupplyARDUINOUNOMCUL298NH-BridgeStepper Driver (A4988/DRV8825)MSTEPStepper MotorStepper Motor Wiring (Bipolar 4-wire)
Stepper Motor Wiring Diagram — interactive diagram. Open it in the editor to customise components and wiring.

This is a free printable stepper motor wiring diagram: download the diagram as SVG or open it and print to paper or PDF.

A stepper motor wiring diagram shows how to connect a bipolar or unipolar stepper motor to a driver board or controller, identifying coil pairs and winding terminals for precise step control.

A stepper motor is a brushless DC motor that divides a full rotation into a fixed number of discrete steps by sequentially energising electromagnet coils (phases) around a toothed rotor. Unlike a DC motor that spins continuously when power is applied, a stepper motor advances one step for each electrical pulse from its driver. This makes stepper motors ideal for applications requiring precise position control without a feedback sensor — CNC machines, 3D printers, camera sliders, and robotics.

Stepper motors are broadly categorised as bipolar or unipolar based on their internal winding configuration. A bipolar stepper motor has two independent coil windings (two phases), each with two wire ends — giving four wires total. The driver must reverse the current direction through each coil to step the motor. This requires an H-bridge driver circuit for each phase. Bipolar motors are smaller and more efficient than unipolar equivalents for the same torque output.

A unipolar stepper motor has a centre-tap on each winding, effectively splitting each coil into two halves — resulting in six wires (or five if both centre-taps are joined internally). By energising one half of a coil at a time, the driver never needs to reverse current direction, simplifying the drive circuitry. However, only half the winding is active at any moment, reducing torque efficiency.

Identifying which wires form each coil pair is essential before wiring a stepper motor. Wires belonging to the same coil have measurable resistance between them; wires from different coils read as open circuit. A 4-wire motor has two coil pairs. A 6-wire motor has two coil pairs each with a centre-tap. An 8-wire motor has two bifilar windings per phase that can be configured for different voltage and current combinations.

The driver board (such as an A4988, DRV8825, or L298N) receives step and direction signals from a microcontroller and delivers the correct current pulses to the motor coils. Current limiting at the driver is critical — too little current reduces torque; too much current overheats the motor and driver. Always set the driver current limit to match the motor's rated current per phase.

Stepper motor wiring varies by coil configuration (bipolar or unipolar), motor frame size (NEMA 17, NEMA 23, and others), and the driver being used. Popular brands such as Fuyu and Leadshine have their own connector pinouts and driver modules, but the underlying coil pairs follow standard A+/A− and B+/B− naming. When wiring a stepper to an Arduino or similar microcontroller, a dedicated driver IC (such as the A4988 or DRV8825) sits between the microcontroller and the motor to handle the higher coil current. You can diagram any stepper motor circuit free online at circuitdiagrammaker.com.

How to wire stepper motor wiring diagram

  1. Identify the motor type and wire count Count the motor's wires. A 4-wire motor is bipolar with two coil pairs. A 6-wire motor is unipolar with two coil pairs each having a centre-tap. An 8-wire motor is a bifilar motor with four coil halves. This determines compatible driver types. Most modern stepper drivers (A4988, DRV8825, TMC2208) are designed for bipolar 4-wire use. A 6-wire unipolar motor can be used as a bipolar motor by leaving the centre-tap wires disconnected.
  2. Identify the coil pairs with a multimeter With the motor disconnected from all power, use a multimeter in resistance mode. Probe all wire pairs and record which pairs show a low resistance reading (this indicates the same coil). Label each pair: Coil A (wires A1 and A2) and Coil B (wires B1 and B2). The coil resistance should match the manufacturer's specification (typically 1–20 Ω). Wires from different coils read as open circuit.
  3. Configure the driver board current limit Before connecting the motor, set the driver's current limit to match the motor's rated phase current. On drivers such as the A4988 and DRV8825, the current limit is set by adjusting a potentiometer (Vref) on the driver board. The formula is: Vref = Iphase × 8 × Rsense (for A4988) or Vref = Iphase × 5 × Rsense (for DRV8825). Measure Vref with a multimeter and adjust to the calculated value. Do not exceed the motor's rated current — it will overheat the motor and driver.
  4. Connect the motor to the driver output terminals Connect Coil A wires (A1 and A2) to the driver's 1A and 1B output pins. Connect Coil B wires (B1 and B2) to the driver's 2A and 2B output pins. The specific terminal labels vary by driver manufacturer — refer to the driver's datasheet or silkscreen. Coil polarity determines motor direction: reversing A1 and A2 (or B1 and B2) reverses the step direction. Do not swap between Coil A and Coil B outputs — this will not reverse direction; it will cause the motor to stall.
  5. Connect the driver control signals to the microcontroller Connect the STEP pin of the driver to a digital output pin on the microcontroller. Each rising edge on STEP advances the motor by one step (or microstep, depending on microstepping configuration). Connect the DIR pin to another digital output — setting this HIGH or LOW determines step direction. Connect the ENABLE pin (active LOW on most drivers) to ground or a digital output as required. Set the MS1, MS2, MS3 (or equivalent) microstepping configuration pins per the driver datasheet for the desired resolution.
  6. Connect the power supplies The driver requires two power supplies: a logic supply (typically 3.3 V or 5 V, from the microcontroller board or a regulator) for the control circuit, and a motor supply voltage for the motor coils (typically 12–24 V DC for most NEMA 17 applications). Connect a 100 µF (minimum) electrolytic capacitor across the motor supply rails at the driver board, observing polarity. Do not power the motor supply before the logic supply — some drivers can be damaged by reverse power-up sequencing.
  7. Test the motor and tune current and speed Send a low-speed test pulse sequence from the microcontroller. The motor should step smoothly with an audible click per step. Verify direction control by changing the DIR pin state. If the motor vibrates but does not turn, the coil pairs may be connected incorrectly. If the motor stalls or misses steps at low speed, check the current limit setting. Increase step rate gradually to find the maximum reliable operating speed for the load. Add heat sinks to the driver IC if the motor will operate continuously at rated current.

Specifications

NEMA 17 step angle (standard)1.8° per full step (200 steps per revolution)
NEMA 23 step angle (standard)1.8° per full step (200 steps per revolution)
A4988 maximum output current1 A continuous per phase (2 A with heat sink)
DRV8825 maximum output current1.5 A continuous per phase (2.2 A with heat sink)
Typical motor supply voltage range (NEMA 17)12–24 V DC
A4988 maximum microstepping resolution1/16 step
DRV8825 maximum microstepping resolution1/32 step
Recommended motor supply bypass capacitor100 µF minimum, rated ≥ 1.5× supply voltage

Safety warnings

Tools needed

Common mistakes

Troubleshooting

Motor vibrates but does not rotate
Cause: The two coil pair wires are connected to the same driver output phase instead of separate phases, or the coil polarity is reversed on one phase such that the magnetic fields cancel Fix: Power down the system. Use a multimeter to re-identify the two coil pairs. Connect Coil A (A1 and A2) to the driver's Phase 1 outputs and Coil B (B1 and B2) to the driver's Phase 2 outputs. Verify coil resistance on each output pair reads as expected. Power up and test again.
Motor runs in the wrong direction
Cause: The DIR input is at the wrong logic level, or one coil pair is connected with reversed polarity to the driver output Fix: To reverse direction in software, toggle the DIR pin state in the microcontroller code. To reverse direction in hardware (without code change), swap A1 and A2 connections on one coil pair at the driver output terminals. Do not swap coil pairs between Phase 1 and Phase 2.
Motor misses steps under load
Cause: Current limit set too low (insufficient holding torque), step rate exceeds motor's usable speed range, or motor supply voltage is too low for the required speed Fix: Verify the Vref potentiometer is set correctly for the motor's rated phase current. Reduce step rate. Increase motor supply voltage if within the driver's maximum input voltage rating — higher voltage allows the driver to push current faster into the motor coils, increasing usable speed and reducing step loss at higher frequencies.
Driver IC overheating (thermal shutdown or damage)
Cause: Current limit set too high, inadequate heat sinking, or ambient temperature too high for the driver Fix: Verify the current limit Vref is set to the motor's rated current, not the driver's maximum. Attach a heat sink to the driver IC. Improve airflow around the driver board. If the application requires higher current, use a higher-current driver rated for the application.

Frequently asked questions

How do I identify the coil pairs on an unmarked stepper motor?

Use a multimeter in resistance mode. Measure resistance between all wire pairs. Wires belonging to the same coil will show a low resistance reading (typically 1–20 Ω for most stepper motors). Wires from different coils will show as open circuit (OL or infinite resistance). Group all wires with resistance readings between them — these form one coil pair. The remaining wires form the other coil pair.

What is microstepping and does it improve accuracy?

Microstepping is a technique where the driver energises the two coils simultaneously at varying current ratios to achieve intermediate rotor positions between full steps. A driver operating at 1/16 microstepping divides each full step into 16 sub-steps. This smooths motor motion and reduces vibration, particularly at low speeds. However, microstepping does not proportionally increase positional accuracy — at high microstepping ratios, each microstep produces diminishing torque and small external forces can push the rotor past a microstep position.

Why is my stepper motor vibrating or missing steps?

The most common causes are: the driver current limit is set too low (motor lacks torque); the step rate (pulses per second) is above the motor's maximum usable speed (stepper motors lose torque rapidly above their resonant frequency); or the motor is in resonance with a particular step rate. Reduce the step rate, increase the driver current to the motor's rated phase current (without exceeding it), and ensure the microcontroller step pulse width meets the driver's minimum pulse specification.

What is the difference between an A4988 and a DRV8825 stepper driver?

Both are popular integrated stepper motor driver ICs in similar board formats. The A4988 supports up to 1/16 microstepping and a maximum output current of approximately 1 A per phase (2 A with adequate heat sinking). The DRV8825 supports up to 1/32 microstepping and a maximum of approximately 1.5 A per phase (2.2 A with heat sinking). The DRV8825 also has a more uniform microstep pattern. Both use the same STEP/DIR interface. The DRV8825 requires a minimum 200 ns high pulse on STEP, compared to 1 µs for the A4988.

Do I need a capacitor across the stepper driver power supply?

Yes. Stepper driver datasheets recommend placing a large electrolytic capacitor (typically 100 µF or larger) across the motor power supply rails at the driver board. Stepper motors generate back-EMF voltage spikes when a coil is de-energised, which can exceed the driver's rated supply voltage and cause the driver IC to latch-up or fail. A bulk capacitor absorbs these spikes. Place the capacitor as close to the driver's motor supply pins as possible.

What does a wiring diagram of a stepper motor show?

A stepper motor wiring diagram shows the motor's coil windings (typically two coil pairs: A+/A− and B+/B−), the driver module pins (STEP, DIR, EN, VMOT, GND, and the coil outputs), and the power supply connections. For a bipolar stepper the driver's two H-bridge outputs each connect to one coil pair. Reference coil resistance to identify which wire pairs belong to each coil.

How do I wire a stepper motor to an Arduino?

Connect a stepper driver (e.g. A4988) between the Arduino and the motor. The driver's STEP and DIR pins connect to two Arduino digital output pins; EN is optional (pull low to enable). VMOT and GND on the driver go to the motor power supply (typically 8–35 V depending on the motor); the logic VDD and GND connect to the Arduino's 5 V and GND. The 1A, 1B, 2A, 2B outputs connect to the motor's two coil pairs. Decouple VMOT with a 100 µF capacitor close to the driver.

What is the wiring diagram for a Fuyu stepper motor?

Fuyu (FY) stepper motors are bipolar 4-wire or 6-wire motors. The 4-wire version has two coil pairs; typical wire colours are red/blue for coil A and green/black (or yellow/white) for coil B. Connect each pair to the A and B outputs of a compatible driver such as the TB6600 or Leadshine driver. Always verify coil pairing by measuring resistance: the two wires of the same coil will show the winding resistance (commonly 1–5 Ω) while wires from different coils show no continuity.

What is the wiring diagram for a Leadshine stepper motor driver?

Leadshine drivers (such as the DM542 or M542) have opto-isolated control inputs (PUL+/PUL−, DIR+/DIR−, EN+/EN−) and motor output terminals (A+, A−, B+, B−). Connect the step-pulse and direction signals from the controller to the PUL and DIR inputs (common-anode or common-cathode configuration). Motor power supply connects to VDC and GND, then the A and B output pairs connect to the motor's coil pairs. Set the DIP switches for the correct current (matching the motor's rated phase current) and microstep resolution.

What is the wiring diagram for a NEMA 17 stepper motor?

A NEMA 17 bipolar stepper motor typically has four wires exiting the motor body in two coil pairs. Common colour convention (though not universal) is red/blue for coil A and green/black for coil B. Connect red and blue to driver outputs A+ and A−; green and black to B+ and B−. NEMA 17 motors are rated at 1–2 A per phase and are commonly driven by the A4988 or DRV8825 at 8–35 V supply. Identify coil pairs using a multimeter before connecting.

What is the wiring diagram for a NEMA 23 stepper motor?

NEMA 23 motors are physically larger than NEMA 17, with rated currents typically between 2 A and 4 A per phase, requiring a more capable driver such as the Leadshine DM542 or TB6600. Wiring follows the same bipolar principle: two coil pairs (A+/A−, B+/B−). Four-wire NEMA 23 motors connect directly to driver output terminals; 6-wire motors have a centre-tap per coil which can be left open for bipolar series operation (higher torque at low speed) or the centre-taps can be connected for unipolar driving.

Related diagrams

Free electrical calculators

Edit this diagram free in the online editor