Unable to move stepper Motor (Aurdino Mega + CNC Shield + DRV8825)

Hello all,

First of all I would like to say that I am totally newbie in Aurdino and CNC, but in last week I can say that I have learned a lot but the problem is that I have still not managed to make any movement on my stepper motor. I have following configuration:

  1. Aurdino Mega 2560
  2. CNC Shield V3.00
  3. DRV8825 Stepper Motor Driver Carrier, High Current
  4. Stepper motor - Sanyo Denki 103-547-52500
  5. Power supply - 12V DC, 3.0A 36W Max
  6. Grbl Software - GRBL-Arduino-Library-master
  7. UniversalGcodeSender

I have connected CNC Shield (with DRV8825 drivers) to the Arduino Mega and supplied it with 12V power supply. I have connected my stepper motor to the CNC shield (plugged the connector onto the 4 pins nearby drivers) and connected Arduino via USB to my laptop.
I have installed GRBL library to Arduino, and when I start the G-Code sender I am able to get blinking lights from arduino which means I am well connected to the Arduino mega.

But my problem starts here. When I try to jog/move X, Y or Z aches (no matter where I plugg in my motor) I do not get any kind of movement, nor sound. I get nothing.

I have measure if there is a current/power in cnc shield and on the power supply and also on drivers I can measure that there is current/power on it. Also on my software I get confirmation that the signal is sent and received but I get no movement on my stepper motor.

I really do not know what else should I do and I really hope that someone could help me and give me something so I could be able to finally move my motor. Thak you all a lot in advance :slight_smile: .

In attachment is the photo of how it all looks like.

It would be helpful to get a clearer picture of your schematics based on a handwritten sketch so showing all connections amongst the devices. Is the ENABLE pin connected between driver shield and Arduino? As I don't know that shield I don't know if it is automatically connected when putting the shield upon the Mega. GRBL is using ENABLE to put the motors in sleep mode when they are not moving - thus reducing power consumption and cooling down the drivers.

You can test your motor also without GRBL (it can still remain in the Arduino EEPROM) by loading a "normal" Arduino sketch. Thus you can make sure that Arduino and driver work together. If that works you can go and use GRBL. There are some examples - if I have time I will look if I can find some.

It would be helpful if you could provide a (handsketch is ok) schematics of your configuration. Did you make sure that the motor is wired correctly with its two coils to the driver?

This Simple Stepper Code can be used for testing. It should work fine with a DRV8825 assuming it is connected as in the Pololu wiring diagram.

Yours seems to be a 6-wire stepper motor. Are you sure you have it connected properly? To operate as a bipolar (4-wire) motor you should not have anything connected to the wires that are the centre taps for the two coils.

Have you correctly adjusted the current-limiting potentiometer on the DRV8825?

...R Stepper Motor Basics

i think the problem might be that GRBL by default is set to be used on Arduino UNO and you are using Arduino MEGA, u got to enable it on config.h files for Arduino MEGA, also for arduino Mega de pins layout are diferent then what you are using.

First of all I would like to thank you all on your replies :slight_smile: It finally helped me to move further one step.

  1. @meph328 first of all as you suggested I tried to check if this software issue (Grbl compatibility with Aurdino Mega) could be the problem. So I found the libraries that should support Aurdino Mega here (Grbl-xx_with_Arduino) and instructions from zapmaker about how to install it (http://zapmaker.org/arduino/programming-hex-file-on-mega2560/). After doing what has been written on the site and connecting all things again (Aurdino Mega + CNC Shield + Comp/USB + Stepper Motor) i finaly get some sound from my motor but still when I try to move it with software (either Grbl Controller 3.0 or UniversalGcodeSender) I do not get any kind of movement. So with this I was not able to solve my problem.

  2. @rpt007 and @Robin2

I have connected my CNC Shield board directly to Arduino Mega and there is only one possibility how to do it (so the pins are able to get into arduino board), so I think that this part is connected correctly.
Also the drivers (DRV8825) are plugged in the right direction on CNC Shield board.
According to schematic from DRV8825 drivers, I have plugged my 4-pin female connector from one side to the cnc shield board as follows:
A2 - Red Wire
A1 - Black
B2 - White
B1 - Yellow

and from the other side (4 male connectors) according to the specification from my stepper motor and description from DRV8825:

Red(A2) - Blue
Black(A1) - Orange

White(B2) - Red
Yellow(B1) - Yellow

Black and White are not connected.

  1. @Robin2 Correctly adjusting the current-limiting potentiometer on the DRV8825

About this part I am not really sure if I have understood it correctly and if my calculations are right.
I think that for this motor the current limit pro phase is 0,6 A and equation should be:

Current Limit = VREF × 2

VREF = 0,33

Am I right???

In attachment I am sending a few additional photos how I connected everything.

Thank you all for your help once again.








AWS_Support: It finally helped me to move further one step.

You have two parts in your Reply which seem to be separate from each other so I am not sure what "step" you are at now and what further questions you have.

I think your current setting is correct.


I mean that I finaly hear something form my motors (like buzzing) before I did not hear anything. But still whatever I do in programm I am not able to move motors :(

If the output current limit is ok and the remaining logic wiring is ok, then there might be either a problem with the drv8825 - sometimes you fry them by experimenting around and they get killed when you remove a motor wire while they are powered up.

To exclude this, repeat your tests with one or two of the remaining drv8825 which you didn't connect with the one motor in your setup so far.

If you get the same "noise" result, maybe the wiring of the motor is still not ok. You must make sure that you connect the two coils to the right connections of the driver.

If you have no meter to measure the coil resistance there is an easy way to see what coil pairs belong together, by turning (the motor may not be connected to the drv8825!) the shaft of the motor with the motor wires all "open". Then connect with one hand the two wires which you think belong to one coil and turn the shaft with your other hand again. If you feel remarkable more resistance than before, then these two wires lead to one coil. Repeat the experiment to find the second pair.

Then connect those two pairs with the drv8825 - for the time being you should not pay attention if you connect wire1 with A1 or A2; just make sure that one coil pair is connected with one output and the second coil pair with the other output of the drv8825. Later, if you are not happy with the default turning direction, you can re-wire either ONE of the coil pairs by exchanging, let's say A1 with A2 to reverse the default direction of the motor.

But for now it is most important to get the motor move.

Go back to basics, setup the DRV8825 to be directly driven from the Arduino and use the AccelStepper library to check it out and only then consider integration - get each piece of the puzzle into a known working state before combining them, its the only sane approach.

MarkT: Go back to basics, setup the DRV8825 to be directly driven from the Arduino

I agree. Just wire it up as in the Pololu wiring diagram. At the moment there are two many unknowns to be able to help effectively.


Once again I have to thank you all for your kind help :)

@MarkT, @Robin2 as you suggested I used AccelStepper library and tried MultiStepper and MultipleSteppers examples and finally my motor stared to move :) :) :) Big big thanks :)

So the wiring and driver adjustements are correct. Now it would be nice if I could be able somehow to move my motors manualy. Can someon please give me any advice?

Also from all other examples I have managed to make movement only with that two examples.

Thank you a lot once again ;)

AWS_Support: Can someon please give me any advice?

Yes. Post the working program and explain what changes you want to make to it.


It comes down to how the different programs set the pins high or low.

For simple Arduino code, you would use the digitalWrite function. But this doesn't simply set the output to the desired state. Instead it looks up the pin, checks if it is capable of PWM or a timer, disables that if necessary, and then uses the port and a mask to set the output high or low. Each of these operations take time and thus slow the program down. It also means each pin needs to be done separately, so if you are having it step in x and y, it will need to step x, and then y, or y then x.

GBRL does it much faster and together, but requires the step pins to be on the same port. First it calculates the mask, and then it applies it to the port, changing all the step outputs at once.

The issue is how the ports are mapped on the different arduinos. The ports are how the microcontroller handles the inputs and outputs, and don't necessarily map nicely to the pins on the arduino board.

For the step pins for the CNC sheild, they are digital pins 2, 3 and 4.

For the UNO, that corresponds to pins 2, 3 and 4 of port D. So that works fine. (Port D is digital 0-7, port B is 8-13, port C is analogue 0-5).

For the Mega, it is a different story. Digital pin 2 and 3 correspond to pin 4 and 5 of port E and then pin 4 if pin 5 of port G.

Assuming you haven't changed any of the code, it is still sending the step pins to the pins on port D. This means for the MEGA they are going to pins 19, 20 and the abyss (i.e. not connected). As such, the steppers aren't recieving the step signals.

The same issue applies for the end-stops and the dir pins.

So you either need a different shield, a different board (e.g. uno instead of mega), a different program, or rewire the connection between the shield and the board.

One option would be the large header at the bottom (pins 22-29 are all port A, pins 37-30 are all port C, but backwards so pin 37 is pin 0 of port C and pin 30 is pin 7 of port C).

Hi. is there any chance you could share your code. i have exact the same equipment. trying to turn three steppers. but have problems with the code.

behnamandi: Hi. is there any chance you could share your code. i have exact the same equipment. trying to turn three steppers. but have problems with the code.

Have you already tried the suggestions throughout this Thread?

If so. please post the program that represents your best attempt.


JackBlack: Thank you so much!
I struggled a long time with 103-547-52500 and DRV8825 (not on a shield -wired to my Arduino lossely). In the end it was as simple as changing the pins from Arduino to DRV8825! Thanks!
So on Arduino UNO I get it to work correctly with the following test code:

// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing

byte directionPin = 2;
byte stepPin = 3;
int numberOfSteps = 200;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 250; // milliseconds - or try 1000 for slower steps

void setup() { 

  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
    digitalWrite(stepPin, LOW);
    digitalWrite(ledPin, !digitalRead(ledPin));

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    // delayMicroseconds(pulseWidthMicros); // probably not needed
    digitalWrite(stepPin, LOW);
    digitalWrite(ledPin, !digitalRead(ledPin));

void loop() { 

and wiring as AWS_Support did:
Red(A2) - Blue
Black(A1) - Orange

White(B2) - Red
Yellow(B1) - Yellow

Hi AWs support..have u succeed? Try few things if u r using GRBL CONTROLLER, disable soft limits and hard limits by enterin$ and the corresponding number =0 n enter for both, then , go to visualition panel unlock grbl and first moove z axis up then try to jog other axis..it should work.. before that if u insert all three drivers then u must attach all 3 motors to respective ports like xyz..then try.. Regards n enjoy

hi have u overcome with the problem of moving the steppers? hope its resolved. if not do as follows 1 connect all 3 motors to shield,if u have installed all 3 drivers. if u want to test single motor then install only one driver. 2 connect the arduino to your computer , and open the GRBL CONTROLLER 3 if every thing is correct like port and baud rate your grbl controller must show the configurations like $=.. $2=... and so on in this config u ll see $21=xx $21=xx $22=xx change them to $20=0,$21=0,$21=1 go to grbl controls visualisation panel, unlock grbl by clicking unlock, jog z axis up,and then try jogging other axis, your motors should move. try it n enjoy regards

Hello Arduino mega does not work with this driver. It needs to be involved like this. Good luck.