Arduino with multiple motors

Hallo everyone,

for a project of mine i have to control multiple motors with an Arduino/Arduino Mega (no Servo Motors, standard DC-Motors or Gearboxes) … to be precise i want to control 20 motors. at the moment it’s moste likely that i will be using 6v motors.
at the end it’s possible that i will be using less than 20 motors, but for now the goal is to be able to control 20 motors.

i want to control every motor seperately… their job is to wind and unwind a band. every motor has some kind of cable roll mounted and with this cable roll the motor winds and unwinds the band

now my question: does anyone have experience in controlling that many motors with an Arduino or Arduino Mega… is that possible? at the moment i’m testing with this motor-driver: … ts_id=9457

what’s good about this motor driver: seperate circuits for motor supply and motor control … the arduino alone won’t be able to supply that much current. but as you know that motor driver only has 2 channels and i haven’t found a motor-driver for a larger number of motors yet. would it be possible to clone the circuit of the 2-channel motor-driver and upscale that whole thing (i hope that’s understandable) so that i can control 20 motors?

another question is… is it possible to get rotation data from the motors? it would be perfect if i could tell how much every band of every motor is unwinded. that would make the calculation of the movement much easier. are there motors that can do that? or do i have to build some kind of light-barrier construction to see how much every cable-roll is unwinded?

sorry for my bad english… i hope its understandable and i hope you can help me :slight_smile:


That seems like quite the project! And your English is great; until I got to your apology for “bad English” I had no idea it wasn’t your first language.

Do you know we have a similar carrier? Sparkfun used to sell our TB6612FNG carrier until they made their lower-quality (it’s physically bigger, has no reverse power protection, and has less thermal coupling of driver to PCB) and more expensive copy.

You never told us any specifics of your motors, other than that they will likely be 6V motors. The above motor driver can deliver 1A continuous per channel (3A peak), so if you want to use them, you will need to make sure that your motors’ power requirements can be met by this driver. Our non-HP micro metal gearmotors can be easily driven by these drivers; our HP micro metal gearmotors will push the limits of these drivers if you let them get close to stall for too long or if you use them at voltages much higher than 6V.

I know of people who have controlled on the order of 20 motors with various microcontroller boards, but they have used more advanced motor controllers that take a high-level input such as serial commands rather than motor drivers, which require low-level signals such as PWMs that will be very difficult to generate with a single microcontroller board like the Arduino (it isn’t trivial to generate 20 PWMs). You will also need significantly more I/O lines than the Arduino has.

Even though it is a more expensive solution, I’d strongly recommend using 10 qik 2s9v1 motor controllers to control your 20 motors. This board uses the same TB6612 motor driver IC as the driver carrier board linked above, so it has the same performance characteristics, but it has an integrated microcontroller that generates the low-level control signals for you in response to high-level serial commands. You can chain all 10 controllers together using a single serial transmit line from your Arduino (note that you cannot connect their outputs together directly, but you can use an AND gate; the qik output is optional), and then send commands to each device telling it what speed and direction to turn the motors.

Are you asking if it is physically possible to make a single board with 10 motor driver ICs on it that can control 20 motors? Sure, though this wouldn’t necessarily be more convenient than having multiple smaller boards if you want to spread out your motors. Are you asking if we would make such a product? Not anytime soon (we haven’t had much (any?) demand something like this).

Yes, you want to look for motors with encoders, or add encoders to your existing motors. Note that if you want to be able to tell the direction of rotation as well as speed (which is usually important if you want to keep track of motor position), you will want quadrature encoders, which generate two outputs per motor. It definitely will not be easy to track 20 quadrature encoders with an Arduino (both in terms of required I/O lines and required processing power). Are you intending for all the motors to be moving at once?

- Ben

hey ben … thanks for the helpful answer!

i recently discovered your site but at that point i had already ordered my motor-driver for testing purposes.

that’s the thing … i don’t know which motors i will use yet. my latest plan is to use stepper motors, with them i can easily get the rotation values from the motor itself, i think thats much easier than installing additional encoders or light barriers.

i like your qik 2s9v1 serial motor driver, but unfortunately it doesn’t seem to work with stepper motors :(. that would be the perfect solution because it would be easy to control (serial interface) and i wouldn’t have to solder that much myself ;)… it’s more expensive though

in another board i got the suggestion to use 74HC595 shift registers with ULN2803 darlington arrays to make my circuit. sounds good to me but i am not THAT experience in electronics so i dont have a clue about what parts i would need additionally for my circuit to work properly (capacitors? transistors? and so on) :frowning:

also i believe when i’m using the shift register/array combination i would have to do much more low-level programming myself and thats another thing im not very experienced in :wink:

appreciate your help!

In general, controlling 20 DC motors or stepper motors is going to be a challenging project, and your power requirements will probably not be trivial, so you should make sure you consider how you will be powering everything. We sell stepper motor drivers (they will hopefully be back in stock in late May or early June) and stepper motors, but controlling 20 stepper motor drivers simultaneously from an Arduino will not be easy.

Something else you might consider is using a series of Baby Orangutans controlled by a master controller (such as an Arduino or another Baby Orangutan). The Baby Orangutan has a programmable AVR microcontroller interfaced with an on-board dual motor driver (a TB6612, the same as is on the motor drivers you bought from Sparkfun and the qik 2s9v1). You could use 10 baby Orangutans to control 20 DC motors, or you could use 20 Baby Orangutans to control 20 stepper motors. The performance will not be as high as it would if you use our stepper motor driver, but the TB6612 can be used to control a single bipolar stepper motor (make sure you pick one with specs appropriate for the TB6612), and the Pololu AVR library has a sample program that shows how you can use the Baby Orangutan to control a bipolar stepper motor. You could program each Baby Orangutan to control one of your stepper motors in response to serial commands and then use a master controller like your Arduino to issue these commands to all the Baby Orangutans using a single serial output. By having separate devices controlling each stepper motor, you greatly decrease the burden on the Arduino, and I don’t think the programming would be all that difficult if you use our library and its included examples.

You could always try this with a single Baby Orangutan and stepper motor, and if the results are promising you could expand the system by adding more. I could also give you some pointers on the code if you have trouble understanding the sample programs.

- Ben

Hi Ben,

Im trying to undertake a uni project to build a series of mechanical arms made from a light weight perspex, which I was hoping to drive from about 10 small motors. I would like to control the behaviour from the arduino uno. This is when I came across your post, which sounds exactly like what I am trying to do.

Unfortunately as I have very little electronic experience (but a lot of patience) I don’t know where to start with this solution. I dont expect you to draw this out for me exactly but would you be able to suggest a couple of points for me to research to be able to ask more presice questions. What is the topic to search for to get a better understanding of high vs low level serial commands.

Any direction would be much appreciated!

Thanks Mike

Hi Mike.

I suggest you start by reading through the qik 2s9v1 user’s guide and ask questions if there’s something you don’t understand. A good second step would be to purchase one qik and try using it to control a single motor. Someone has written an Arduino library for controlling the qik 2s9v1 (I think it might use the compact protocol, in which case it wouldn’t work for controlling multiple chained modules, but it would still make a good starting point for your own code), so you might want to take a look at that, too. It is linked from the resources tab on the qik product page.

Also, can you tell me more about the motors you plan on using (e.g. free-run current and stall current) and what voltage you plan on running them at?

- Ben

Thanks for the swift reply Ben! I’ll get started familiarising myself with the qik 2s9v1. In the meantime could you give me some advice on an alternative angle for attacking my project?

I spoke to one of the computer services guys at my uni today and he suggested that I consider using relays to control the motors, which would be externally powered. What would be the advantage/disadvantage of this method over using motor controllers?

Thanks again, Mike

If all you want is to infrequently turn a motor on and off at full speed, then relays could work. If you want variable speed or constant changing of direction or state, relays are not a good way to go. My general take is that a suggestion to use relays for motor control is kind of like a suggestion to deal with car trouble by switching to a steam engine. Relays are old technology for which there are much better alternatives these days when it comes to motor control.

- Ben

This thread covers what I’ve been looking for but is a couple years old so I would like to refresh this approach with possible new items you have for sale.
I’d like to see what drivers would help me control 25 stepper motors (Stepper Motor: Bipolar, 200 Steps/Rev, 35x26mm, 7.4V, 280mA).
I’m building a proof of concept machine so cost right now is a factor.
I would like to control the 25 stepper drivers with an arduino board of some kind.
All motors will only need to rotate in one direction while stopping at 3-5 different places.

Earlier in this thread you discussed the baby orangatan.

I am new to this stuff but find it fascinating. I really dont’ understand how all of the stepper drivers connect to a master controller / arduino.
Just not enough space…

Also, I might swap out 2 stepper motors for 2 actuators -Generic Linear Actuator with Feedback: 4" Stroke, 12V, 0.6"/s if its not too complicated.

Should I punt and start flipping burgers or is there hope for this project?

Thanks in advance for your help.

Hello, jbc.

That sounds like a very ambitious project, especially for someone new to electronics. I strongly suggest you break it down into simpler sub-projects and get those working first. For example, start by getting a single stepper motor moving the way you want. Once that is working, try to get a bank of stepper motors moving.

I do not have any new suggestions for you different from the ones I made a few years ago in this thread. You will likely want to use one stepper motor driver per stepper motor, and you will need to come up with a good way to control them. I do not expect a single Arduino will have enough processing power to control all 25 stepper motors adequately, so you might need to construct a system where you have something like five Arduinos each controlling a bank of five stepper motors, and then some master controller telling those Arduinos what to do via some high-level interface that you implement yourself. Also, you will need to come up with a good way to power everything.

- Ben

Thanks Ben.
I was hoping for a shield of some type to magically appear out of your response.
I built a 3D Rostock printer last year and fiddled with the code the arduino compiler uses to interface with pronterface.
That was a great learning experience.

What I am hoping to do is find the item that could control all of the motors and then add to it piece by piece, learning as i go. Instead of heading off into a dead end.

I’ll research more. Thank you for your response.

Thank you

Hello all.
Regarding this subject, I’m wondering if having just one motor on at the same time and of course all wires somehow switched, it would be possible to control 10 dc motors with just one motor driver?


That is an interesting question! You should be able to control 10 different motors by connecting 5 single-pole, double-throw (SPDT) relays between the motors and the motor driver. We have several relay modules that could help you set this up. The relays would make clicking sounds whenever you switch from one motor to another. You would need 4 output pins from your microcontroller to control the relays (two of the relays could be controlled from the same line). Also, it is not good to disconnect a motor while current is flowing through it, so you would want to be sure the bring each motor to a complete stop before switching motors.

Would this kind of solution work for you? If you are not sure how to connect the relays, I could explain more.



I am looking for a command card able to drive 8 DC motors at the same time.

Right now I am using an Arduino Mega 2560 card. This card is linked to 4
motor cards designed by myself.
Each card can drive 2 motors at the same time and control their respective

My problem is I would like to save space and reduce the number of cards. A
single Arduino card on which I could directly connect the motors and their
respective brakes would meet this requirement. In addition, I would like to control the output intensity of the Arduino card in order to limit the motors’ torque.

Do you know which card I need for my application ? I thought about the
Rugged Motor Driver but this card can only control 2 DC motors and I don’t know
if it is possible to control the brakes as well. When I asked Rugged circuit, they advised me to contact Pololu.

P.S : The nominal voltage of the our motors (series 3557024CS) is 24 V and
allows a maximum current of 1.1 A.


Unfortunately, we do not have a board that controls more than two brushed DC motors, and we do not know where you might find one.

- Jeremy