So yesterday I got the A4988 stepper motor driver and a bi-polar NEMA 14 (I know, it's small). Immediately I hooked it up to the arduino and nothing worked. Then I noticed the sleep wasn't connected to the reset but it still didn't work.
From there I had 2 options. Either the motor wasn't working or the driver wasn't working.
I got the motor and connected it to my motor driver shield and I had it working like that!!!
So then I knew that the motor worked and that the driver was the thing that didn't work. But with this I don't know what to do. So I attached the schematic I have and BTW the capacitor I'm using is a 100µF
LOL it is sorta sexist but tbh femfunction just sounds weird.
So I will go step by step.
I made a pencil drawing, but by the time I was don't I couldn't even recognize what was what. But, I am going off of the design on this website.
I don't understand what you mean when you say you need to know HOW your A4988 was connected.
So up next I have a link to the datasheet for my NEMA 14...
I am using a 9V battery for powering the stepper motor and using the arduino 5V for that other power input.
Actually I just tested the voltage for my 9V battery and for some reason it is only 4.5V IDK how this is possible but now I'm changing to my 4 x AA battery pack with exactly 6V and the regular 2A with AA batteries.
Finally the code that I'm using is this...
(It's practically the same as your example code)
/* Simple Stepper Motor Control Exaple Code
*
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
*/
// defines pins numbers
const int stepPin = 4;
const int dirPin = 5;
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
for(int x = 0; x < 200; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delay
digitalWrite(dirPin,LOW); //Changes the rotations direction
// Makes 400 pulses for making two full cycle rotation
for(int x = 0; x < 400; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000);
}
OMG I added another 4 x AA to my original to make a total of around 12v and I hooked it up and BAM it worked.
It did the code of CW 1 rotation and then the CCW 2 rotations.
But when it paused there was a terrible speaking noise.
Is there any way you know how to fix this?
I'm only asking because you seem to be an expert on the A4988.
Or is this just my motor.
You need to use a motor power supply capable of providing the required motor current (2x the winding current) and set the winding current limit appropriately on the motor driver. Follow the instructions on the Pololu site carefully.
Ghostbusters:
I don't understand what you mean when you say you need to know HOW your A4988 was connected.
You have the emphasis wrong. I meant "need to know how YOUR A4988 was connected" (I even debated with myself whether I should put the word "your" in bold and decided not to).
That motor will work much better with a 20v (or more) power supply. Just make sure you adjust the A4988 to limit the current to the 1 amp that the motor is designed for.
Everytime the string "9V battery" pops up here, imagine a loud siren and alarm bells sounding!
A small 9V battery struggles from about 30mA upwards, motors take amps.
You can get larger 9V batteries (used to be called PP9's), but they are very rare these days. Those
would handle the current as they are 30 times bigger!