# How can I drive a NEMA 17 stepper with a raspberry pi

I purchased a NEMA 17 stepper motor for a small home project, and I want to drive it off a Raspberry Pi.

I purchased a DRV8825 Stepper Motor Driver Carrier thinking that it would drive the stepper, but I think I got the wrong thing. The motor driver looks like it needs a higher voltage than I want to provide to the stepper, so I'm worried it would fry my stepper if I hooked it up to a higher voltage power supply.

A tutorial I found recommends using a L293D IC to drive a stepper, and I can follow these instructions, but I'm not confident that the directions will apply to my stepper.

I'm a total newb at electronics, so anyone that can point me at what the best way to drive this stepper would be my hero.

• The motor is rated at 1.2A. You have to set up current limiting on the DRV8825 to avoid damaging the stepper (or the IC before that). Any voltage that your IC can handle will be fine for the stepper, provided the current is limited. 12V and 24V are common values. – Wesley Lee Feb 19 '17 at 3:40
• p.s.: look up 3D printer assembly tutorials, they are quite detailed on how to use DRV8825 and similar ones. – Wesley Lee Feb 19 '17 at 3:44
• @WesleyLee Thanks for the advice. I'll try to find an appropriate tutorial. – nickvans Feb 19 '17 at 5:34

Current matters far more on the ratings of a motor. The voltage rating they list on the website is a DC voltage applied direct.

"Stepper motors' nameplates typically give only the winding current and occasionally the voltage and winding resistance. The rated voltage will produce the rated winding current at DC: but this is mostly a meaningless rating, as all modern drivers are current limiting and the drive voltages greatly exceed the motor rated voltage."

Go through the current limiting instructions on pololu's website and stay below the 1.2A rating. Note the voltage ratings for the controller (as you need a minimum voltage to drive the circuitry). There's some research to be done for supply voltage w.r.t. performance of the motor, and heat generation, but if you're not working the motor near it's rated wattage, you might not have to worry about it.

• Thanks for the advice. It seems I'm going to need to either get a different driver or bigger power supply. As a power supply is ~$20 and a lower voltage driver is ~$5, do you think the lower voltage driver as Raj suggests would be acceptable for a pretty low load? – nickvans Feb 19 '17 at 5:41
• Well how fast do you want your doggy door opening? Power-> force * distance/time. Put that in wattage, make sure your power source can supply it (V_supply * Current + some margin for efficiency losses), and make sure that it's under the power ratings of the motor. – bathMarm0t Feb 19 '17 at 22:40

The DRV8825 is ideal for your stepper motor. It is a PWM stepper driver. It will ensure that the current required by your stepper is not exceeded. Read the datasheet

You can watch a video or lookup the instructions for setup of the current limits for the driver board. Typically a 12 V or 24 V DC power supply would be used.

Connection to the Raspberry Pi requires two digital I/O pins, one for Step, one for direction.

The stepper motor spec is 3.3V/1.2A, the driver DRV8825 you have chosen has a minimum voltage range of 8.2V so you cant use the motor with this driver you have two choice

1. Change the driver to DRV8834 which match your stepper motor specification
2. Or you can get Stepper Motor Nema 17 Stepping Motor 26Ncm(36.8oz.in) 12V 0.4A to match the DRV8825 driver
• Its rated for 3.3V if no current limiting is used. This is due to the resistive element of the winding. With a properly set current limiting a higher voltage can be used. – Wesley Lee Feb 19 '17 at 5:34
• Assuming I need to purchase an appropriate 12V or 24V power supply anyway, I suspect my simplest answer will be to follow Raj's advice to get the low voltage IC. My use case is just to lift an aluminum pet door (4-5 oz load including drag force). Do you think a 5V supply at 1A would be sufficient? If so then a different driver would be the easiest, I would think. – nickvans Feb 19 '17 at 5:40
• use 5V/2A rating, since the motor is rated 1.2A@3.3V – Raj Feb 19 '17 at 5:43
• hi down voter, instead of wasting time down voting, please use you valuable time to answer the question or make some useful comment to correct an answer – Raj Feb 19 '17 at 6:30