I have checked the Uno is working with the blinking program, the stepper motor is working by testing if it can power an LED with both coils, there is a voltage of 0.584 across the vmot and ground of the driver, I have also tried using code from other tutorials and it does not want to work. The code I am currently using is below:
// Stepper motor run code with a4988 driver
// by Superb
const int stepPin = 3; // define pin for step
const int dirPin = 4; // define pin for direction
void setup() {
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin, HIGH); // set direction, HIGH for clockwise, LOW for anticlockwise
for(int x = 0; x<200; x++) { // loop for 200 steps
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // delay for 1 second
}
Pictures of the setup and power supply are in the comments hopefully. Thanks in advance if anyone can provide some help.
I can drop the amps down, the stepper driver is rated for up 2A and I had seen on other threads that slightly increasing the amps could make the motor move. I was measuring that voltage at the 12V, 1.5A.
The motor is rated for I^2R=1*5.9=5.9Watts per coil, or 12W for full power through both coils. 12V*1.5A=18W. Where's the 18Watts going?
Normally when using these drivers, as you turn the power supply voltage up, the current drops because its circuitry is delivering the same power to the stepper.
Is there any mechanical load on the shaft of the stepper? If you check the stepper coils with a DMM, are they close to 5.9 ohms? Is there a short somewhere?
Set the driver current to 1 Amp and try this modified loop():
void loop() {
digitalWrite(dirPin, HIGH); // set direction, HIGH for clockwise, LOW for anticlockwise
for(int x = 0; x<200; x++) { // loop for 200 steps
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
}
delay(1000); // delay for 1 second
}