ULN2003A, ULN2803A and the ULN2003 driver board

The Darlington arrays that let a board pin switch a relay, a solenoid, a 12 V lamp or a stepper's coils, and the ULN2003 board sold with the 28BYJ-48.

The ULN2003A has seven channels in a DIP-16, the ULN2803A eight in a DIP-18, and the ULN2003 driver board is the green board sold with the 28BYJ-48 stepper, on its own. Aliases: ULN2003, ULN2003AN, ULN2803, ULN2003 driver board, ULN2003 stepper driver, Darlington array.

How a channel works

Each channel is a Darlington pair, two NPN transistors in a row, with a 2.7 k resistor in front of its input, exactly as TI draws it (SLRS027). Put a logic high on an input (1B) and that channel's output (1C) pulls down to E (the common emitter, which goes to ground). The load goes between its own supply and the output, so the chip sinks current: it never puts voltage out.

  +12 V ── load ── 1C        1B ── Arduino pin
                   |
           ULN2003A pulls 1C to ground while 1B is high

The 2.7 k is why no base resistor is needed: wire an Arduino pin straight to the input. A 5 V pin puts in about 1.15 mA, a 3.3 V pin about 0.55 mA, and either is enough for a few hundred milliamps out.

Each output also has a clamp diode to COM. Wire COM to the load's supply (the +12 V above) whenever the load is a coil: a relay, a solenoid, a motor or a stepper. When the channel switches off, the coil's current has to go somewhere; the diode carries it back to the supply instead of letting the output spike.

Pinouts

Pin ULN2003A Pin ULN2003A
1 1B 16 1C
2 2B 15 2C
3 3B 14 3C
4 4B 13 4C
5 5B 12 5C
6 6B 11 6C
7 7B 10 7C
8 E (ground) 9 COM (clamp diodes)

Each input is straight across the package from its output. The ULN2803A is the same with eight channels: 1B to 8B on pins 1 to 8, GND on pin 9, COM on pin 10, and 8C to 1C on pins 11 to 18.

The driver board has IN1 to IN4 and the power pins VCC (+) and GND (-) on its header, and the motor plug's four coil pins OUT1 to OUT4 (channel 1 to 4's outputs; the plug's fifth pin is VCC). COM is wired to VCC on the board, and each output has its LED and a 1 k resistor from VCC, so an output that is off sits at VCC and one that is on lights its LED with about 2.5 mA.

The numbers

From TI's table for the ULN2003A, against what the simulator gives:

TI typical (max) simulator
saturation at 100 mA 0.9 V (1.1) 0.905 V
saturation at 200 mA 1.0 V (1.3) 1.021 V
saturation at 350 mA 1.2 V (1.6) 1.197 V
input current at 3.85 V 0.93 mA (1.35) 0.88 mA
clamp diode at 350 mA 1.7 V (2) 1.706 V

The saturation voltage is the reason a ULN2003 is not a switch to ground: a Darlington output never gets below about 0.8 V, so a 5 V relay on one sees about 4 V, and a 28BYJ-48 on 5 V is weaker than the arithmetic says.

While it runs

On the chips, each input lead lights while that channel is on (its input at least 1.4 V above E). On the board, LED A to D lights while OUT1 to OUT4 is pulled more than 1.7 V below VCC, which is when a real board's LED lights.

What the model gets right

The 2.7 k input resistor and the input current it gives, the Darlington's saturation at every current, that a channel turns on from a 3.3 V pin as well as a 5 V one, and that a ULN2003 only sinks. The clamp diodes: with COM on the coil's supply, a 12 V solenoid switched off holds its output about 1.4 V above 12 V while its current dies away. With COM left off the output leaps far past the chip's 50 V rating instead. Each output's junction with the chip's substrate is a diode from E, so an output that rings below ground stops about 0.7 V under it.

What it does not model

There is no breakdown: the kick of a coil with COM left off goes on to thousands of volts here, where a real chip breaks down near its 50 V rating and is damaged. There is no heating and no package power limit: a real DIP-16 cannot carry several channels at 350 mA at once for long, and here it can. Sum the currents and check TI's duty-cycle graphs. The board's four LEDs are simulated as a red LED and 1 k from VCC to each output, the value most of these boards fit; some boards fit 220 Ω, which is brighter and which this does not offer. The transistors are the 2N2222A card with one fitted number (0.85 Ω of emitter resistance on the output transistor, which puts the saturation on TI's line); TI publishes no model card for the array.

Common mistakes

Wiring the load from the output to ground: the ULN2003 only pulls down, so the load goes from its supply to the output. Leaving COM unconnected with a coil on the output, so nothing catches the kick. Forgetting to join the load supply's ground to the board's ground: E has to be the same ground the Arduino uses.

See it in action

ULN2003A solenoid from an Arduino and ULN2003 board stepping its LEDs are in the gallery at /templates, and /learn/uln2003-darlington-driver walks through them.