# NEMA17 Stepper motor not turning, but making very little noise [closed]

I have a NEMA17 stepper motor (2 Phase, Rated 12V, 1.2A/Phase) and I am trying to make it run with an L298N and a Raspberry Pi. Everything is wired up as shown below in the pictures. I use a 12V, 2A power supply to power the L298N. The RPi is powered separately.

I measured the resistance between the different stepper motor leads. I have been told that two wires are a pair if they have very little resistance. If there is no resistance, they are not a pair. This way, I think The correct pairs are in the A and B terminals of the L298N.

I'm using the following python script:

import RPi.GPIO as GPIO
import time

# Variables

delay = 0.05
steps = 50

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

# Init pins

coil_A_1_pin = 9
coil_A_2_pin = 25
coil_B_1_pin = 11
coil_B_2_pin = 8

# Set pin states

GPIO.setup(coil_A_1_pin, GPIO.OUT)
GPIO.setup(coil_A_2_pin, GPIO.OUT)
GPIO.setup(coil_B_1_pin, GPIO.OUT)
GPIO.setup(coil_B_2_pin, GPIO.OUT)

# Function for step sequence

def setStep(w1, w2, w3, w4):
GPIO.output(coil_A_1_pin, w1)
GPIO.output(coil_A_2_pin, w2)
GPIO.output(coil_B_1_pin, w3)
GPIO.output(coil_B_2_pin, w4)

# Example rotations: forward and backward

for i in range(0, steps):
setStep(1,0,1,0)
time.sleep(delay)
setStep(0,1,1,0)
time.sleep(delay)
setStep(0,1,0,1)
time.sleep(delay)
setStep(1,0,0,1)
time.sleep(delay)

for i in range(0, steps):
setStep(1,0,0,1)
time.sleep(delay)
setStep(0,1,0,1)
time.sleep(delay)
setStep(0,1,1,0)
time.sleep(delay)
setStep(1,0,1,0)
time.sleep(delay)


The stepper motor does not move whatsoever, unfortunately. It does make very little noise when running the script.

Any ideas on how to troubleshoot this project are very welcome.

More details on the stepper motor:
PHASE : 2 PHASE
STEP ANGLE : 1.8 ± 5% ° /STEP
VOLTAGE : 12V
CURRENT : 1.2 A/PHASE
RESISTANCE : 10.0 ± 10% ?/PHASE
INDUCTANCE : 20 ± 20% mH/PHASE
HOLDING TORQUE : 48 N.cm Min
ROTOR TORQUE : 68 g.cm2
INSULATION CLASS : B
SIZE : 41 x 41 x 62mm
WEIGHT : 181 grams

• And your schematic is.... – Tyler Jan 29 '17 at 0:01
• Welcome, jvermeulen! as Tyler correctly indicates, a good question also includes a clear schematic of what you're doing – that's what the built-in schematic editor is for. – Marcus Müller Jan 29 '17 at 0:05
• @MarcusMüller: A schematic has been added above. I hope it is clearer now! – jvermeulen Jan 29 '17 at 19:12
• That is not a schematic, but it might be enough. – Tyler Jan 29 '17 at 19:12
• @jvermeulen: that's really everything but a schematic (that's why I referred to the built-in schematic editor... sigh), but it certainly helps. – Marcus Müller Jan 29 '17 at 19:31