Hi everyone,
A while ago I got a stepper bipolar stepper motor (4 wire) - I also got a cheaper version of the A4988 Driver.
I have tried to connect it up and and I am unable to make the stepper move at all.
I am trying to use this code
//Connecting the A4988
//Connect RESET and SLEEP together
//VDD to either 3.3V or 5V
//GND to Arduino GND
//Connect 1A and 1B to stepper coil 1
//Connect 2A and 2B to stepper coil 2
//Connect VMOT to power source (9v battery + term)
//Connect GND to power source (9v battery - term)
const int stp = 13; //connect pin 13 to STEP
const int dir = 12; //connect pin 12 to direction
int a = 0; // counter
void setup()
{
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
}
void loop()
{
if (a<200) // sweep 200 step in dir 1
{
a++;
digitalWrite(stp, HIGH);
delay(10);
digitalWrite(stp, LOW);
delay(10);
}
else
{
digitalWrite(dir, HIGH);
a++;
digitalWrite(stp, HIGH);
delay(10);
digitalWrite(stp, LOW);
delay(10);
if(a > 400) // sweep in dir 2
{
a=0;
digitalWrite(dir, LOW);
}
}
}
As far as connection go - I am just trying with a 9v battery connect + to Vmot, - to GND, the motor to 1a 1b, 2a 2b making sure to get the phases right (i tested for continuity) Then GND from arduino Uno to the GND of driver, and 5V from arduino to Vdd
Ive connected RESET and SLEEP together.
Ive connected STEP to pin 13
and direction to pin 12
When I run the code, i begin to feel the heat sink heat up - so there is definitely current.
I have tried adjusting the trim pot - although I’m not 100% sure how to get the current i want - the trim just keeps turning in either direction forever.
I tried to use the trim pot as Vref and test from battery - side to the trim pot + at 9V, I’m getting a reading of like 0.01 A at best…no matter how i turn the trim pot
I may be doing this wrong, but I’m not sure how I’m supposed to get it right
Any help would be appreciated, just really want to make it spin, haha
Thanks in advance
MrDropsy