Summary of L293 Motor Driver and H-Bridges
The article explains using H-bridge motor drivers to control DC motors bidirectionally, contrasting building discrete transistor H-bridges versus using IC drivers like the L293/L293D or the improved SN754410NE. It highlights the L293D (with built-in flyback diodes) for small motors, its current limits, heat concerns, and pinout in a 16-pin package, plus a wiring schematic for Arduino control (three Arduino pins per motor, with notes for single-motor hookups).
Parts used in the L293 Motor Driver Project:
- L293 or L293D motor driver IC (16-pin DIP)
- SN754410NE motor driver IC (alternative)
- DC motor (small, low-current)
- Arduino (microcontroller)
- Connecting wires
- Power supply for motor
- Optional heat sink (for L293)
- Peripheral components for wiring (breadboard or PCB)
The most common method to drive DC motors in two directions under control of a computer is with an H-bridge motor driver. H-bridges can be built from scratch with bi-polar junction transistors (BJT) or with field effect transistors (FET), or can be purchased as an integrated unit in a single integrated circuit package such as the L293. The L293 is simplest and inexpensive for low current motors, For high current motors, it is less expensive to build your own H-bridge from scratch.
ITP Physical Computing has a terrific tutorial on using an Arduino and an L293 to control a bi-directional motor.
The Twin Cities Robotics Club has an *excellent* tutorial on H-bridges, and complete detail on how to build your own $5.00 H-bridge good for several amps. From the same source is a detailed tech note on PWM speed control of a motor using an H-bridge and a PIC microcontroller
The L293 is an integrated circuit motor driver that can be used for simultaneous, bi-directional control of two small motors. Small means small. The L293 is limited to 600 mA, but in reality can only handle much small currents unless you have done some serious heat sinking to keep the case temperature down. Unsure about whether the L293 will work with your motor? Hook up the circuit and run your motor while keeping your finger on the chip. If it gets too hot to touch, you can’t use it with your motor. (Note to ME2011 students: The L293 should be OK for your small motor but is not OK for your gear motor.)
The L293 comes in a standard 16-pin, dual-in line integrated circuit package. There is an L293 and an L293D part number. Pick the “D” version because it has built in flyback diodes to minimize inductive voltage spikes. The L293D can be purchased for somewhere between $2 and $3 (quantity one) from www.mouser.com (PN 511-L293D) or www.digikey.com (PN 296-9518-5-ND). For complete information, consult the Unitrode L293 data sheet (PDF file, 626Kb).
A more recent, improved specification, pin-for-pin compatible chip is recommended for new designs: the TI SN754410NE motor driver. Available from mouser.com, Mouser part number 595-SN754410NE, $1.88. Data sheet (PDF file, 172Kb).
The pinout for the L293 in the 16-pin package is shown below in top view. Pin 1 is at the top left when the notch in the package faces up. Note that the names for pin functions may be slightly different than what is shown in the following diagrams.
The following schematic shows how to connect the L293 to your motor and the Arduino. Each motor takes 3 Arduino pins. (See notes below for a two Arduino pin solution.) If you are only using one motor, leave L293 pins 9, 10, 11, 12, 13, 14, and 15 empty.
Assume you have only one motor connected with the enable tied to Arduino Pin 3, and the two direction controls tied to Arduino Pins 4 and 5.
For more detail: L293 Motor Driver and H-Bridges
- What is an H-bridge used for?
An H-bridge is used to drive DC motors in two directions under control of a computer. - Can I use an L293 to control two motors?
Yes, the L293 can be used for simultaneous bi-directional control of two small motors. - Does the L293D have built-in flyback diodes?
Yes, pick the D version because it has built in flyback diodes to minimize inductive voltage spikes. - What is the current limit of the L293?
The L293 is limited to 600 mA, but in practice it can handle much smaller currents unless heavily heat-sunk. - How can I tell if the L293 will work with my motor?
Hook up the circuit and run your motor while keeping your finger on the chip; if it gets too hot to touch, you cannot use it with your motor. - How many Arduino pins does each motor require with the L293 schematic shown?
Each motor takes 3 Arduino pins according to the schematic. - What are recommended suppliers for L293D or SN754410NE?
The article lists mouser.com and digikey.com as sources for these parts. - Is there a recommended improved alternative to the L293?
Yes, the TI SN754410NE is a more recent, improved, pin-for-pin compatible chip recommended for new designs.