Adafruit Motor Shield Kit for Arduino

motor shield

Today I was thinking about a drawbot type machine so I went to my parts bin to see what sorts of steppers are there. I found two nice ones with a built in gear box.

I’ve have a Motor Shield that I bought Robotshop.ca which can control two servos and either 4 DC motors or 2 stepper motors.

I’ve experimented with operation of servos in the past but today I decided to get it working with a couple of stepper motors.

The manual (which I got from Robotshop’s Web site today) says to put the stepper library (AFMotor folder) into the “arduino/hardware/library” directory. This didn’t work. I moved the folder to the “arduino/libraries” folder and it worked.

I opened the arduino environment then opened the sample program in libraries/AFMotor/Examples/StepperTest which is called StepperTest.pde.

I made a few modifications:

#include 

AF_Stepper motor(48, 1);
AF_Stepper motor2(48, 2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Stepper test!");

  motor.setSpeed(300);  // 10 rpm   
  motor2.setSpeed(300);
}

void loop() {
  //Serial.println("Single coil steps");
  //motor.step(10000, FORWARD, SINGLE); 
  //motor.step(100, BACKWARD, SINGLE); 

  //Serial.println("Double coil steps");
  //motor.step(10000, FORWARD, DOUBLE); 
  //motor.step(100, BACKWARD, DOUBLE);

  //Serial.println("Interleave coil steps");
  motor.step(1000, FORWARD, INTERLEAVE); 
  motor.step(1000, BACKWARD, INTERLEAVE); 
   motor2.step(1000, FORWARD, INTERLEAVE); 
  motor2.step(1000, BACKWARD, INTERLEAVE); 

//#ifdef MICROSTEPPING
//  Serial.println("Micrsostep steps");
//  motor.step(100, FORWARD, MICROSTEP); 
//  motor.step(100, BACKWARD, MICROSTEP); 
//#endif

}

I used a 13.5V supply to power the motor shield and a 6V supply to power the arduino.

The steppers get pretty warm. I’m suspecting they may be happier if I add a lower voltage for the shield power.