L293D Motor Driver IC with an Arduino Uno
A 16-pin DIP with two H-bridges and built-in clamp diodes that drives two DC motors forward and reverse at 600 mA each.

The L293D's logic supply VCC1 wants 4.5 V to 7 V, so on an Arduino Uno it takes the 5V pin, while the motors get their own supply on VCC2. Direction comes from D2 to D5 and speed from PWM on D9 and D10, two of the Uno's six PWM pins.
Wiring the L293D Motor Driver IC to the Arduino Uno
Pin by pin.
| L293D Motor Driver IC | Arduino Uno |
|---|---|
| EN1 | D9 |
| IN1 | D2 |
| IN2 | D3 |
| EN2 | D10 |
| IN3 | D4 |
| IN4 | D5 |
| VCC1 | 5V |
| GND | GND |
What to know on the Arduino Uno
- VCC1 draws up to 60 mA with all outputs low, a real share of what the Uno's 5V pin can spare over USB; the motor current comes only from VCC2, never through the Uno.TI L293D datasheet SLRS008D, p. 5
- D9 and D10 are driven by Timer1. If the project adds a servo, the Servo library takes that timer and disables analogWrite() on D9 and D10, so the enable pins stop controlling speed; move them to D6 and D11, the two PWM pins this wiring leaves free.Arduino Servo library reference
- analogWrite() on D9 and D10 runs at about 490 Hz on the Uno, low enough that small motors may whine audibly at partial speed. D5 and D6 run at about 980 Hz.Arduino language reference, analogWrite()
- The chip drops about 2.6 V at load, so a motor on a 6 V VCC2 sees only about 3.4 V. The Uno's 5V cannot run the motors usefully even if VCC2 were tied to it.TI L293D datasheet SLRS008D, p. 5
L293D Motor Driver IC code for the Arduino Uno
Compiled for arduino:avr:uno on 2026-10-29.
// L293D Motor Driver IC on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/l293d-motor-driver/arduino-uno
const int EN1 = 9, IN1 = 2, IN2 = 3; // channel 1 (motor A)
const int EN2 = 10, IN3 = 4, IN4 = 5; // channel 2 (motor B)
void setup() {
const int pins[] = {EN1, IN1, IN2, EN2, IN3, IN4}; // an array: AVR has no <initializer_list>
for (int p : pins) pinMode(p, OUTPUT);
}
// speed: -255..255, its sign the direction
void drive(int en, int inA, int inB, int speed) {
digitalWrite(inA, speed > 0);
digitalWrite(inB, speed < 0);
analogWrite(en, abs(speed));
}
void loop() {
drive(EN1, IN1, IN2, 200); drive(EN2, IN3, IN4, 200); delay(2000); // both forward
drive(EN1, IN1, IN2, 0); drive(EN2, IN3, IN4, 0); delay(1000); // stop
drive(EN1, IN1, IN2, -200); drive(EN2, IN3, IN4, 200); delay(2000); // spin in place
drive(EN1, IN1, IN2, 0); drive(EN2, IN3, IN4, 0); delay(1000);
}
L293D Motor Driver IC on the Arduino Uno: questions
Can the Arduino Uno power the motors through the L293D?
No. The Uno's 5V feeds only VCC1, the logic (up to 60 mA, TI datasheet p. 5). Motors need their own supply on VCC2, 4.5 V to 36 V, with its ground joined to the Uno's.
Why does my L293D motor stop responding to speed when I add a servo on the Uno?
The Servo library disables PWM on D9 and D10, which are EN1 and EN2 here. Move the enable lines to D6 and D11; D3 and D5 already carry IN2 and IN4.
Can I connect the L293D inputs directly to the Uno?
Yes. Inputs read high from 2.3 V and tolerate up to 7 V (TI datasheet, p. 4), so the Uno's 5 V outputs drive them directly.
Keep going
This guide as plain Markdown. /components/l293d-motor-driver/arduino-uno.md