How to control stepper motor with Arduino UNO + CNC shield v3 + A4988

Hello,

I am trying to build a locomotion robot that utilizes the following components:

  • Arduino UNO R3
  • CNC Shield v3
  • 2 NEMA 17 stepper motors (that drive 2 wheels)
  • 2 A4988 stepper motor drivers

It should be simple enough, except that the guides that i have found online relate to using the CNC shield for a CNC printer and ask me to download and install Grbl Controller. But i don't need it for that purpose! So, i hope someone will help on how to make this work? :confused:

I have placed the CNC shield on top of the Arduino UNO R3 and placed the 2 stepper motor drivers correctly with the ENABLE pins aligned.

I do not know if powering the Arduino directly via the Power plug with 6xAA batteries (9 V) will make the stepper motors work? Or do i need to connect both the Arduino to a power source as well as the CNC shield (the blue ports where it's written "12-36 V")? Won't it fry my components if i use 2 power sources?

Please display your image(s) in your post so we can see it(them) without downloading it(them). See this Simple Image Upload Guide

If you connect everything as if you were using GRBL then it should be perfectly possible to control the motor without GRBL. All you need to know is which Arduino pins are used for Step and Direction for the motors.

You may also need to set the values for the Enable pins, but I can never remember whether HIGH is on or off.

...R
Stepper Motor Basics
Simple Stepper Code

Power the Uno with the 6 AA batteries through the Vin or power jack (power jack is better). Power the CNC shield through the blue terminal block on the CNC shield (12-36V). The power to the shield only powers the motors. All of the 5V connections on the shield comes from the Uno 5V.

Here is the Uno to CNC shield V3 pin mapping.

uno cns shield pinout.jpg

Make sure to set the current limits on the Stepper drivers before using the shield.

You may also need to set the values for the Enable pins, but I can never remember whether HIGH is on or off.

The enable pin [pin 8] should be set LOW to enable the steppers.

1 Like