EN

ULN2803 for relays and loads

Current, voltage drop, chip heating and connection from a microcontroller

Calculator

Load
V
Ω
%
Chip and input
V
°C

Approximate voltage drops and thermal resistances, based on manufacturers' typical curves. For a tight design, use the datasheet of the exact part.

What the ULN2803 is

The ULN2803A is an IC with eight Darlington transistors in common emitter, each with its own input resistor and protection diode. It is the simplest way for a microcontroller, which can only supply a few milliamps per pin, to drive relays, solenoids, valves, buzzers, LED strips or unipolar stepper motors of up to 50 V and a few hundred milliamps. Each channel is a ready-made transistor switch.

The COM pin and the freewheeling diodes

When the current in a coil is switched off, it generates a voltage spike that would destroy the transistor. The ULN2803 has one diode per channel between the output and COM that gives that current a path. For it to work, COM must go to the positive supply of the loads (the 12 or 24 V of the relays, not the 5 V of the logic). If COM is left floating the diodes do nothing; if it is tied to a voltage lower than that of the loads, the diodes conduct and the loads stay permanently on. If the same chip drives loads at different voltages, COM goes to the highest and the inductive loads at lower voltage need their own external diode.

With the diode, the relay takes a little longer to release. If speed matters (fast valves), a zener is added in series with COM so the energy is dumped at a higher voltage, without exceeding the 50 V of the output.

Voltage drop and heating

A Darlington does not fully saturate: between output and ground there remain 0.9 to 1.6 V depending on the current. That drop is subtracted from the voltage the load receives (a 5 V relay powered from 5 V gets only about 4 V, often not enough) and turns into heat:

\[ P = n \cdot V_{CE(sat)} \cdot I \cdot D \qquad T_j = T_a + P\,R_{\theta JA} \le 150\ ^\circ\text{C} \]

with n outputs on at once, D the fraction of time they are on and RθJA the package thermal resistance. Eight small relays (30 mA) barely warm the chip; eight outputs at 300 mA would destroy it. For higher currents, two channels can be paralleled (inputs together and outputs together), although they share the current imperfectly.

Input from Arduino, ESP32 or Raspberry Pi

The ULN2803A has a 2.7 kΩ resistor in series with the base on each input: it connects straight to the pin, with no external resistor, and draws 0.5 to 1.3 mA per input. It works with 5 V and also with the 3.3 V logic of the ESP32, STM32 or Raspberry Pi, although at 3.3 V the base current is marginal for outputs above about 200 to 250 mA. The ULN2804A, with 10.5 kΩ, is meant for 6 to 15 V CMOS logic and is not suitable for 3.3 V.

The grounds must be connected together: microcontroller GND, pin 9 and the negative of the load supply. If you want full isolation between logic and power, use optocouplers or relay modules with optocouplers.

Alternatives

ICChannelsNotes
ULN2003A7Same as the ULN2803A with seven channels (DIP-16). Very common on 28BYJ-48 stepper motor boards
TBD62083A8MOSFET-based replacement: much lower drop and less heat, same pinout
TPL7407L7MOSFET, ULN2003 replacement with a lower drop
Discrete MOSFET (logic level)1For currents of several amps; needs its own diode if the load is inductive
TPIC6B5958Shift register with power outputs: eight loads from three microcontroller pins

Related: transistor as a switch, optocouplers, PWM calculator and LED resistor.