Gogo:Tronics - Parts and Supplies For Electronic Enthusiasts
Your Cart

Gogo:Tronics

StepStick Stepper Driver

Essentially this board is a breakout for the A4988 Microstepping Driver.  

Please read the datasheet here: http://www.allegromicro.com/~/media/Files/Datasheets/A4988-Datasheet.ashx?la=en

You can drive a stepper in full stepping, 1/2, 1/4, 1/8 and 1/16th step modes (if you don’t know what this means, you should google Microstepping)

The inputs are simply a step (each pulse causes a step/microstep), and a direction high or low for forwards/backwards (for varying definitions of forwards and backwards).

A couple notes on the breakout:

  • The SLEEP pin is pulled high on the breakout, this pin is active low, so by default the board is NOT sleeping.
  • The RESET pin is floating on the breakout (not pulled high or low), you can simply connect this to the SLEEP pin if you want, otherwise you will want to (so it will be pulled high also), or control it as you wish.
  • The ENABLE pin is pulled low on the breakout, this pin is active low, so by default the board IS enabled.
  • The MS1/2/3 pins are internally pulled down in the A4988, so by default all are low, and the board is in full step mode.

Basic Arduino Usage

Do not connect/disconnect motor, or driver while power is connected, you’ll fry it!

  1. Connect Arduino D4 to STP input 
  2. Connect Arduino D8 to DIR input
  3. Connect Arduino Vcc (5v or 3v3) to VDD 
  4. Connect Arduino GND to GND
  5. Connect motor power positive (8 to 35v) to VMOT
  6. Connect motor power GND to GND
  7. Connect the motor’s coils across 1A/1B (coil 1) and 2B/2A (coil 2)
  8. Connect the RST and SLP pins on the StepStick together.

Troubleshooting

Most often, the problem comes down to power, or rather, not enough of it.  Make sure you are powering the board correctly, giving the VMOT pin a high voltage (8 – 30v) and that the motor power ground and your microcontroller power grounds are common – if in doubt, see the above diagram!

Adjusting the trimpot will adjust the current to the coils, once you have it stepping, adjust this to provide more torque/holding power to the motor.

The RepRap Wiki has a  description of measuring the actual set current (on a different version of the board but process should be the same).


Example Arduino Code Follows

int dirPin = 8;
int stepperPin = 7;
void setup() {
 pinMode(dirPin, OUTPUT);
 pinMode(13, OUTPUT);
 pinMode(stepperPin, OUTPUT);
}

void step(boolean dir,int steps){
 digitalWrite(dirPin,dir);
 delay(50);
 for(int i=0;i<steps;i++){
   digitalWrite(stepperPin, HIGH);
   delay(1);
   digitalWrite(stepperPin, LOW);
   delay(1);
 }
}

void loop(){
 digitalWrite(13, HIGH);
 step(true,1600);
 delay(500);
 digitalWrite(13, LOW);
 step(false,1600*5);
 delay(500);
}