A4988 and arduino

Hi everyone!
I bought an A4988 and it initially seemed to work whe i discovered that the pins reset and sleep have to be wired together. But when i have disconnected the battery from the arduino and reconnected it, it didn’t seems to work until i have disconnected the pin sleep from the reset and riconnected it later(just a second).
But now it doesn’t work at all :frowning: i tried to connect and disconnect the alimentation and those two pins but nothing… The microcontroller seems to work, in fact it heats a few! The alimentation from the arduino arrives correctly and also the alimentation from the battery.
The code is below and a photo here:

int dirPin = 5;
int stepperPin = 4;
void setup() {
 pinMode(dirPin, OUTPUT);
 pinMode(stepperPin, OUTPUT);
 void step(boolean dir,int steps){
 for(int i=0;i<steps;i++){
   digitalWrite(stepperPin, HIGH);
   digitalWrite(stepperPin, LOW);
void loop(){


Sorry for my english :slight_smile:


First, I am not sure what you mean by “alimentation,” could you clarify? Also, could you tell me more about your setup? What are you using to supply power? Could you post a well lit picture of your setup from a different angle (not taken from directly above the board) so it is easier to see all of your connections?

Your code looks fine, and from what I can see, it looks like you are making all the necessary connections to the A4988 board, but your solder joints look quite bad, and I am concerned that they might not be providing good electrical connections or might easily short with adjacent pins. You might consider cleaning up your solder joints to make them look more like the ones in the following picture:

(taken from one of ladyada’s tutorials)


Ok, sorry!
So, a bit of photos:

The stepper-> dlnmh9ip6v2uc.cloudfront.net/dat … GHM809.PDF

As you can see i tried to resolder the pins with a better result…

To aliment the logic of the driver i’m using the 5V from the arduino and a 12V12Ah Pb battery for the stepper (working, full charged)

Thank you for posting more pictures. However, they are too dark and blurry to really see the connections being made to the A4988 board. Could you try one more time? If you use better lighting, it should help make the pictures clearer; keep in mind that the idea is for us to be able to easily verify which pins on the driver are connected to which pins on the Arduino. Also, you could try using macro mode (usually represented by a flower icon) if your camera has it.

In addition, I have a few more questions:

  • In the data sheet you gave for your stepper motor it specifies 1.7A at 3V; have you set the current limit on the A4988 board? If so, what is it?
  • In your first post you said that the “microcontroller seems to work, infact it heats a few.” Did you mean the Arduino? What exactly is heating?
  • Do you have access to a multimeter that you could use to check the continuity of each connection?


If photos are required to see my setup, i can ensure that it has been made like this. I‘ve setted the current manually through the potentiometer when it was warking and i haven’t touched it yet from that time but it doesn’t work anyway ! i don’t have a multimeter :frowning:
The micro that heats i sthe one on the A4988, not the arduino!

I suspect that a short might have permanently damaged your board. If you email us with your order information and refer to this thread then I might be able to get you a discount on a replacement.

However, I am not certain that there is nothing wrong with your setup, and I suggest you thoroughly inspect it to be sure that any replacements are not damaged as well.


Instead i was thinking about the possibility of a damaged stepper…
Once i tried to turn fully clockwise the trim but just for a second and later the stepper was working normally!
I tried to pilot it with an L298N but it still doesn’t work…

I dont’t believe about a discount on a replacement beacouse i bought it from eBay! :frowning:

If i buy a multimeter, could i chak if the A4988 or the stepper are damaged?
For the stepper i was thinking about measuring the impedance between the leads 1A and 1B or "a and 2B and see if it’s still ±1,7ohm!

With a multimeter you should be able to check the connections to your driver for continuity and shorts. However, those might not be involved the problem, in which case you would only know that you were making good connections, and not necessarily if the driver is broken or not. A multimeter might also be able to help you determine if your stepper motor is damaged.

In addition, we are still willing to offer you a discount if you would like to buy a replacement directly from us.


God, call me crazy but it suddendly started working… I changed the breadboard but i can’t believe that the problem was this beacouse the wiring seemed to be ok!

But now i have a little problem: if i disconnect the 5v from arduino to the A4988 (so i turn off the system) and riconnect it, i have to disconnect and riconnect the reset and sleep pins (more than one time) or it won’t wark at all!

What can i do?

This morning it worked also without disconnect and reconnect those two pins, it wa fantastic. I think I had to do this due to the arduino alimentation: If it’s alimented via USB it doesn’t work and i have to disconnect and riconnect those pins a few times. Instead, if the arduino is alimented through a 5V battery, it works fine!

BUT NOW IT DOESN’T WORK AT ALL :’’( and i don’t know why, i dind’t change anything! It suddendly stopped working between two sketch uploading on the arduino.

I’m going to be crazy!!! Connections on the breadboard seems to be solid, and the stepper is like if it’s disconnected!

I am not sure what would cause you to have to reconnect the reset and sleep pins after reconnecting power to your driver. However, the minimum operating voltage for most Arduinos is 7V, so you should probably use a supply of at least 7V to power your Arduino. In addition, we do not recommend the USB cable and external power be connected to the Arduino at the same time, since doing so could cause current to flow into the USB port on your computer.