7
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Today I bought a stepper motor to play with, after 12 hours of struggling with it, I haven't been able to figure out how to connect it to an Arduino.

Is it okay if my stepper motor has exactly 4 wires?

Wires are colored: white, blue, red, yellow. All the pictures and circuits of easy tutorials I found on Google had 5 wires, (and those with 4 wires had different color coding anyway). But a 4-wire doesn't make sense! there must be 2 or 4 poles in a motor, and each pole needs a connection to common ground, so there must be 5 wires, how does a 4 wire work?

I'm using MOSFET for driving the stepper, not LMxxx

Because I forgot to buy one, and I can't get my hands on one for a couple of days. I use the MOSFETs as fast switches: 4 Arduino pins control 4 MOSFET transistors. And this is exactly the source of confusion: On arduino website, the sample circuit's stepper has 4 wires and is directly connected to a driver IC (a LMxxx), and the driver is connected to Arduino. Since I do not have a driver at hand, I need to convert the circuit so it works with 4 transistors instead. But what the wiring should be? If it had 5 wires I would have done it like this schematics.

It is very likely there are problems with my PNP/NPN Mosfet choice, but as soon as I know how to wire the circuit, I'll choose the right one!

\$\endgroup\$
7
  • 1
    \$\begingroup\$ does your stepper have 4 wires? it's probably 2 poles, with 2 pins per pole. You rig up your own external FETs as switches to switch current through the poles (in one pin, out the other pin for that pole). \$\endgroup\$
    – KyranF
    Commented Mar 14, 2015 at 20:46
  • 1
    \$\begingroup\$ What is your MOSFET part number? You DO realize that P channel FETs need a different way to drive them right? \$\endgroup\$
    – KyranF
    Commented Mar 14, 2015 at 20:46
  • 1
    \$\begingroup\$ Perhaps you just labelled/showed the FETs wrong, but I think you should try just doing low-side N-FETs and get that working. Who needs two directions anyway? lulz \$\endgroup\$
    – KyranF
    Commented Mar 14, 2015 at 20:51
  • 1
    \$\begingroup\$ i'll have to investigate it further before I can post an answer for you, to verify that it's possible. I will have to re-read all the info about stepper motors, and while i'm doing that so should you! :) \$\endgroup\$
    – KyranF
    Commented Mar 15, 2015 at 17:09
  • 1
    \$\begingroup\$ so your solution was to get a L293D and rig it up as a stepper driver? Be careful about the max current of the stepper motor, they can be quite high current and you may blow up the L293D without some good heat sinking \$\endgroup\$
    – KyranF
    Commented Mar 16, 2015 at 6:01

2 Answers 2

8
\$\begingroup\$

Your motor is Bi-polar. It has two windings and you need to use a circuit that constantly inverts the polarity of the supply to the coils.

enter image description here

This is done with an H-bridge that operates as four switches.

enter image description here

You need one H-bridge per coil, so you'll need two of them to control your stepper. In practice these switches are either mosfets or transistors.

enter image description here

Refer to the below articles for stepper motor driving:
http://www.8051projects.net/stepper-motor-interfacing/introduction.php
http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/

\$\endgroup\$
4
\$\begingroup\$

It sounds like you have a "Bipolar" stepper motor.

Stepper motors come in two flavours: Bipolar and Unipolar.

enter image description here

Unipolar ones are much easier to work (but more expensive to make) with as it's just a matter of turning the right coils on and off in the right order - so most simple tutorials are for those.

Bipolar ones, though, require a pair of H-bridges to get them working properly. Not only to you have to turn the coils on and off in the right order, but you have to switch them to the right polarity at the right time.

I don't normally recommend instructables as some of the things on there are downright dangerous, but there is an example on there of driving a bipolar stepper motor from an Arduino: http://www.instructables.com/id/Bi-Polar-Stepper-Motor-with-L293D-and-Arduino/

\$\endgroup\$
1
  • \$\begingroup\$ Can a motor with 2 wires be controlled with a driver that takes 4 or 6 wires ? \$\endgroup\$
    – O.Rares
    Commented Apr 7, 2018 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.