What is the best way to drive a 12v stepper motor

Been reading through posts here and elsewhere on the web and it seems there is not much of a straightforward way to run a stepper motor from the Particle photon. Some suggest using the ULN2003 but I don’t see how that will drive something beyond a 5v – perhaps I’m mistaken in that assumption.

I have a L293D from MH Electronics that seems awesome, but I’m not seeing any way to hack it into the photon.

And I see a Stepper library in the IDE, but not much information about what it can run.

I also see the Phobot, and one blog post about using it.

So, whats the consensus out there (or at least pertinent feedback, lol)? Are there blogs or videos that lay this out? And what drivers work with the Stepper library? Is it possible to use the L293D? Or is the Phobot the obvious way to go (though its kind of expensive)? Or, perhaps there’s a newer driver out there? Just hoping to get some content and conversation going around driving stepper motors with the particle photon.

Have you considered any of the dedicated stepper chips like A4988 or DRV8825?

Reading up on those chips, they do look good. And inexpensive (for when you need many). Do you know if there is danger of frying the photon if voltage spikes or logs on the motor? I know that’s why the relay shield is in place for powering devices. If so, is there a simple system that can be put in place that will mitigate this?

Out of curiosity, what is the stepper motor doing in your case?

What’s the application if you don’t mind me asking.

These stepper chips are the go-to chips for most consumer 3D printer’s steppers which are often controlled with Arduino based boards - so little risk there due to the well proven concept.
Since they support two separate power rails there should not be any risk of the 12V spikes “feeding back” into the TTL rails as long you don’t tie the grounds together.

1 Like

Alright. Thanks ScruffR. Good feedback. Thanks for taking the time. Because of the price and reliability of these chips I don’t see much of a reason to go with a phobot (except perhaps running multiple motors off of existing pins). And, from what I’m reading on Pololu, the code to run the DRV8825 is fairly straightforward: at the most basic is direction and step — with more controlling idle, micro stepping and resets.

I’m going to give the DRV8825 a try. A good article, for Arduino, albeit applicable for the Photon as well: http://www.instructables.com/id/Controll-a-Stepper-Motor-With-the-DRV8825/

1 Like

I’ve teamed up with my buddy who is a mechanical engineer in creating a prototype for an ice bagger machine. So the driver will be running a 12V stepper motor which will in turn be running the arm holding the bag.

1 Like

Hi, have you managed to solve this?

I have been using the DRV8825 very successfully for number of years controller several Nema 23 steppers under quite heavy load. I am new to Particle though so is now faced wit the same challenge. With Arduino it was easy ti implement the DRV8825 using the CNC shield. Is there any such shield for Particle?


@friedl_1977, please don’t double post as you have already started a new topic for this.

Hi peekay123 -

My apologies, as risingtiger already encountered the same challenge I thought he might be able to assist.


Hi friedl_1977,

Sorry for the late reply. Perhaps you’ve already solved this for your needs, but figured I would post anyways.

The instructable article that I linked to on Jun 18th did work for me. Though it’s written for Arduino it worked fine for the Photon.

I’m not using a library. I’m just setting the stepper motor pin to HIGH, then delay(2), then LOW, then delay(2) again before the loop ends. Then I just keep track of a stepper counter var to determine how far its gone. My motor was 200 steps per revolution.

I have used these in the past, work real well.