Connect 2 L293D Motor Shields to 1 Arduino Mega

Can I connect 2 L293D Motor Shields to 1 Arduino Mega? I understand that stacking the shields is not going to work, but is there a way to drive 2 motor shields from 1 Arduino? The motor shields would have their own power supply of course. I need to drive 8 DC motors and would like to have all 8 under the control of one Arduino.

I don't see why you could not connect the shields with jumpers. Then make your own pin assignments.

But the L293, despite being really cheap, are not very good motor drivers. Their bipolar output stage drops 2 to over 4 volts of your motor power and dissipates it as heat making them very inefficient. Modern drivers have MOSFET output stages that are much more efficient.

What is the stall current of your motors? The motors will, briefly, pull stall current every time that they start. Will the L293 handle that stall current?

Pololu has a good line of inexpensive modern DC motor drivers. The also have good instructional pages on all of their products.

1 Like

I am driving 4 Tortoise motors at 9-12 volts (stall motors used to switch model railroad turnouts) per shield. Each has a stall current around 15-16 ma. I've successfully bread boarded an L2393D motor shield to control these. Typically, all motors would not be running at once if that matters. I think the L293 will handle my needs, but I will check out the Pololu's. If it's possible, I'm just not sure how to connect a 2nd L293D once I connect the first one using jumper wires, and how I would address the 2nd shield in the sketch.

Are you using a library for the motor drivers? Which one (post a link to the library)? Does the library allow you to assign pins?

Arduino Mega has enough digital pins. You can take any additional 4 free pins for second motor driver.

Using AF_Motor library from Adafruit.

I will have to investigate the pin assignment.

Would I then connect all the other non-motor pins in parallel?

This page tells how to stack the shields. The question that I have has to do with I2C on the Mega. On an Uno there are 2 places where I2C pins are broken out. A4 and A4 and the SCL and SDA pins by pin 13. If the shields use the I2C pins by pin 13 then the shields might stack. If the shields use the I2C pins A4 and A5 they will not stack on a Mega.

I will check that out. I believe pins D20 and D21 are the I2C bus on the Mega. This may give me enough information to proceed though. An Uno was not going to give me enough pins to connect push buttons and LEDs for the project.
I also found a page on the Pololu forum that offers some insight: https://forum.pololu.com/t/arduino-with-multiple-motors/2112 - although this is using their dual motor controller boards.
Thanks for your help!

(Just to add clarification, it is the newer V2 revision of the Motor Shields using TB6612 Mosfets which allows for address assignment and stacking. Looks like the easiest route for me will be to upgrade to these V2 shields, which should work fine with an Uno or a Mega.)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.