Let's Make Robots!

Are You Wondering How to Hook Up a Motor Driver IC chip (such as an L293D) ?


  **Click the picture to show it bigger, and then click that picture again to make it big enough to read the fine print**

ADDED (06MAY2012) This is the motor drive circuit exactly as I built it for my newest lttle SHR-like robot.

The above configuration using the L293D is a good way to prevent shorting out the power supply as can happen in the circuit below if you make inputs A and B high at the same time. The Integrated circuit can supply 600 mA current per channel (and twice that in a non-repetitive peak).  It also contains internal protection against reverse spikes such as are generated when driving an inductive load. 

With this configuration, in adding the extra transistors I have changed the function of the inputs. Power to the motor is turned on or off with one lead and You set forward or reverse with the second one. While this feature is not essential, some people may like this better. It is still the same 2 wires per motor (as below), but their functions have changed. Some of my older drawings using the L293D just tied the Enable leads to +V (always enabled), but by using the enable leads you can switch the output to a high-impedance state when the on/off lead is low.

 

Below is a common driver circuit I pulled )almost at random) off the internet. (If anyone is upset that I posted something I did not draw myself, I will remove it; there are many more examples.) I have even seen a video for that particular 6-transistor circuit showing how to put it together, but I do not remember them saying, "Oh by the way, don't turn both inputs on at the same time or you could burn down your house." (Ok, it may not be THAT bad, but the transistors *will* burn up if the battery does not go dead first.)

This does work but there is always the danger of accidentally turning both inputs on at the same time, and *P*O*O*F*.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

My robot uses the strange bird, the TB6612FNG and it is a MOSFET based design, I am sure it can take an overload, because I accidently stalled both my motors! The chip never even put up a sweat. 

(Unfortunately, it is SMD and not the easier pin through the hole design, so it would be harder to replace...)

if you hurt that chip, you are working it pretty hard. It is stated to have a 3A peak. The nice thing about that chip is its inputs and outputs are on opposite sides of the chip.

I wired my battery pack backwards to my development board the first time.  I got the motor driver chip so hot I nearly burned my finger on it and (after I fixed the wiring), it worked fine.  As you say, one TOUGH chip.

Hi, YourDuino.com has the L293 at a good price, and the Datasheet, here:

http://arduino-direct.com/sunshop/index.php?l=product_detail&p=296

Regards, Terry

Hi Terry,
I found the L293D even cheaper here: http://stores.ebay.com/POLIDA-ELECTRICAL-H-K-LIMITED/_i.html?_nkw=L293D
ranging from $1.3 to $0.9 including shipping.

basile

According o the picaxe documentation, the L293D doesn't have this flaw. I know you're not exactly saying that it does, but your title suggests it.

I got this picture from the AXE20 datasheet. That's the 28X project board also used in the start here robot : PDF Datasheet

Ok, I didn't really change the title, but I reworded the page a bit, so I was explaining better why I added the extra transistors to change the function of the inputs. (Namely that with the enable leads always high as in the one you posted, the device can never go into high impedance state as it is always enabled.)  Not essential, but I think some may like it better that way.

ADDED: In fact I used my same design for the little robot I am currently working on. Havng the ability to enable or disable the motors works out great in my opinion.

 

I recall reading about h-bridges and seeing truth tables for said h-bridges. Two of the possibilities were L L and H H. The first one was considered a coasting phase and the second was braking. Are these the possibilities which you hope to avoid in your inverted input on your original image?

First of all The wrong picture posted there, but I fixed it now.

You may have seen the "simple" H-bridge design that was touted for its simplicity and that the transistors could be stacked and even glued together to take up less room. All that was true, but there was/is a serious drawback and that was that If both inputs are high at the same time, all the transistors are 'ON' at once and you have a dead short across the battery. What will go first? Will the transistors burn out or will the batteries burst open?

Too many of the designs that are around have that serious flaw and too often fail to even warn the person of the possibilities.

I am sure that the "simple" circuits will be grabbed up by people new to electronics. They are looking for something simple to put together and have no knowledge of proper circuit design.  The circuit looks simple enough to put together so they use it. They will generally assume that the person who drew it knew what he/she was doing.

Some of you will remember that I also had a page on a transistorised driver of my own design, that is still just as valid as before. The difference between mine and what appears so often on the web is the order of the transistors. I set emitter to emitter rather than collector to collector. Emitter to emitter does not have the problem of shorting out the power supply, since both transistors cannot be on at the same time. With collectors together, they can.

Here is another BAD one pulled off the internet. It has exactly the same problem.

If both inputs go high at the same time, you get *****SMOKE*****

      [No smoking when the "Fasten Seatbelts" sign is on! Thank you for flying with letsmakerobots.com]

 >>>>   Dear NEW people. Do NOT build this, or if you do, never let both inputs go high at the same time. <<<<