Arduino + A4988 Stepper Motor Driver Help

hans29

Jan 16, 2026
1
Joined
Jan 16, 2026
Messages
1
Hi all,


I'm using an Arduino Uno with an A4988 driver to control a NEMA 17 stepper motor. I’ve connected STEP to pin 2 and DIR to pin 3. The motor powers up but only vibrates or makes noise—it doesn't rotate properly.


Here’s my basic code:
#define STEP 2
#define DIR 3

void setup() {
pinMode(STEP, OUTPUT);
pinMode(DIR, OUTPUT);
digitalWrite(DIR, HIGH);
}

void loop() {
digitalWrite(STEP, HIGH);
delayMicroseconds(800);
digitalWrite(STEP, LOW);
delayMicroseconds(800);
}

Do I need to adjust the current limit on the A4988? Should I use a library like AccelStepper for smoother control?

Any advice is welcome!

Thanks!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,270
Joined
Nov 17, 2011
Messages
14,270
Which power supply do you use for the motor and stepper driver?
Is your power supply able to drive the motor? Note that the pulse current of the motor can be much higher than the permanent current.
Do you have a bypass capacitor across this power supply to provide the pulse current for the motor with each step?
 

Krishna Sankhyan

Apr 15, 2026
7
Joined
Apr 15, 2026
Messages
7
Hi 🙂
Make sure wiring is correct — STEP & DIR to Arduino and common GND. Also set the current limit.
Example:
STEP → D3, DIR → D4
Send HIGH/LOW pulses on STEP to rotate motor.
If it only vibrates, check coil wiring or use proper external power 👍
 

Minder

Apr 24, 2015
3,561
Joined
Apr 24, 2015
Messages
3,561
Are you using one of the A4988 versions mounted to a carrier ?
Have you set the motor current limit?
I tend to use the carrier mounted DRV8825 for this.
 
Last edited:
Top