Description
EasyDriver - Stepper Motor Driver - SparkFun ROB-12779
The EasyDriver is a simple to use stepper motor driver, compatible with anything that can output a digital 0 to 5V pulse (or 0 to 3.3V pulse if you solder SJ2 closed on the EasyDriver). The EasyDriver requires a 6V to 30V supply to power the motor and can power any voltage of the stepper motor. The EasyDriver has an onboard voltage regulator for the digital interface that can be set to 5V or 3.3V. Connect a 4-wire stepper motor and a microcontroller and you’ve got precision motor control! EasyDriver drives bi-polar motors, and motors wired as bi-polar. I.e. 4,6, or 8 wire stepper motors.
This EasyDriver V4.5 has been co-designed with Brian Schmalz. It provides much more flexibility and control over your stepper motor when compared to older versions. The micro-step select (MS1 and MS2) pins of the A3967 are broken out allowing adjustments to the micro-stepping resolution. The sleep and enable pins are also broken out for further control.
Features:
- A3967 Microstepping Driver
- MS1 and MS2 pins broken out to change the micro-stepping resolution to full, half, quarter, and eighth steps (defaults to eighth)
- Compatible with 4, 6, and 8 wire stepper motors of any voltage
- Adjustable current control from 150mA/phase to 700mA/phase
- Power supply range from 6V to 30V. The higher the voltage, the higher the torque at high speeds
EasyDriver Schematic:
Connecting to an Arduino:
The EasyDriver is very easy to connect and use with your Arduino. You'll need a 12V source to the EasyDriver (assuming you're using a 12V stepper motor such as this one). Which ever PSU you go with, it is important to ensure that it is rated at least 750mA. A higher rating is better and just means it is less likely to burn out.
Connect the stepper motor as shown below to the EasyDriver – The red/green are one pair, and the blue/yellow are another. Lastly connect the 3 wires from the “gnd”, “dir”, and “step” of the EasyDriver to the Arduino as shown.
Example Code for Arduino Uno connected to EasyDriver:
[code language="arduino"]
// use rotate and / or rotateDeg to control your stepper
// speed is any number from 0.01 -> 1 with 1 being fastest –
// Slower speeds will give you a stronger movement
//
#define DIR_PIN 2
#define STEP_PIN 3
void setup() {
pinMode(DIR_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
}
void loop(){
rotateDeg(360, 1); //rotate a specific number of degrees
delay(1000);
rotateDeg(-360, .1); //reverse
delay(1000);
//rotate a specific number of microsteps (8 microsteps per step)
//a 200 step stepper would take 1600 micro steps for one full revolution
rotate(1600, .5);
delay(1000);
rotate(-1600, .25); //reverse
delay(1000);
}
void rotate(int steps, float speed){
//rotate a specific number of microsteps (8 microsteps per step) – (negitive for reverse movement)
//speed is any number from .01 -> 1 with 1 being fastest – Slower is stronger
int dir = (steps > 0)? HIGH:LOW;
steps = abs(steps);
digitalWrite(DIR_PIN,dir);
float usDelay = (1/speed) * 70;
for(int i=0; i < steps; i++){ digitalWrite(STEP_PIN, HIGH); delayMicroseconds(usDelay); digitalWrite(STEP_PIN, LOW); delayMicroseconds(usDelay); } } void rotateDeg(float deg, float speed){ //rotate a specific number of degrees (negitive for reverse movement) //speed is any number from .01 -> 1 with 1 being fastest – Slower is stronger
int dir = (deg > 0)? HIGH:LOW;
digitalWrite(DIR_PIN,dir);
int steps = abs(deg)*(1/0.225);
float usDelay = (1/speed) * 70;
for(int i=0; i < steps; i++){ digitalWrite(STEP_PIN, HIGH); delayMicroseconds(usDelay); digitalWrite(STEP_PIN, LOW); delayMicroseconds(usDelay);
} }
[/code]
Documents:
- A3967_Datasheet (Microstepping Driver)
Notes:
- Do not connect or disconnect a motor while the driver is energized. This will cause permanent damage to the A3967 IC.
- This product is a collaboration with Brian Schmalz. A portion of each sale goes back to them for product support and continued development.
1 Review
-
Title of review 1018
Does exactly what it syays on the box. Fast turnaround, this is a company I'd use again with no hesitation, over and above others!