L293D Dual H-Bridge DC Motor Driver
Drive two small DC motors forward, reverse, brake and coast — the canonical H-bridge IC every robotics beginner meets first.
Difficulty: Breadboard. Estimated build time: about 50 minutes. Estimated parts cost: about US$9.50. 6-line bill of materials. Compare supplier offers when available. A bidirectional motor controller built around the L293D — a 16-pin DIP that contains four half-H-bridges, configurable as two full H-bridges.
Wire the supplies
L293D pin 16 is Vss (logic supply, 4.5–7 V — give it 5 V from your Arduino). Pin 8 is Vs (motor supply, can be anywhere from 4.5 V to 36 V — match this to your motor's rated voltage, e.g. 6 V or 9 V). Pins 4, 5, 12 and 13 are all GND — tie them ALL to the common ground. Drop a 100 nF cap across pin 16/GND and a 100 µF electrolytic across pin 8/GND right at the chip.
Wire one motor
Connect motor A's two terminals to pins 3 and 6 (output 1Y and 2Y). Pins 2 and 7 are the direction inputs (1A and 2A); these come from your microcontroller's GPIO. Pin 1 is enable (1,2EN) — also a GPIO, or PWM if you want speed control.
Drive the motor
Pull pin 1 (enable) high. Now: pin 2 high, pin 7 low → motor spins one way. Pin 2 low, pin 7 high → spins the other way. Pin 2 = pin 7 → brake. Pull pin 1 low → coast. Repeat the same pattern with pins 9, 10, 11, 14, 15 for the second motor (channel 2).
Add PWM speed control
Replace the digitalWrite on enable with analogWrite (Arduino PWM). The L293D's PWM frequency tolerance is wide (up to ~5 kHz works fine), but stay under the inductance pole of your motor or it sings audibly. Most hobby motors are happy at 1 kHz.
Drop in the second motor
Pins 14, 11 = motor B outputs. Pins 10, 15 = direction inputs. Pin 9 = enable. Repeat the wiring and you have a complete two-motor drive base. This is enough to make a tracked or differential-steer robot if you bolt two motors to a chassis and feed them opposing direction signals to turn.