A4988 with NEMA 14 stepper motor not working

Hello All,

This is one of my first Arduino projects and I am hitting a snag. I am trying to run a NEMA 14 stepper motor with an A4988 driver. I cant figure out why it isn't working. (No movement or buzzing or anything!). Should the digital output for the stepping (Pin 2 in code) be reading 5V? When measuring I am only getting 0.01.

NEMA 14 Specs: 2 phase, 5.4V, Phase- 0.8A

Wired exactly how Pololu shows. except I am using a 5V external power supply:

Code (from forum User Robin2):

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0

byte directionPin = 6;
byte stepPin = 2;
int numberOfSteps = 1000;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds


void setup() 
{ 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  

  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
}

void loop() 
{ 

}

Thank you all for the help!

An A4988 won't work with a 5v motor power supply. Try 12v. Stepper motors work better with higher voltages. Just be sure to set the current limit to protect your motor.

...R
Stepper Motor Basics
Simple Stepper Code

Thanks. I threw a 9V on it and it worked! I was following some other guides I found online and people were getting it to work with 5V powered via the Arduino on a 12V Nema 17.

I will probably swap out the A2988 with a different driver.

HypnoticLasagna:
I will probably swap out the A2988 with a different driver.

Why on earth would you do that? The A4988 works very well and is perfectly well suited to your 0.8A motor.

...R

Robin2:
Why on earth would you do that? The A4988 works very well and is perfectly well suited to your 0.8A motor.

...R

Id prefer to only have 1 power supply. USB is easiest for me and the application.

HypnoticLasagna:
Id prefer to only have 1 power supply. USB is easiest for me and the application.

USB power is not a practical option for a stepper motor. On the one hand you will probably draw too much current from the USB connection and may damage it. On the other hand the stepper motor will perform very poorly with a 5v power supply. I reckon 12v is the minimum and 24v would be better.

Have you studied the links I gave you in Reply #1

...R

HypnoticLasagna:
Id prefer to only have 1 power supply. USB is easiest for me and the application.

Get a 12V supply and a USB converter from 12V (like a car USB socket, or a cheap LM2596
module from eBay.

Never ever try to run a motor or other inductive load from a USB supply on a laptop, you are
asking to fry the laptop....

Stepper motors can run faster with a higher supply, at 5V its probably going to be unusable.

USB is easiest for me and the application.

No it is not, because you have already learned that the A4988 does not work on 5V.