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
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);
}
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.
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.
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.