part · Level 9 · Robotics · active
How the L293D motor driver works
Motor driver (L293D) — Lets your small brain safely boss around big hungry motors.
What it is
A microcontroller pin can give 20 mA. A gear motor wants 200 mA and, stalled, 800 mA or more — and it wants to go backwards sometimes, which means reversing its wires. The L293D is a 16-pin chip that solves both: it contains four big switches arranged as two H-bridges, so two logic pins from your board set the direction of each motor, and the chip's own supply carries the current.
Each side drives one motor at up to 600 mA continuous (1.2 A for a moment), from a motor supply of 4.5 to 36 V. It also has flyback diodes built in — the "D" in L293D — so the spike a motor makes when it stops does not fry anything, the same job the 1N4001 did for you at Level 4.
Two of these on a chassis with two gear motors is a robot that can turn on the spot.
How it works
An H-bridge is four switches around a motor, drawn like the letter H with the motor as the crossbar. Close the top-left and bottom-right switches and current flows one way through the motor; close top-right and bottom-left and it flows the other way. Close both on one side and you have a short — the chip's logic prevents that.
Pins (notch up, anticlockwise from top-left): 1 EN1 (enable side A), 2 IN1, 3 OUT1, 4 GND, 5 GND, 6 OUT2, 7 IN2, 8 VS (motor supply), 9 EN2, 10 IN3, 11 OUT3, 12 GND, 13 GND, 14 OUT4, 15 IN4, 16 VSS (logic supply, 5 V). Motor A goes across OUT1 and OUT2; IN1 high and IN2 low = forward, swapped = reverse, both the same = brake. EN1 high lets it run; a PWM signal on EN1 sets the speed.
The cost is voltage: each output loses about 1.2–1.8 V across the chip's transistors, so a 6 V motor pack gives the motor roughly 4.5 V. At 600 mA that lost voltage is about a watt of heat — the four GND pins double as the heatsink, so tie all of them to the ground rail and give the chip air.
The numbers
| Channels | 2 motors, bidirectional — or 4 one-way loads |
|---|---|
| Output current | 600 mA continuous, 1.2 A peak — per channel |
| Motor supply (VS, pin 8) | 4.5–36 V — separate from the 5 V logic on pin 16 |
| Voltage drop | ≈ 1.2–1.8 V per output — the motor sees less than the pack |
| Direction | IN1/IN2 = 1/0 forward, 0/1 reverse, 1/1 brake — EN high to run; PWM on EN for speed |
Mistakes everyone makes
- Motors barely turn. The 1.5 V drop plus a 4.5 V pack leaves 3 V. Fix: 6 V or more for the motor supply.
- Board resets when motors start. Motors and logic sharing one battery. Fix: separate motor pack on pin 8, common ground.
- Chip too hot to touch. Stalled motors pull the peak current continuously. Fix: check nothing is jammed; a heatsink or the L298N for bigger motors.
- Only one GND pin wired. The others carry the heat away. Fix: connect all four.
- Both INs high and wondering why it stopped. That is brake. Fix: one high, one low.
Questions people ask
- What is an H-bridge?
- Four switches around a motor that let current flow through it in either direction, so a motor can run forward or backward without swapping wires. The L293D contains two of them.
- Why does my L293D get hot?
- It drops about 1.5 V across its transistors at whatever current the motors draw; at 600 mA that is close to a watt. Stalled motors make it worse. Wire all four GND pins and keep motors from jamming.
- Can I run motors from the same battery as the Arduino?
- You can, but motor spikes drag the supply down and reset the board. Give the motors their own pack on pin 8 and join only the grounds.
Projects that use this part
No project uses it yet — it arrives at Level 9, and the projects for that level are still being written and verified.
verified against: Texas Instruments — L293D datasheet · Adafruit — Using DC motors (motor shield guide)