Parts

ULN2003 vs L293D: which driver for your relay, stepper or DC motor

By

Both chips sit in a 16-pin DIP and both have the flyback diodes built in, which is why kits throw them in together. They are different kinds of driver.

The ULN2003A has seven low-side switches. Each output can only pull its load down to ground, and is rated 500 mA peak and 50 V. Current flows one way through the load, so it switches relays, solenoids, lamps, LED strings and unipolar (5- or 6-wire) steppers. It cannot reverse a motor.

The L293D has four half-H drivers. Each output drives high or low, so two outputs make a full H-bridge and the load sees current in either direction. It reverses DC motors and drives bipolar (4-wire) steppers. TI rates it at 600 mA continuous per channel and 1.2 A for pulses up to 100 µs, from 4.5 V to 36 V.

Rule of thumb: if the load only ever turns on and off, use the ULN2003A. If anything has to run backwards, use the L293D.

The pinouts do not match. Pin 8 is ground on the ULN2003A and the motor supply on the L293D, so plugging one into the other's socket shorts the supply (see what happens if you swap them).

Datasheet: Texas Instruments ULN200x, ULQ200x High-Voltage, High-Current Darlington Transistor Arrays (SLRS027T) (PDF)

Advertisement

Pinout by package

ULN2003AN DIP-16 · TI1=1B 2=2B 3=3B 4=4B 5=5B 6=6B 7=7B 8=E 9=COM 10=7C 11=6C 12=5C 13=4C 14=3C 15=2C 16=1C
top view, notch upULN2003AN1161B1C2152B2C3143B3C4134B4C5125B5C6116B6C7107B7C89ECOM

Top view, notch up: inputs down the left (1 to 7), E (ground) on 8, COM on 9, outputs up the right (10 to 16).

Source: Texas Instruments ULN200x, ULQ200x High-Voltage, High-Current Darlington Transistor Arrays (SLRS027T), p. 3 (Pin configuration and functions: 1B-7B pins 1-7, E pin 8, COM pin 9, 7C-1C pins 10-16)

L293DNE DIP-16 · TI1=1,2EN 2=1A 3=1Y 4=GND 5=GND 6=2Y 7=2A 8=VCC2 9=3,4EN 10=3A 11=3Y 12=GND 13=GND 14=4Y 15=4A 16=VCC1
top view, notch upL293DNE1161,2ENVCC12151A4A3141Y4Y413GNDGND512GNDGND6112Y3Y7102A3A89VCC23,4EN

Top view, notch up: pin 1 (1,2EN) top left, VCC2 (motor supply) on 8, VCC1 (logic supply) on 16.

Source: Texas Instruments L293x Quadruple Half-H Drivers (SLRS008D), p. 3 (Section 5, NE package 16-pin PDIP top view, and the pin functions table)

Same package, no shared pinout

Hold both chips notch up and read across. Only the package matches. The ULN2003A runs its inputs down one side and its outputs up the other, with ground and the diode common on 8 and 9. The L293D splits into two halves around four ground pins in the middle, with the motor supply on 8 and the logic supply on 16.

PinULN2003AL293D11B in1,2EN22B in1A in33B in1Y out44B inGND55B inGND66B in2Y out77B in2A in8E (ground)VCC2 (motor)9COM (diodes)3,4EN107C out3A in116C out3Y out125C outGND134C outGND143C out4Y out152C out4A in161C outVCC1 (logic)Red: a supply or ground on one chip lands on a signal pin of the other.
Figure 1. The 16 pins of each chip, from TI's pin tables. The red rows are where a supply or ground on one chip meets an input, output or enable on the other.

Behind each output there is a different circuit. A ULN2003A channel is a Darlington pair with a 2.7 kΩ resistor in series with its input, and a diode from the output up to COM. An L293D output has a transistor to the supply and one to ground, so it can push current out as well as pull it in.

ULN2003A: one channel of 7+V (load supply)loadCOMC (out)E (pin 8)2.7 kΩB (in)pulls down onlyL293D: two half-H of 4VCC2 (motor supply)updown1Yupdown2YMcurrent can floweither way
Figure 2. Left: one ULN2003A channel, with the 2.7 kΩ input resistor, the Darlington pair to E and the clamp diode to COM. Right: two L293D half-H outputs with a motor between them, which makes one H-bridge.

Side by side

What each chip is, and its current, voltage and temperature limits, from the TI datasheets
ParameterULN2003ANDIP-16L293DNEDIP-16
What it is7 NPN Darlington low-side switches4 half-H (push-pull) drivers
Output canpull down only (open collector)drive high, drive low, or go high-impedance
Current per output500 mA peak (absolute maximum)600 mA continuous; 1.2 A for pulses up to 100 µs
Whole-chip current limit2.5 A total out of the E pinset by heat (see example 3)
Load voltageup to 50 V4.5 to 36 V on VCC2
Logic supply pinnoneVCC1, 4.5 to 7 V (TI: 5 V ± 0.5 V)
Thermal resistance, PDIP RθJA66.7 °C/W36.4 °C/W (GND pins 4, 5, 12, 13 carry the heat)
Thermal shutdownnot listedyes; outputs go high-impedance
Operating temperature TA−40 to 70 °C (ULN2003AI: −40 to 105 °C)0 to 70 °C
Inputs, losses, idle current and timing at 25 °C
ParameterULN2003ANDIP-16L293DNEDIP-16
Logic inputfor 3.3 V and 5 V logic; 2.4 V max needed for 200 mAhigh at 2.3 V or more; tolerates up to 7 V
Input current0.93 typ / 1.35 max mA at 3.85 V0.2 µA typ (high), 3 µA typ (low) on the A inputs
Voltage lost in the driver0.9 typ / 1.1 max V at 100 mA; 1.2 typ / 1.6 max V at 350 mA1.4 V typ high side plus 1.2 V typ low side at 0.6 A (1.8 V max each)
Idle current50 µA max leakage per output at 50 Vlogic 8 to 35 mA typ (60 mA max), plus 2 to 14 mA typ on VCC2
Flyback diodesbuilt in, common cathode on COM (pin 9)built in, to VCC2 and to ground
Switching delay0.25 µs typ, 1 µs max400 to 800 ns typ (L293DNE)
Enable pinsnone1,2EN and 3,4EN; low turns that pair off

The L293D loses voltage twice because the motor current passes through two of its transistors, one on the high side and one on the low side. A ULN2003A load only passes through one.

The difference that decides it: one direction or two

A ULN2003A output is a transistor between the load and ground. Connect the other end of the load to your supply, turn the input on, and current flows. Turn it off and the load stops. That is all it can do: there is no transistor to pull the output up, so it can never push current the other way.

An L293D output has a transistor to the supply and a transistor to ground. Put a motor between outputs 1Y and 2Y. Drive 1A high and 2A low and the motor turns one way; swap them and it turns the other. Set both inputs the same and TI's table calls it a fast motor stop; pull the enable low and the motor coasts to a free-running stop.

L293D (half of it)1 1,2EN2 1A7 2A8 VCC216 VCC1 (5 V)3 1Y6 2Y4, 5 GNDMTI table 3EN1A2AmotorHLHturn rightHHLturn leftHLLfast stopHHHfast stopLXXcoastH = high, L = low, X = either.A low enable lets the motor coast. Equal A inputsput both motor leads on one rail and stop it fast.
Figure 3. One L293D H-bridge: the motor between outputs 1Y and 2Y, both supplies, and TI's bidirectional control table (SLRS008D table 3).

This is also the stepper rule. A unipolar stepper has a center tap on each coil. You tie the taps to the supply and pull the four coil ends to ground in sequence, which is exactly what four ULN2003A channels do. A bipolar stepper has no center tap, so the current through each coil has to reverse. That needs two H-bridges, which is one L293D.

Worked examples

1. A 12 V relay from a 3.3 V or 5 V board (ULN2003A)

TI's own test drives an OMRON G5NB relay with a 2.8 kΩ coil from a 12 V supply and a 5 V input.

TI's formula is I = (VSUP − VCE(sat)) ÷ RCOIL. VCE(sat) is at most 1.1 V at 100 mA and lower at smaller currents, so use 1.1 V as the worst case:

  • I = (12 − 1.1) ÷ 2,800 = 3.9 mA

That is well inside the 500 mA rating, and all seven channels together would draw about 27 mA. Tie COM (pin 9) to the 12 V coil supply so the built-in diodes catch the kick when the relay switches off. If COM is left floating with a relay attached, there is no path for that kick.

A 3.3 V board drives the input directly. At 200 mA of load the ULN2003A needs at most 2.4 V on the input, and this relay draws far less. No base resistor is needed, because the 2.7 kΩ resistor is already inside. Each input draws about 0.93 mA at 3.85 V (1.35 mA max), which any GPIO can supply.

The L293D could switch this relay too, but it needs a separate 5 V logic supply, it can burn up to 60 mA of logic current while doing nothing, and it uses a half-H where one transistor is enough. Choosing between a relay and a solid-state relay in the first place? Relay or SSR for an Arduino or ESP32 covers it.

ULN2003A1 1B8 E16 1C9 COM3.3/5 V GPIOno resistorcommon ground+12 Vrelay coilCOM to +12 V2.8 kΩ coil: (12 − 1.1) ÷ 2,800 = 3.9 mA worst casediode to COM
Figure 4. Example 1: a GPIO pin straight into input 1B, the 12 V relay coil from the supply to output 1C, and COM tied to the same 12 V so the internal diode catches the switch-off kick.

2. A small unipolar stepper on 5 V (ULN2003A)

Example input, not a datasheet value: a 5 V unipolar stepper whose coils measure 50 Ω each, run with two coils on at a time.

  • Coil current, VCE(sat) 0.9 V typ: (5 − 0.9) ÷ 50 = 82 mA
  • Coil current, VCE(sat) 1.1 V max: (5 − 1.1) ÷ 50 = 78 mA
  • Heat in the chip, two coils on: 2 × 0.9 V × 0.082 A = 0.15 W typ, 0.17 W worst case
  • Temperature rise in the PDIP (66.7 °C/W): about 10 °C typ, 11 °C worst case

That runs cool. The only real cost is the drop: about a volt of the 5 V supply never reaches the coil. Measure your own coil resistance and put it into the same formula.

ULN2003A1B-4Bfrom 4 GPIO8 E16 1C15 2C14 3C13 4C9 COMAB+5 Vcentertaps50 Ω coils, two on: 82 mA each, 0.15 W in the chip, about 10 °C riseCurrent only ever flows from +5 V into the chip.
Figure 5. Example 2: the two center taps on +5 V and the four coil ends on outputs 1C to 4C. Which end goes to which output has to match the step sequence your code sends. Each output only ever sinks current, about 82 mA per coil with 50 Ω coils.

3. Reversing a DC motor at 12 V (L293D)

Example input: a 12 V DC motor drawing 0.5 A while running, ambient 40 °C.

TI gives the L293D's drops at 0.6 A, so at 0.5 A they are an upper estimate:

  • Voltage at the motor, typical: 12 − 1.4 − 1.2 = 9.4 V
  • Voltage at the motor, worst case: 12 − 1.8 − 1.8 = 8.4 V
  • Heat in the chip, typical: (1.4 + 1.2) × 0.5 = 1.3 W
  • Temperature rise at 36.4 °C/W: 1.3 × 36.4 = 47 °C, so the junction sits near 87 °C

The motor gets 2.6 to 3.6 V less than the supply. If it needs its full 12 V, feed a higher VCC2 (up to 36 V) or choose a driver with a smaller drop.

Two such motors on one L293D double the heat to 2.6 W and the rise to about 95 °C, which puts the junction near 135 °C. That is 15 °C under the 150 °C absolute maximum, and the 36.4 °C/W figure comes from a JEDEC test board, not a breadboard. Solder the four GND pins to a large copper area or add the heat sink TI shows, or use one chip per motor. The L293D page works through stall current and the heat in more detail.

Don't put the ULN2003A here. It can run this motor in one direction (motor between +12 V and an output, COM to +12 V), but it cannot reverse it.

4. How many ULN2003A channels can carry 350 mA

The ULN2003A is rated 500 mA per channel, but not 500 mA on all seven at once. Two limits apply.

The first is the E pin. All seven channels return through it, and its absolute maximum is 2.5 A, which works out to 357 mA each with all seven on. The second is heat, and it is the tighter one:

  • Each channel at 350 mA: 1.2 V typ × 0.35 A = 0.42 W
  • All seven: 2.94 W, a 196 °C rise in the PDIP. Not possible.
  • What the PDIP can shed at 40 °C ambient with TI's 125 °C junction limit: (125 − 40) ÷ 66.7 = 1.27 W
  • 1.27 W ÷ 0.42 W = 3 channels at 350 mA, continuously

For more current on one load, TI allows paralleling outputs. Heat still caps the total, so run the same sum for your duty cycle.

01 W2 W3 W1.27 W limit1 channel0.42 W2 channels0.84 W3 channels1.26 W4 channels1.68 W7 channels2.94 W
Figure 6. Example 4: heat in a ULN2003A PDIP with 1 to 7 channels each carrying 350 mA (typical VCE(sat) 1.2 V), against the 1.27 W the package can shed at 40 °C ambient with a 125 °C junction.

Worked example in numbers

Relay coil current
3.9 mA
L293D drop at 0.6 A, typ
2.6 V
L293D junction, one motor
87 °C
ULN2003A channels at 350 mA
3

What happens if you swap them

The two chips are not pin compatible, and the mismatch is on the power pins.

A ULN2003A in an L293D socket

Pin 8 carries the motor supply on an L293D board. On the ULN2003A, pin 8 is E, the common emitter that should be at ground. Pins 4, 5, 12 and 13 are grounded on the L293D board, and on the ULN2003A those are inputs 4B and 5B and outputs 5C and 4C. With E above the outputs, the chip's internal diodes conduct from the supply straight into the grounded pins. TI says that parasitic diode "should not be used to conduct current". Expect a hot chip or a dead one, and switch off at once.

An L293D in a ULN2003A socket

Pin 8 is ground on a ULN2003A board, so the L293D's motor supply (VCC2) is grounded. Pin 9 is COM, which is tied to the coil supply, and on the L293D it is the 3,4EN input, rated 7 V at most. On a 12 V relay board that input gets 12 V. Pin 16 is a load output on the ULN board and the logic supply on the L293D. Nothing here works, and the enable input can be damaged.

If a board was laid out for one, use that one.

Pin numbers as on the DIP-16 top view, notch at the top.
PartPinsVerdict
ULN2003A in an L293D socketdifferent pinoutNever. Pin 8 is the motor supply on the L293D board and E (ground) on the ULN2003A; the internal diodes conduct from the supply into the grounded pins.Texas Instruments ULN200x, ULQ200x High-Voltage, High-Current Darlington Transistor Arrays (SLRS027T), p. 3; Texas Instruments ULN200x, ULQ200x High-Voltage, High-Current Darlington Transistor Arrays (SLRS027T), p. 14
L293D in a ULN2003A socketdifferent pinoutNever. VCC2 lands on ground, the 3,4EN input (7 V max) lands on COM at the coil supply, and VCC1 lands on an output.Texas Instruments L293x Quadruple Half-H Drivers (SLRS008D), p. 3; Texas Instruments L293x Quadruple Half-H Drivers (SLRS008D), p. 4
L293 for an L293Dsame pinoutSame pins and more current (1 A), but no clamp diodes inside: add eight fast external diodes for a motor.Texas Instruments L293x Quadruple Half-H Drivers (SLRS008D), p. 4; Texas Instruments L293x Quadruple Half-H Drivers (SLRS008D), p. 7
Advertisement

Which to buy

  • For relays, solenoids, lamps, LED strings, buzzers, unipolar steppers and any load that is only on or off, buy the ULN2003A. It has seven channels, needs no logic supply and takes 3.3 V inputs.
  • For DC motors that reverse, bipolar steppers and anything that needs current both ways, buy the L293D. Budget for the 2.6 V typical drop at 0.6 A and the heat that comes with it.
  • For one load in one direction at more current than either chip handles, use a logic-level MOSFET (see choosing a MOSFET for an Arduino or ESP32) or a TIP120.

Tips and checks

  • On the ULN2003A, connect COM to the load supply whenever the load is a coil. Leave it open only for resistive loads such as LEDs.
  • The ULN2003A's E pin and the board's logic ground must be the same ground, or the inputs have no reference.
  • On the L293D, bypass VCC1 and VCC2 with 0.1 µF or more close to the pins. TI says the two supplies need no particular power-up order.
  • The L293D's logic supply is 5 V ± 0.5 V. Its inputs read 3.3 V logic as high (2.3 V minimum), but pin 16 still needs 5 V.
  • If an L293D cuts out when it gets hot, its thermal shutdown has turned the outputs off. Add copper on the GND pins or lower the current.

What we'd do

For anything that only switches on and off we'd fit a ULN2003A, drive it straight from the GPIO and tie COM to the coil supply. We'd keep the L293D for motors that reverse and bipolar steppers, with one chip per motor once the current passes about half an amp.

Questions people ask

Can a ULN2003 drive a bipolar stepper?

No. A bipolar coil needs current in both directions and ULN2003A outputs can only sink. Use an L293D (two H-bridges, one per coil).

Can an L293D drive a unipolar stepper?

Yes. Each output can pull a coil end to ground, which is all a unipolar motor needs. TI's own L293D examples are bipolar and two-phase motors, though, and for a unipolar motor the ULN2003A does the job with one transistor drop instead of two and no logic supply.

Does the ULN2003 need a resistor between the Arduino pin and the input?

No. Each ULN2003A input has a 2.7 kΩ resistor inside, and TI designed it for 3.3 V and 5 V logic.

Why does my motor run slower on an L293D than on a direct battery connection?

The L293D drops about 1.4 V on the high side and 1.2 V on the low side at 0.6 A (TI typical), so the motor sees about 2.6 V less than the supply.

What is the COM pin on the ULN2003 for?

It joins the cathodes of the seven flyback diodes. Connect it to the supply that feeds your relays or motor coils. Leave it unconnected only for resistive loads like LEDs.

Where to go next

The L293D page has the full pin table, stall current and heat with one and two motors. The motor driver ICs lesson explains H-bridges and PWM speed control, and the relay driving lesson covers the flyback diode from the inside. If the board also needs a regulated logic rail, powering an ESP32 or Arduino is the next read.

Advertisement

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Used in these lessons

Lessons that go deeper

Datasheets this page was checked against

Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.