Loading Items

About This Project

Interested in getting your first stepper motor spinning with arduino? Follow along with this project and we'll help you get a NEMA 17 stepper motor spinning with a TI DRV8825 Motor Driver.
Request Access

Project Info

Skills

  • Arduino
  • Programming
  • Soldering
  • Wire Stripping
  • Wiring
  • Overall

Meet The Makers

Join Team
  • Riley.Purvis
    • User:Riley.Purvis
    • Rank:Master Apprentice
    • Projects:12
    • Joined:2017
    • From:US
  • xjoexripx
    • User:xjoexripx
    • Rank:Master
    • Projects:31
    • Joined:2016
    • From:US
  • James
    • User:James
    • Rank:Master
    • Projects:30
    • Joined:2016
    • From:US
    Interests: Systems Architect. Love making robots and systems with moving parts.
  • richardsbabu

No Comments yet. Why don't you add one?

.Demonstrational Video


.Pre-Project Work

The power supply listed in the parts tab will need modification done to it. If you find that these modifications are above your level of knowledge, you can easily find a 12v power supply capable of being wired into a breadboard.
Grab the un-modded power supply

12V 7.5A Power Supply with USB
12V 7.5A Power Supply with USB




Now cut off the end of the power supply with the cigarette lighter. You will notice that there are two wires. The first is the wires in the middle, and around this wire is shielding. This will be isolated soon. But first we need to extract the other wires which can be found around the shielding in a circular pattern. Strip the wire until the circular wire can be collected, and twisted into one thick wire. Make sure that this twisted wire has as much distance from the wire still surrounded by shielding. You will then need grab conductive metal wire (which can be found in most breadboardable wires) and place this wire into the middle of the wires. Twist the wires from the cord around this conductive metal wire and then solder over the wires to act like a "glue". Once the wire has been secured, grab heat shrink tubing and place the newly soldered wire into the tubing. Now begin heating the heat shrink so it wraps snuggly around the exposed wire.

You will now need to remove the remaining shielding, and do the same as above for the newly exposed wires.

Once both wires have been properly isolated and soldered into place, grab electrical tape and cover any unwanted wire. You should now have two neatly exposed conductive metal wires that can be placed into a breadboard!

.Wiring the Circuit

You will first want to grab your breadboard
Breadboard
Breadboard


As well as your DRV8825 Motor Driver Module
DRV8825 Stepper Motor Driver Module Item Number: DRV8825 Stepper Motor Driver Module
DRV8825 Stepper Motor Driver Module
  • Item #:DRV8825 Stepper Motor Driver Module
  • Est. Cost:$10.69
  • Buy At:


And place your Motor Driver in the breadboard such that the Motor Driver is in the middle of the crease in the breadboard. See below for an example


The reason for doing this, is that we want each pin on the Motor Driver to be independent of the rest. If two pins are in the same row on the breadboard, more likely than not, you will find that your circuit is malfunctioning.

Now you will want to grab your Arduino Uno
Arduino Uno
Arduino Uno


And your Male-to-Male wires
M/M Jumper Wires
M/M Jumper Wires
Then you will need to connect pin 3 of the Arduino Uno to the DIR pin on the Motor Driver. Then connect pin 5 of the arduino to the STP pin on the Motor Driver. We are connecting these pins to the Arduino as we will be sending signals from the arduino to the Direction pin, and the Step pin.
Once you have wired pins 3 and 5, you will then wire 5V from the arduino to the breadboard by connecting it to one of the power strips. When you are done your circuit should look like below.


Now grab your stepper motor
Stepper Motor Item Number: Nema 17
Stepper Motor
Drawings

Drawings

Updated 11/01/2016 by James
Specifications

Specifications

Updated 11/01/2016 by James
Solidworks

Solidworks

Updated 11/01/2016 by James


Next you will want to wire the stepper motor to the Motor Driver. You may notice that your Motor Driver has a different orientation of 1A, 1B, 2A, 2B than our example. If this is the case, you will need to follow the color coding.
Here is the wiring key
{stepper motor, Motor Driver}
{Black, 1A}
{Green,2A}
{Red,1B}
{Blue,2B}

Here is an example of how the stepper should be wired due to color coding.


Next you will need to hard wire some of the remaining ports on the Motor Driver. Please keep in mind that not all of the ports need to be wired. Some ports can be left alone.

You will need to wire both GND ports on the Motor Driver to ground. Then the port labelled VMT will need to be wired to the power strip that has not been powered by the Arduino's 5v, as we will be supplying 12v to this strip soon. And the STP and SLP pins both need to be wired to the 5v power strip. Your circuit should similar to the picture below


Now you will want to grab your 12V power supply, and plug the powering wire and the grounding wire into the unused power strip. Make sure that you place these wires in their appropriate strip. Also be aware that common ground is needed for this circuit, and so we have not provided grounding from the arduino. All grounding is through the 12v power supply. Now your circuit is complete! Your circuit should look similar to below, but keep in mind that we are using the battery to signify a 12V power source. We are not using an AA battery!

.Schematic Diagram


.Flashing Code to The Arduino

Plug your Arduino into your laptop/computer, and open up the Arduino IDE. The IDE can be found in the files for the Arduino Uno.
Arduino Uno
Arduino Uno


You will then be able to copy-and-paste the following code into the Arduino IDE.
const int DIRPin = 3;
const int STPPin = 5;

void setup()
{
  pinMode(DIRPin, OUTPUT);
  pinMode(STPPin, OUTPUT);

  digitalWrite(DIRPin, LOW);
  digitalWrite(STPPin, LOW);
}

void loop()
{
  analogWrite(STPPin, 128);
}

Now you are almost done with the project! Before you are able to flash the code to the arduino, you will have to go to tools>Board>Arduino Uno. If you are using a different model of Arduino, choose that board instead. Likewise, you will need to go to tools>Port>Portx if you have an arduino plugged in you should see the correct COM already listed for you.

Now you are able to upload the code to the Arduino by hitting the right arrow button right above your code.
Now your motor should start spinning if both the Arduino and 12V are connected properly. Enjoy!
  Details Downloads Size Get it

DRV8825 User Manual

Last updated on 08/11/2017

by xjoexripx

238 -

Stepper_Motor Code

Last updated on 07/31/2017

by xjoexripx

256 222b

Stepper Motor Fritzing

Last updated on 07/28/2017

by xjoexripx

238 5kb
Qty   Item Where to Find Est. Cost More Info
1 Arduino Uno

Arduino Uno

$16.06 3 links  
DRV8825 Stepper Motor Driver Module Item Number: DRV8825 Stepper Motor Driver Module

DRV8825 Stepper Motor Driver Module

Item #: DRV8825 Stepper Motor Driver Module

- Simple step and directi

$10.69 2 links  
1 Stepper Motor Item Number: Nema 17

Stepper Motor

Item #: Nema 17

Product Features 3D print

$15 3 files  
 
Drawings

Drawings

Updated 11/01/2016 by James
Specifications

Specifications

Updated 11/01/2016 by James
Solidworks

Solidworks

Updated 11/01/2016 by James
1 12V 7.5A Power Supply with USB

12V 7.5A Power Supply with USB

$36
1 Breadboard

Breadboard

$6
1 M/M Jumper Wires

M/M Jumper Wires

$2.06
1 Wire Strippers

Wire Strippers

$18.97
1 Wire Cutters

Wire Cutters

$8.49
lighter

lighter

$9.20
Heat Shrink 3/16" - 3/32"

Heat Shrink 3/16" - 3/32"