Introduction: Controll a Stepper Motor With the DRV8825
In this simple tutorial, I'll show you how to use the DRV8825 to control a bipolar stepper motor and how to use the micro stepping feature.
Step 1: Component List
Parts you'll need:
- A bipolar stepper motor ( capable of +9V input )
- The DRV8825
- An Arduino
- 100µF electrolytic Capacitator
Tools you'll need:
- A breadboard
- Some Jumpwires
- A Power supply
- A multimeter
Step 2: The DRV 8825
The DRV8825 is a simple but very powerful board that can control one bipolar stepper motor at the time and allows micro stepping up to 1/32 of a step.
- VMOT: Power supply for the motor ( from 8.2- 40V)
- GND: Ground for the motor
- B1 & B2: Pins for the first coil of the stepper motor.
- A1 & A2: Pins for the second coil of the stepper motor
- GND: Ground of the board
- DIR: Direction of the motor has to be high for clockwise and low for a counterclockwise spin.
- STEP: when this pin is high the motor spins one step further.
- SLEEP (inverted): Puts the motor in a sleeping state when HIGH
- RESET (inverted): Restarts the board when HIGH
- M2, M1, M0: Pins for the micro stepping
- Enable (inverted): Disables the Board when HIGH
Step 3: Connenting the Parts Togehter
In this step, I'll describe to modes for this stepper motor. The first one is very simple and the second one is when you want to do more complicated stuff ( micro stepping).
Connect the parts as shown in the picture. please ignore the SLEEP and the RESET pin. You can use any Digital pins on the Arduino. be sure to change them in your code too.
- DIR - D8
- STEP - D9
- SLEEP - HIGH (Vdd)
- GND - Arduino GND
- GND - Motor power GND
- VMOT - Motor power (check driver-specific voltage range)
- A4988/DRV8825 micro step control
- MS1/MODE0 - D10
- MS2/MODE1 - D11
- MS3/MODE2 - D12
Please ignore the RESET and the SLEEP PIN.
Step 4: Code
Code for Mode 1: please use the blink.ino
For step 2 please use the example code from this Library:
Good Luck and Have Fun!
Project by Alex Ghiriti and Marcel Büche
We have a be nice policy.
Please be positive and constructive.