Download Print this page

AZ-Delivery DRV8825 Instructions Manual

Stepper motor driver

Advertisement

Quick Links

Welcome!
Thank you very much for purchasing our AZ-Delivery DRV8825 Stepper
Motor Driver. On the following pages, we will introduce you to how to use
and setup this handy device.
Have fun!

Advertisement

loading
Need help?

Need help?

Do you have a question about the DRV8825 and is the answer not in the manual?

Questions and answers

Roland
January 20, 2025

In the sketch for the DRV8825, the pin numbers of "step" and "dir" are swapped. With this sketch and the wiring given, the stepper motor does not work properly.

Summary of Contents for AZ-Delivery DRV8825

  • Page 1 Welcome! Thank you very much for purchasing our AZ-Delivery DRV8825 Stepper Motor Driver. On the following pages, we will introduce you to how to use and setup this handy device. Have fun!
  • Page 2 Areas of application Education and teaching: Use in schools, universities and training institutions to teach the basics of electronics, programming and embedded systems. Research and development: Use in research and development projects to create prototypes and experiments in the fields of electronics and computer science. Prototype development: Use in the development and testing of new electronic circuits and devices.
  • Page 3 consult a doctor. Caution: Keep the product out of the reach of children and pets to avoid accidental contact and swallowing of small parts. Note: Store the product in a safe, closed container when not in use. Attention: Avoid contact of the product with food and drinks.
  • Page 4 Stepper motor, or step motor is a type of motor where shaft of the motor rotates in steps. The stepper motor is a DC motor without brushes, namely a brushless DC motor. Moving the shaft in steps is very useful because the shaft can be positioned very precisely without any feedback position measurement.
  • Page 5 Driving modes of stepper motors To drive the stepper motor, there are several driving modes, or excitation modes: » Wave drive mode, in this mode we activate just one coil of the stator at a time, then the next one, and so on. In this mode, only one coil is activated, and to move the rotor to the next step, we turn on coils one by one consecutively.
  • Page 6 Another way of increasing the resolution of the stepper motor is by increasing the number of poles of the rotor and the number of poles of the stator. Image is taken from wikipedia article about stepper motors. https://en.wikipedia.org/wiki/Stepper_motor...
  • Page 7: Stepper Motor Drivers

    So we need a driver electronic circuit for every stepper motor. In this eBook we will cover one of these devices, which is called "DRV8825 stepper motor driver". This device can control the rotational speed and spinning direction of motor shaft, and can drive stepper motor in several excitation modes.
  • Page 8: Specifications

    16 x 21mm The driver requires only one power supply connections. This module does not have any logic power supply pin as "DRV8825" chip gets its power from the internal 3.3V voltage regulator. However, you should connect your microcontroller’s ground with GND LOGIC pin.
  • Page 9 One way to protect the driver from such spikes is to put a large 100µF electrolytic capacitor (or at least 47µF) across the power supply pins of the motor. DRV8825 pinout...
  • Page 10 “NEMA17” stepper motor, it has a 1.8° step angle or 200 steps per revolution; in quarter step mode, the motor will give 800 microsteps per full revolution. The DRV8825 driver has three microstep resolution selector inputs pins: » MS1 » MS2 »...
  • Page 11 Difference between microstepping and full step modes Microstepping excitation modes are all modes where the shaft of the motor moves between the hardware steps. These modes position shaft of the motor in between the steps, creating more steps, and smooth motion of the shaft.
  • Page 12 Step and direction pins STEP input pin controls the steps of the motor. Each HIGH pulse sent to this pin, steps the motor by number of microsteps set by microstep selection pins. The faster the pulses, the faster the motor will rotate. DIR input pin controls the rotation direction of the motor shaft.
  • Page 13 Power enabling pins EN pin, when pulled LOW the driver is enabled. By default this pin is pulled LOW so the driver is always enabled, unless you explicitly pull it HIGH to disable the driver. SLP pin, pulling this pin LOW puts the driver in sleep mode, minimizing the power consumption.
  • Page 14: Output Pins

    Fault Detection Pin The driver also features a FAULT output pin. This pin is LOW whenever the internal H-bridge FETs inside “DRV8825” chip are disabled as the result of over current protection or thermal shutdown. Actually the FAULT pin is shorted to SLEEP pin so, whenever the FAULT pin is driven LOW, the whole chip is disabled.
  • Page 15 Stepper motors in general have similar names for its wires. But wire names are different for different manufacturers. Here are some examples of different wire names, and how those wires are connected with DRV8825 driver: Stepper motor pins >...
  • Page 16 1.5A per coil without getting overheated. For achieving more than 1.5A per coil, a heatsink or other cooling method is required. The DRV8825 driver module comes with an aluminum heatsink. It is advisable to install it before using the module.
  • Page 17 There is a small trimmer potentiometer on the DRV8825 driver that can be used to set the current limit. In order to set the current limit, you need to follow the next steps: »...
  • Page 18 Connecting the driver with microcontroller Connect the driver with your microcontroller like on connection diagram below: Driver pin > Microcontroller pin RESET > 5V Red wire SLEEP > 5V Red wire GND LOGIC > GND Black wire STEP > D3 Cyan wire >...
  • Page 19 REMEMBER to put a large 100µF decoupling electrolytic capacitor across motor power supply pins, as close to the board as possible, like on connection diagram above. Keep the microstep selection pins disconnected to operate the motor in full step mode, or connect appropriate MS pin to the VCC voltage, to operate in different excitation mode, like we discussed.
  • Page 20 Arduino-IDE code: uint8_t stepPin = 2; uint8_t dirPin = 3; steps = 1000; // you should increase this if you are using // some of microstepping modes usDelay = 950; // minimal is 950 for full step mode and NEMA15 motor // minimal is 35 for sixteenth step mode void setup() {...
  • Page 21 We start the sketch with defining the STEP and DIR pins that are connected to our microcontroller. We define a variable called steps which we use for the number of steps for the motor shaft. In the setup function, we declare STEP and DIR pins as digital outputs.
  • Page 22 Connecting the driver with Raspberry Pi Connect the driver with your Raspberry Pi like on connection diagram below: Driver pin > Raspberry Pi pin > 3.3V [pin 17] Red wire > GND [pin 30] Black wire STEP > GPIO17 [pin 11] Cyan wire >...
  • Page 23 Like for microcontroller board with Atmega328P, we do not need to install any libraries for this driver module. We will only create our Python script. Here is the code: from time import sleep import RPi.GPIO GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) STEP # step pin # direction pin # enable pin GPIO.setup(STEP, GPIO.OUT)
  • Page 24 We just transformed sketch into Python code. The only difference is the code for EN pin. This is the pin for enabling the driver. If it is pulled LOW, the driver is enabled, and if it is pulled HIGH, the driver is disabled. We need this because, DIR and STEP pins are floating, and if we end the script without connecting these pins to GND or VCC, driver would go crazy, and the shaft of the motor starts moving weird.
  • Page 25 If you are looking for the high quality microelectronics and accessories , AZ-Delivery Vertriebs GmbH is the right company to get them from. You will be provided with numerous application examples, full installation guides, eBooks, libraries and assistance from our technical experts.