EE Primers · Communication interfaces · Driver Topologies · 3 of 9

Open-drain: drive low, let a resistor do the rest

Remove the PMOS from a push-pull output and what remains is an open-drain output: a transistor that can connect the wire to ground, or let go. A resistor to a supply pulls the wire high whenever nobody is pulling it low. Any number of such outputs can share one wire, and two of them can never short the rails, because only one level is ever actively driven. The price is the rising edge: it is an RC charge through the resistor, slow and asymmetric, and the whole art of open-drain design is choosing that resistor. This page covers wired-AND logic, the rise- and fall-edge math, pull-up sizing, ways to beat the RC, free level translation, and three users of the idea: I²C, 1-Wire and LIN.

How it works, step by step

  1. Keep only the bottom switch. An NMOS (or an NPN) connects the pin to ground. Nothing on the chip can pull the pin up.
  2. A resistor supplies the high. A pull-up Rp from the pin to a supply holds the wire high whenever every transistor on it is off.
  3. Pulling low is active and fast. Turning the transistor on sinks current and drags the wire to VOL. The fall is limited by the transistor's current, not by Rp.
  4. Releasing is passive and slow. When the transistor lets go, only Rp charges the wire's capacitance back up. The rise is an RC, with a 10–90% time of 2.2·Rp·C.
  5. Many outputs, one wire, no fights. The wire is low if anyone pulls and high only when everyone releases: wired-AND. The current is always capped at (V − VOL)/Rp, because no device ever connects the wire to the supply.
  6. Rp is a compromise. A small Rp rises fast but costs current on every low, and the transistor must sink it. A large Rp saves current but rises slowly. Those two limits bound a window, and Rp is chosen inside it.
  7. The pull-up chooses the high level. Because the chip never drives high, the wire rises to whatever Rp is tied to. A 1.8 V device can signal to a 3.3 V one with no level shifter.
01 · Intuition

A shared wire held up by a spring

Picture the wire as a rope held up by a spring (the pull-up resistor). Every device on the bus has a hand that can pull the rope down, and no device can push it up. If anyone pulls, the rope is down. Only when everyone lets go does the spring raise it again, and it rises at the pace the spring allows. Nobody can be harmed by two hands pulling at once.

Electrically the "hand" is an NMOS transistor (open drain) or an NPN transistor (open collector) with its source or emitter at ground and nothing above it on the chip. "Open" means the upper terminal is brought out to the pin and left for the board to complete.

Two open-drain outputs and a pull-up. Amber: current flow. Whatever the combination, the only path from VDD to ground goes through Rp.
02 · Wired logic

Wired-AND, and why there is no contention

With "released" read as 1 and "pulling" read as 0, the bus level is the AND of every device's output: the line is 1 only if all devices output 1. Read in active-low terms (pulling = asserting), the same line is the OR of all assertions. That is why a single open-drain wire can serve as a shared interrupt request (any device can assert, the controller polls to find which), a shared reset (any supervisor can hold the system in reset), or a power-good line (good only if every rail is good).

Device ADevice BBusCurrent from VDD
releasedreleased1 (VDD)0 (only leakage)
pullingreleased0(VDD − VOL)/Rp
releasedpulling0(VDD − VOL)/Rp
pullingpulling0(VDD − VOL)/Rp, shared

The current is always set by the resistor, never by two transistors in series across the supply, so the worst case is a few milliamps. This is what makes non-destructive arbitration possible: in I²C, a controller that transmits a 1 but reads back a 0 knows another controller is transmitting a 0 at the same time, and backs off. Nothing was damaged and the winner's bit arrived intact. CAN uses the same principle on a differential pair.

Only if every driver is open-drainA single push-pull output on an open-drain bus breaks the guarantee: when it drives high while another device pulls low, the current is set by two transistors, not by Rp. Microcontroller I²C pins must be configured as open-drain alternate functions, not as push-pull GPIO. Bit-banged I²C should switch the pin between "output low" and "input", never drive it high.
03 · Edges

The rising edge is an RC; the falling edge is a current sink

Rising edge

When the last device releases, the bus capacitance Cb (trace, plus every pin on the bus) charges through Rp from its low level toward VDD:

$$v(t)=V_{\text{DD}}-(V_{\text{DD}}-V_{\text{OL}})\ \text{e}^{-t/R_{\text{p}}C_{\text{b}}}$$

The time between two fractions k1 and k2 of VDD (ignoring VOL) is RpCb ln[(1 − k1)/(1 − k2)], giving the two constants every I²C designer uses:

$$t_{\text{r}(30\text{–}70\,\%)}=R_{\text{p}}C_{\text{b}}\,\ln (0.7/0.3)=0.8473\,R_{\text{p}}C_{\text{b}}\qquad t_{\text{r}(10\text{–}90\,\%)}=2.197\,R_{\text{p}}C_{\text{b}}$$

The I²C specification (UM10204) measures rise time between 0.3 VDD and 0.7 VDD, hence 0.8473.

Worked example. Fast-mode I²C at 3.3 V, \(C_{\text{b}}=200\ \text{pF}\), \(R_{\text{p}}=1.5\ \text{k}\Omega\): \(\tau =300\ \text{ns}\), \(t_{\text{r}}=254\ \text{ns}\), inside the 300 ns limit. The same bus with a 4.7 kΩ pull-up (a common copy-paste value) has \(t_{\text{r}}=797\ \text{ns}\): fine for 100 kHz standard mode (1000 ns limit), illegal at 400 kHz.

Falling edge

When a device pulls low, its NMOS starts in saturation and sinks a large, roughly constant current while the pull-up keeps feeding in a small one. The capacitor discharges at

$$\text{d}v/\text{d}t=-(I_{\text{sink}}-V/R_{\text{p}})/C_{\text{b}}\qquad \Rightarrow \quad t_{\text{f}}\approx C_{\text{b}}\cdot 0.4\,V_{\text{DD}}/I_{\text{sink}}\quad (30\text{–}70\ \%)$$

A 20 mA sink into 200 pF at 3.3 V falls through the 30–70 % band in about 13 ns, twenty times faster than the 254 ns rise above. Fast falls ring on long buses and radiate, so I²C devices limit their fall slew (UM10204 sets a minimum tf of 20 ns × VDD/5.5 V in Fast-mode).

Consequences of the asymmetry

  • Duty-cycle distortion. A square wave on an open-drain line arrives with its high time shortened by the extra rise delay. At high rates the slow edge eats into setup and hold time. I²C absorbs this by specifying tHIGH and tLOW separately and by clock stretching.
  • Speed is set by the passive edge. Open-drain buses top out around 1–3.4 MHz (I²C Fm+ and Hs) for board-sized capacitance, compared with tens of MHz for push-pull.
  • Glitch filtering. Slow rising edges cross the threshold slowly and are vulnerable to noise; I²C inputs have Schmitt triggers and a 50 ns spike filter.
04 · Pull-up sizing

Choosing Rp: a window between two limits

Lower limit: the output must still reach a valid low. The weakest device on the bus guarantees VOL only up to its rated sink current IOL, so the resistor must not supply more:

$$R_{\text{p},\min}=(V_{\text{DD}}-V_{\text{OL},\max})/I_{\text{OL}}\qquad 3.3\ \text{V},0.4\ \text{V},3\ \text{mA}\to 967\ \Omega$$

Upper limit: the edge must rise in time.

$$R_{\text{p},\max}=t_{\text{r},\max}/(0.8473\,C_{\text{b}})\qquad 300\ \text{ns},200\ \text{pF}\to 1.77\ \text{k}\Omega$$

A third, usually weaker, upper limit comes from leakage: the bus must stay above VIH with every input and every released output leaking, as for tri-state pull-ups. If \(R_{\text{p},\min}\gt R_{\text{p},\max}\) there is no solution: reduce Cb (shorter bus, fewer devices, split it with a buffer or multiplexer), use devices with more sink current (Fm+ parts sink 20 mA), or use an active pull-up.

Power. Each line dissipates (VDD − VOL)·VDD/Rp while held low: 11 mW at 1 kΩ and 3.3 V. With a 50 % duty clock and data, a 400 kHz bus with 1 kΩ pull-ups averages roughly 10 mW. In battery products use the largest resistor that meets the rise time, and do not leave a line held low in sleep.

I²C modefSCLtr max (30–70 %)IOL at \(V_{\text{OL}}=0.4\ \text{V}\)Cb maxRp window at 3.3 V, 200 pF
Standard100 kHz1000 ns3 mA400 pF967 Ω – 5.9 kΩ
Fast400 kHz300 ns3 mA400 pF967 Ω – 1.77 kΩ
Fast-mode Plus1 MHz120 ns20 mA550 pF145 Ω – 708 Ω
More detailThe I²C primer has worked transactions, a pull-up calculator against all three modes, clock stretching and bus recovery.
05 · Beating the RC

Current-source pull-ups and rise-time accelerators

The resistor's weakness is that its current falls as the bus rises: at 70 % of the way up it delivers only 30 % of its initial current. A constant current source with the same maximum current charges the bus in a straight line:

$$t_{\text{r}(30\text{–}70\,\%)}=C_{\text{b}}\cdot 0.4\,V_{\text{DD}}/I$$

For 200 pF at 3.3 V with 3 mA (the same current a 967 Ω resistor gives at VOL): 88 ns, against 164 ns for the resistor. Same static current when the line is low, almost twice as fast. I²C Hs-mode controllers use a switched current-source pull-up on SCL for exactly this reason.

Rise-time accelerators (for example LTC4311-type parts) sit on the bus as a two-terminal device. They watch for a rising edge (bus above about 0.6 V and rising) and then switch on a strong pull-up current until the bus reaches near VDD. The static pull-up can then be large (low power, valid VOL), while the edge is fast. They allow I²C buses of several nanofarads.

Buffers and multiplexers split one heavily loaded bus into segments each with its own pull-up and capacitance budget. A bus buffer must preserve the wired-AND across the split, which is why I²C buffers use special offset low levels (the buffer's own low output is about 0.5 V so it can tell its own pull-down from a device's).

06 · Level translation

The pull-up chooses the voltage

An open-drain output does not care what its pull-up connects to, within the transistor's voltage rating. A 1.8 V device can signal a 3.3 V receiver by pulling down a line that is pulled up to 3.3 V, provided its pin is tolerant of 3.3 V (no ESD diode to its 1.8 V rail). Open-collector parts such as comparators (LM339) and Darlington arrays (ULN2003) take this to 30–50 V.

The bidirectional MOSFET shifter

For a pin that is not tolerant, and for bidirectional lines like I²C, the standard circuit is one N-channel MOSFET per line (BSS138 class) with its gate at the lower supply, source on the low side, drain on the high side, and pull-ups on both sides.

  • Nobody pulls: both sides are pulled to their own rails. \(V_{\text{GS}}=0\) on the MOSFET, so it is off and the two sides are isolated.
  • Low side pulls down: the source falls, VGS exceeds VT, the MOSFET turns on and pulls the high side down through its channel.
  • High side pulls down: the drain falls; the MOSFET's body diode (anode at the source, cathode at the drain) becomes forward biased and drags the source down until VGS exceeds VT, then the channel turns on and completes the pull-down.

Each side keeps its own RC rise, so size each pull-up for its own side's capacitance.

One line of the bidirectional MOSFET level shifter. Gate at the low rail; each side has its own pull-up.
07 · 1-Wire

1-Wire: data and power on one open-drain line

Maxim's 1-Wire bus is a single open-drain line plus ground, with a pull-up (typically 4.7 kΩ) to 3–5 V. All timing is set by the controller's falling edges: it pulls low to start each time slot, and devices either respond by holding the line low or leave it to rise.

  • Reset and presence: controller holds low ≥ 480 µs, releases; devices answer with a 60–240 µs low pulse.
  • Write 1 / write 0: a 1–15 µs low pulse or a 60–120 µs low pulse inside a 60 µs+ slot.
  • Read: controller pulls low for ≥ 1 µs and releases; the device holds the line low for a 0; the controller samples within 15 µs of the falling edge.

That 15 µs window is where the RC matters. After a 1 the line must rise above VIH before the sample point: \(t=R_{\text{p}}C\,\ln [V_{\text{DD}}/(V_{\text{DD}}-V_{\text{IH}})]\). With 4.7 kΩ and \(V_{\text{IH}}\approx 2.2\ \text{V}\) at 5 V, \(\ln (5/2.8)=0.58\), so C must be below about (15 µs − release time)/\((0.58\times 4.7\ \text{k}\Omega )\approx 4.5\ \text{nF}\). Cable at 50 pF/m limits a passive bus to tens of metres; longer networks use an active pull-up.

Parasitic power. Devices can run without a supply pin by charging an internal capacitor through a diode from the data line while it is high. During high-current operations (a DS18B20 temperature conversion draws up to about 1.5 mA) a 4.7 kΩ pull-up would have to drop 7 V, which is impossible, so the controller switches in a strong pull-up (a PMOS to the rail) for the duration. The topology becomes briefly push-pull, and the controller must not start that while anyone could be pulling low.

08 · LIN

LIN: open-drain at battery voltage

The Local Interconnect Network (ISO 17987) is a single-wire automotive bus up to 20 kbit/s, referenced to the battery rather than a logic supply. Physically it is an open-drain bus; the "master–slave" description refers to the protocol, where the master schedules every frame by sending its header, not to the electrical drive.

  • Pull-ups: each slave has an internal 30 kΩ pull-up to VBAT in series with a diode; the master node adds an external 1 kΩ pull-up with a diode. The diodes stop the bus from back-feeding a node whose battery connection is lost.
  • Driver: a low-side transistor that pulls the bus to ground for a dominant bit (logic 0). It is current-limited (typically 40–200 mA) so a bus shorted to the battery is survivable.
  • Levels: recessive (logic 1) is near VBAT; the receiver reads dominant below 0.4 VSUP and recessive above 0.6 VSUP, with hysteresis. Ratiometric thresholds make it tolerant of the battery swinging between 7 and 18 V.
  • Slope control: both edges are deliberately slow, about 1–3 V/µs on the falling edge, set by the driver; the rising edge is the bus RC. This keeps emissions low on an unshielded wire running through the vehicle.

Bus time constant. The specification bounds the RC of the whole network to \(\tau =1\)–5 µs. With a master (1 kΩ) and n slaves (30 kΩ each) in parallel:

$$R_{\text{eq}}=1/(1/1\ \text{k}\Omega +n/30\ \text{k}\Omega )\qquad \tau =R_{\text{eq}}(C_{\text{master}}+n\,C_{\text{slave}}+C_{\text{wire}})$$

Ten slaves \((R_{\text{eq}}=750\ \Omega )\) with the master's 220 pF, 10 × 220 pF at the slaves and 40 m of wire at 150 pF/m (6 nF): \(\tau =750\ \Omega \times 8.4\ \text{nF}=6.3\ \text{µs}\), too slow. Fewer metres of wire, smaller slave capacitors or a stronger master pull-up bring it back into range.

Why the duty-cycle limits exist. At 20 kbit/s a bit lasts 50 µs. A dominant-to-recessive edge rises with τ while the recessive-to-dominant edge falls with the controlled slope, and the thresholds move with ground shift between nodes. The specification therefore guarantees the received duty cycle only within limits (at 20 kbit/\(s\,D_{1}\ge 0.396\) and \(D_{2}\le 0.581\)), and the sample point is placed near the middle of the bit.

LIN physical layer: master pull-up 1 kΩ with diode, slave 30 kΩ with diode, slope-controlled low-side drivers.
09 · In practice

Where open-drain is used

UseWhy open-drainTypical pull-up
I²C, SMBus, PMBusMulti-controller arbitration, clock stretching, ACK from the receiver on the same wire1–10 kΩ (by mode and capacitance)
Shared interrupt (IRQ̅), alert (SMBALERT̅)Wired-OR of active-low requests4.7–100 kΩ
System reset from supervisorsAny supervisor can hold reset; no fight with the processor's own reset output10–100 kΩ
Power-good chainsWired-AND of every rail's status10–100 kΩ
Level translation, relay and LED drivePull-up rail independent of the driver's supplyby load
1-WireSingle line for data, timing and parasitic power4.7 kΩ + strong pull-up
LINSingle wire at battery voltage, robust to node loss and shorts1 kΩ master, 30 kΩ slaves
10 · Self-check

Questions

A 400 kHz I²C bus at 3.3 V measures 320 pF. Is there a legal pull-up with 3 mA devices?

\(R_{\min}=2.9/3\ \text{mA}=967\ \Omega\); \(R_{\max}=300\ \text{ns}/(0.8473\times 320\ \text{pF})=1.11\ \text{k}\Omega\). A 1 kΩ resistor fits, with \(t_{\text{r}}=271\ \text{ns}\). Little margin: split the bus or add an accelerator.

Why is open-drain safe against contention while push-pull is not?

Only the low level is actively driven. With any combination of outputs the only path from the supply to ground passes through the pull-up resistor, which limits the current to about VDD/Rp.

How much faster is a 3 mA current-source pull-up than a 967 Ω resistor on 200 pF at 3.3 V (30–70 %)?

Current source: \(200\ \text{pF}\times 1.32\ \text{V}/3\ \text{mA}=88\ \text{ns}\). Resistor: \(0.8473\times 967\times 200\ \text{pF}=164\ \text{ns}\). About 1.9× faster for the same static current.

Why does the LIN master pull-up have a diode in series?

If the master loses its battery feed, the bus (held up by other nodes) would otherwise back-power the master through its pull-up. The diode blocks reverse current.

A DS18B20 in parasitic mode reads 85 °C (its power-on value) after every conversion. Likely cause?

No strong pull-up during conversion. The 4.7 kΩ resistor cannot supply ≈ 1.5 mA, the device's storage capacitor droops, and it resets.

← Tri-stateNext: Dominant / recessive (CAN) →I²C primer →UART and LIN →