Control Multiple Steppers (But Only One-At-A-Time)

I want to have 9 stepper motors (probably with the ULN2003 control boards) connected to the Arduino. I want to use as few pins as possible. I only need to activate one motor at any given time, and then I only need to turn it 360 degrees, with maximum torque, at a low speed (lets say 1 - 3 seconds is acceptable). I was thinking I could have each of the 4 signal wires from all 9 motors tied together (so 9 brown wires going to 1 Arduino pin, 9 yellow wires going to 1 Arduino pin, etc.), and then use a high power shift register or something to only send 5V from an external power source to the 1 motor I want to turn. If I do this, I would only need 4 pins for the motor signals, and 3 for the shift registers.

Is there an easier way to do this? Anyway to use only one pin to switch the external 5V power to 1 of 9 motors? And has anybody worked out a way to control one of these motors with less pins? I could always add an additional MCU and program it to control the motors. Thank you!

Sounds like your stepper motors have 2 sets of winding each, so you will need to control pulses of current in both windings to get them to turn.
If you have ULN2008 or ULN2803 as current sinks, 9x2 = 18 pins to control, then you need to demultiplex 9 sets of control pins to select which pair of ULN2x03 pins are being driven.
One way is to use 4 address pins to select a channel in your demux logic chips, the outputs from that would then go high/low as needed to mimic the control line inputs.
Unfortunately, most demux chips have outputs that all sit high and only the selected channel can go low.
If you instead used a pair of DG406

with each control line from the arduino connected to D and the S outputs connected the UNL2x03 parts, one output could be made to follow the input with no inversion.
Pulldown resistors (10K) should be added to the outputs to ensure the ULN2x03 parts are low when not selected.

So, 6 pins are needed - 4 address lines, and the 2 stepper control lines, assuming the steppers are only intended to turn 1 direction and will do with one side of the windings wired high.
If you need both directions, then dual H-bridge driver chips are needed for each motor, and a similar DG406 scheme can be used for 4 control signals.

jrburke99:
I want to have 9 stepper motors (probably with the ULN2003 control boards) connected to the Arduino. I want to use as few pins as possible. I only need to activate one motor at any given time, and then I only need to turn it 360 degrees, with maximum torque, at a low speed (lets say 1 - 3 seconds is acceptable). I was thinking I could have each of the 4 signal wires from all 9 motors tied together (so 9 brown wires going to 1 Arduino pin, 9 yellow wires going to 1 Arduino pin, etc.), and then use a high power shift register or something to only send 5V from an external power source to the 1 motor I want to turn. If I do this, I would only need 4 pins for the motor signals, and 3 for the shift registers.

Is there an easier way to do this? Anyway to use only one pin to switch the external 5V power to 1 of 9 motors? And has anybody worked out a way to control one of these motors with less pins? I could always add an additional MCU and program it to control the motors. Thank you!

Firstly you can't drive motors direct from an Arduino pin, that would burn out your Arduino very quickly
for several reasons.

Secondly your scheme cannot work as you've described, that kind of multiplexing would need diodes everywhere (and flyback
diodes everywhere too). Something like 4 low-side drivers, 9 high-side drivers, 36 multiplex diodes and 36 flyback diodes.

Compare to 5 shift registers and 5 2803's each driving two motors with no further diodes required...

These already have ULN2003 control boards, so I should not need any additional 2803's or similar darlington arrays. I think I should be able to run 5V and GND to each of the 9 motors from a common source, and then use 5 74HC595 shift registers to control the steppers.

I can get the motors without the ULN2003 control boards for cheaper. So if I did that, I would just need to get 5 ULN2803's to properly amplify the control signals, correct?

No one seems to have answered the original question. Presuming a 5 or 6 wire unipolar stepper, is there any way to switch ON only one 5v power wire at a time. If this requires 9 Fet's it is probably not a useful idea.

Using 5 2803's and 5 shift registers is probably the best suggestion with one big caution. Be sure to use shift patterns that leave motors off when not stepping. Steppers motors have weak holding torque when the coils are unpowered. This may or may not matter.

What about if I use no darlington arrays, and instead of the 74HC595 shift registers (low power/low current), I use 5 x TPIC6B595 or TPIC6A596?

If I am reading these correctly, the 595s will sink up to 150mA of current on each output, and the 596 will sink up to 350mA on each output. The 74HC595's only handle up around 20mA.

So would I simply be able to connect 5V and GND to all 9 steppers, and then use 5 x TPIC6A596's to selectively send a command to one of the 9 steppers? Will it supply enough current for a typical 28BYJ-48-5V stepper motor? The ULN2003 seems to provide up to 500 mA of current, but I am not sure what the stepper will actually use.

I just realized I would be trying to sink current, but I want the opposite, right? I basically need to boost the signal. So using the supplied 2003 board and some low power shift registers should work well enough.

Bu this raised a question in my head. The stepper motors do not connect to ground anywhere. It has 5 wires. One is for +5V, and the other 4 are signal inputs. But there is no ground. I'm not sure how it can work with only a 1-way path like this. Where does the current go? It appears to be an open circuit to me. Hmmmm....

I have attached a proposed layout. Instead of showing the Arduino, I replaced it with an ATMega328 chip. I only connected VCC and GND. I left out capacitors and a crystal just for simplicity. My goal is to have this running on its own board with no Arduino, so this is closer to what I am trying to do in the end. Does this all look good? Am I missing anything?

Do I need to connect +5V to the RED wire on each stepper? I saw one example where they did not use that at all. I only need these to go forward one full rotation.

ULN2x03 only sink current as well. (is like a TPIC6B595, only without the shift register)

Do you have a link to your stepper motor?

The stepper motors do not connect to ground anywhere. It has 5 wires. One is for +5V, and the other 4 are signal inputs. But there is no ground.

They are not 'signal' inputs. They are the ends of the coils. They attached the coils to 'ground' thru the power transistors.
The stepper is an electromechanical device with no electronics inside.

You may find this helpful.
http://www.stepperworld.com/Tutorials/pgUnipolarTutorial.htm

A excellent video "Stepper Motor Basics and Control - How it works":

Ahhhh... So they DO sink current. I looked at the datasheets and it was never made clear anywhere. So then I COULD use the high current shift registers in place of the other shift registers + ULN2003's and save some space/power/time/headaches? Any reason that would NOT work? Not enough current?

Ahhhh... So they DO sink current. I looked at the datasheets and it was never made clear anywhere. So then I COULD use the high current shift registers in place of the other shift registers + ULN2003's and save some space/power/time/headaches? Any reason that would NOT work? Not enough current?

The ULN2803 and similar have builtin protection diodes. Without the diodes voltage kickback from the motor coils would eventually kill the chip. If you use a naked shift register you may be arrested by the ASPCIC (American Society for the Prevention of Cruelty to Integrated Circuits :slight_smile:

According to the diagram on page 3 of the datasheet at http://www.ti.com/lit/ds/symlink/tpic6b595.pdf, the TPIC6B595 has an integral 50V zener from drain to gate, which will protect the outputs against kickback. OTOH it also has an avalanche energy rating (figure 5 on page 7), so it is only safe to omit the flyback diodes if the stored energy in the windings fits within the safe area. You could always add external flyback diodes.

Have you a specification for the stepper motors you are thinking of using?

Thanks. Unfortunately, the specification of DC resistance (50 ohms) doesn't say whether that is for half a winding or a whole winding. So the steady-state current that the driver has to sink is either 100mA or 200mA. Either way, a TPIC6B595 could drive it. Unless you have an oscilloscope and can establish that the flyback energy is less than about 10mJ, you should add flyback diodes between the red wire and each of the other wires.

Unfortunately, the specification of DC resistance (50 ohms) doesn't say whether that is for half a winding or a whole winding.

The 12 volt version of the same motor has coil resistance 125 half & 250 full. The 5v has 50 & 100.

In full stepping mode only one half coil energized at a time.

OK, so it only takes 100mA per winding then.

Awesome. So what type of diode should I use, and how would I connect them? Do I need 5 for each motor? I think you were saying I should use 4, one going from the red wire to the blue wire, red to pink, red to yellow, and red to orange. Is that correct? In what orientation? (I have not used diodes yet...) Is my picture correct in connecting +5V directly to the red wire of each motor? Thank you!

jrburke99:
I think you were saying I should use 4, one going from the red wire to the blue wire, red to pink, red to yellow, and red to orange. Is that correct? In what orientation? (I have not used diodes yet...) Is my picture correct in connecting +5V directly to the red wire of each motor? Thank you!

That's all correct. Connect the cathodes of the diodes to the red wire and the anodes to the other wires. Almost any type of diode will do in this application, provided it is rated at not less than the coil current (100mA). I suspect that you don't actually need the diodes, because the flyback energy is probably much lower than the avalanche rating of the TPIC6B595; but it's better to be safe.

Awesome. Thank you so much!