Arduino Pin 10 -> L293D vcc1 ... it simply doesn't work...?

Hi,

Newbe here ... :~

Datasheet: L293DD013TR STMicroelectronics | Mouser Europe

This connection schema turns my motors:
L293D's vcc1 connected to 5V supply
L293D's vcc2 connected to 12V supply

I have the stepper motor library and I can turn a NEMA 17 stepper motor without any problem. I have had this circuit (DIP version) since a few months and it works so great.

My motor remains idle (and disabled 1,2EN and 3,4EN LOW) most of the time, and I see that the L293D chip consumes some current (about 30mA or so) because its VCC1 is connected to 5V supply... I thought that i can save power by connecting vcc1 to the output of arduino... when the outpin is high, vcc1 will be 5V and everything should work as expected. I simply assumed this, designed my first SMT PCB and got a few manufactured :frowning: !

Now, I see that the circuit is not working. When I test it with an oscilloscope, I see that the arduino's pin connected to vcc1 shows a voltage of about 1V...? I see that the chip is taking in come current (approx 10ma) and when I enable the chip (through another arduino's pin... which used to work flawlessely earlier), I see that the chip is consuming about 60ma... instead of the normal .5amps that I expect to see.

Whats going on here? Whats wrong with this connection setup? This is my first smd project... I think I soldered the L293 chip correctly... the soldered pins look neat.

Just another question tagged to this: Is there a better/cheaper HBridge compared to L293D. I do single (if not half) stepping and I need to drive a motor that consumes no more than 1amp.

If you disconnect the L293D and put an LED on pin 10, does it behave normally? I.e., can you write a sketch to switch it on and off, and does it give 0V and 5V?

You are being wildly optimistic to expect an Arduino pin to source 30mA and produce 5V. 40mA is the "abs max" current (at which point the chip starts to damage itself). The pin would have struggled to hold its output up high enough, meanwhile the other inputs to the 293 were being driven with 5V from other pins, result 293's inputs were driven beyond their abs max ratings, almost certainly.

And that's not even mentioning decoupling. The 293 needs decoupling, yet if you place decoupling on pin 10 then it will overload that pin as the capacitors charge up. If you leave decoupling on just the 5V rail then the high(*) output resistance of pin 10 will prevent the decoupling from having a low resistance connection to the 293...

(*) high for a power supply.

To switch power to another chip you really need a switching transistor or MOSFET that has a low on resistance (less than one ohm perhaps). For very low power consumers like some sensors this would be overkill, but for the 293 its a requirement.

I think I found the issue: smt soldering problem! This is my first smt soldering project and I screwed up the L293D chip because i soldered it incorrectly; the chip is not behaving as it should. I rectified it and it is working now.

Good that I have put my design for review...

You are being wildly optimistic to expect an Arduino pin to source 30mA and produce 5V. 40mA is the "abs max" current (at which point the chip starts to damage itself). The pin would have struggled to hold its output up high enough,....

The VCC1 is connected to arduino pin and VCC2 (which is pin 10 in the SO version) is connected to a 12V regulated supply. So, as you are saying, this is not a good design and I should instead connect the arduino pin to a switching transistor...? If thats so, fair enough; I will change my design then.

meanwhile the other inputs to the 293 were being driven with 5V from other pins, result 293's inputs were driven beyond their abs max ratings, almost certainly.

I didn't try to turn the motor initially when I enabled the vcc from the arduino pin (when I soldered it wrong). I turned the motors only when I was sure that the chip was getting enabled. Hmm... I never thought of things this way. This is very helpful.

And that's not even mentioning decoupling. The 293 needs decoupling, yet if you place decoupling on pin 10 then it will overload that pin as the capacitors charge up. If you leave decoupling on just the 5V rail then the high(*) output resistance of pin 10 will prevent the decoupling from having a low resistance connection to the 293...

Ok, this is making my head spin; Newbie here :slight_smile: So, if I put a decoupling cap (say 0.1uF or any suggestions) on VCC2(pin 10 SO version), and connect the L293D's VCC1 (Pin20 in SO version) to 5V through a transistor controlled by an arduino pin, L293D's 5v VCC pin draws more power during a charge up... and thats where the atmega chip can get fried up, if I don't use the transistor?
Based on what you are saying, I should have decoupling caps on both the voltage pins (Pin 10; VCC2 and Pin 20 VCC1 of SO version; or Pin 8 & pin 16 of DIP version)... AND the VCC1 pin MUST be connected to vcc through a transistor.

I do have a 100uF cap decoupled to my 12V supply, which is directly connected to the VCC2(Pin 10).

I have seen a number of L293D circuits on the web, but I hardly came across any decoupling caps... may be I was looking at hobby circuits. Can you please suggest what decoupling caps should I use for this...
My objective here is to have as professionl design as possible my background is not electronics.

thanks for your suggestion; they have been very helpful.

The motor shield has a good decoupling schema: http://www.ladyada.net/images/mshield/mshieldv1-schem.png

I will probably go with this... any suggestions or improvements on this?