NEMA 17 Step Motor Help

I am having a hell of a time getting a NEMA 17 Step Motor to work. I am using an A4988 driver with an uno with the motor - I have a 12V power supply. All wiring has been tested, I am getting 5v from arduino to the driver, and 6v VREF. I upped it higher for testing, but I cannot get the motor to move at all.

I can't figure out how to make a good schematic... so here's what I have:

Power Supplies
VMOT (A4988) -> Positive terminal of 12V power supply
GND (A4988) -> Negative terminal of 12V power supply
VDD (A4988) -> 5V on Arduino
GND (A4988) -> GND

Coil 1:
1A (A4988) -> Red
1B (A4988) -> Blue
Coil 2:
2A (A4988) -> Green
2B (A4988) -> Black

ENABLE (A4988) -> Pin 8
STEP (A4988) -> Pin 9
DIR (A4988) -> Pin 10

Here is the code I've been using. I could seriously use any help. I'm losing my mind. I am also not necessarily great at this, so it could be something dumb.

#include <Arduino.h>

// Motor driver pin definitions
const int stepPin = 9;    // STEP pin
const int dirPin = 10;    // DIR pin
const int enablePin = 8;  // ENABLE pin

const int stepsPerRevolution = 200
const int delayTime = 5

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);

  digitalWrite(dirPin, HIGH);
  digitalWrite(enablePin, LOW); // Ensure the driver is enabled

  Serial.begin(9600);
  Serial.println("Setup complete");
}

void loop() {
  for (int i = 0; i < stepsPerRevolution; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000); // Adjust delay for speed
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000); // Adjust delay for speed
  }
  Serial.println("Completed one revolution");
  delay(1000);
}

Read and follow the "Recommended Links" on this page to prepare the A4988.

Thanks for sending that. I had looked through some similar things before, but perhaps I missed something or don’t understand. I’ll try to figure out what I’m missing in those links/documents.

The video from that link is very well done.

Is it making a buzzing sound but not moving?
Try using:-

1A (A4988) -> Blue
1B (A4988) -> Red

Or try slowing down the motor a lot, instead of

delayMicroseconds(1000); // Adjust delay for speed

try

delay(100); // Adjust delay for speed

#include <Arduino.h>

// Motor driver pin definitions
const int stepPin = 9;    // STEP pin
const int dirPin = 10;    // DIR pin
const int enablePin = 8;  // ENABLE pin

const int stepsPerRevolution = 200;
const int delayTime = 5;

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);

  digitalWrite(dirPin, HIGH);
  digitalWrite(enablePin, LOW); // Ensure the driver is enabled

  Serial.begin(115200);
  Serial.println("Setup complete");
}

void loop() {
  for (int i = 0; i < stepsPerRevolution; i++) {
    digitalWrite(stepPin, HIGH);
    delay(delayTime); // Adjust delay for speed
    digitalWrite(stepPin, LOW);
    delay(delayTime); // Adjust delay for speed
  }
  Serial.println("Completed one revolution");
  delay(1000);
}

Hi, @kbald77

Can you please post a link to specs/data of the stepper?
NEMA 17 is the physical size of the motor, it tells us nothing of the electrical properties.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you post some images of your project?
So we can see your component layout.

Do you have a DMM? Digital MultiMeter?

What are the specs on your 12V power supply?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

That makes no sense. See this tutorial: Pololu - Video: Setting the Current Limit on Pololu Stepper Motor Driver Carriers

The actual value of the setting depends on the value of the current sense resistor on the motor driver. If you do not have Pololu's version, see the A4988 data sheet for the details.

The A4988 driver can support at most 1 Ampere per winding, continuously, without forced air cooling.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.