controlling 2 DC Motors with L293D

I am trying to control 2 DC motors using L293D h-bridge..

I followed adfruit's tutorial for one motor here Arduino Code | Arduino Lesson 15. DC Motor Reversing | Adafruit Learning System

everything works fine following the tutorial.

When I try to extend the tutorial to 2 DC motors, I can't get it to work properly. I narrowed down the problem is when simply add a EnablePin2 as integer on PIN3 and did the setup, the first motor will still work properly. But when I actually attach the wire to pin 9 to pin3 on arduino uno3, the motor does not work, I tried other pins instead of Pin3, ie pin5&6. So I am wondering what is going on?

I have not found a tutorial on controlling 2 DC motors using L293D, only one motor. Is this possible? and what is going on electrically?

edit: I rewired and everything seems to work now, the only thing that i can think of is that I am now powering the L293 chip and motors from external power. Whereas previously, I was power chip from arduino 5v. However this is not confirmed, but suspected reason.

"Not enough power" was my first thought. The 5V pin of the Arduino board is not for motors (perhaps a very small little motor).

The L293D is a chip from the stone-age. It can be used for small 12V motors. At 5V it does not work very well, or not at all. At Sparkfun and Pololu they have very nice motor drivers with mosfets.

Peter_n:
The L293D is a chip from the stone-age. It can be used for small 12V motors. At 5V it does not work very well, or not at all. At Sparkfun and Pololu they have very nice motor drivers with mosfets.

Not with dropping 2 volts as a bipolar device (4.5 volts is the minimum motor source voltage anyhow). This gets worse as current needs increase.

So - if trying to run a 5 volt motor, you need to supply a minimum of 7-7.5 volts - unless the current needs are higher (then voltage drop goes up - check the datasheet for details).

I wouldn't try to run anything lower than a 3 volt motor from the L293, simply because of it's minimums being too high - even a 3 volt motor would be "over-volted" by 50%, which might decrease it's life (but then again, such small motors are a dime-a-dozen).

Hi,
Yes the L293 was very popular at one time, but it's old hat now. Try something like the DRV883, etc FET outputs so very little loss! But I have driven lots of bots using the L293, it's simple..

We need to see your code, you say you set up the second enable, but have you set up the pinMode for the second motor pins. Also a schematic would be helpful, just how are you connecting that second motor.. Oh it looks like your not using a driver shield/module but a bare L293, What are you powering the motors with, NOT from the arduino, I hope most motor and servo problems come back to this. DON'T do it, it can kill your arduino at the least!! You need 4 x AA cells with a good capacity rating.

Perhaps a cheap driver shield is your best bet to get you going, depends what you have in mind... One that you can code without having to use their library, avoid the one with 4 motor outpts and 3 chips..
See my bots here:www.melsaunders.co.uk under Electronics.

Hope it helps, regards.

Mel.