Lesson 4.2 · Module 4: Digital Hardware & Embedded Protocols

Open-Drain vs Push-Pull Outputs (I2C Pull-Ups)

Two ways a chip can drive a wire: push-pull (actively high and low) or open-drain (only pulls low). Shared data buses like I²C use open-drain.

The live, interactive simulation for this lesson opens here when JavaScript is on.

Key ideas

  • Push-pull outputs fight each other if two chips drive one wire in opposite directions — a short circuit.
  • Open-drain outputs only pull low; a pull-up resistor pulls the wire high, so nobody fights.
  • The price: the resistor charges the wire slowly, giving a “shark-fin” rising edge.

Try this in the simulation

  • In push-pull mode, enable “Device B pulls low” and see the contention current.
  • In open-drain mode, make R_P smaller to speed up the rise time.
  • Hover any wire or part in the circuit to see its live voltage and current. Click to pin the readout.

What is the difference between open-drain and push-pull outputs?

A push-pull output actively drives the wire both high and low. An open-drain output can only pull the wire low, and a pull-up resistor lets it float back high. When two chips share one wire, push-pull outputs would fight and short-circuit each other, while open-drain outputs cannot, which is why buses like I²C use open-drain. The price is a slower rising edge, because the pull-up resistor has to charge the wire’s capacitance.

What you’ll learn

  • How push-pull and open-drain outputs are built.
  • Why two push-pull outputs on one wire can damage each other.
  • Why I²C buses need pull-up resistors.
  • How the pull-up resistor value sets the shape and speed of the rising edge.

The formula, letter by letter

tr=0.8473 RP Cbus=796 ns    (≤300 ns)IOL=UDDRP=702 μA    (≤3 mA)\begin{aligned}\htmlClass{mv mv-v_bus}{\htmlStyle{font-size:1.00em}{\htmlData{sym=t_r}{t_{\mathrm{r}}}}} &= 0.8473\, \htmlClass{mv mv-rp}{\htmlStyle{font-size:1.17em}{\htmlData{sym=R_P}{R_{\mathrm{P}}}}}\, \htmlClass{mv mv-cbus}{\htmlStyle{font-size:1.22em}{\htmlData{sym=C_bus}{C_{\mathrm{bus}}}}} = \htmlData{funit=ns,v=7.964620000000001e-7}{\text{796 ns}}\;\; (\le \htmlData{funit=ns,v=3e-7}{\text{300 ns}})\\ \htmlData{sym=I_OL}{I_{\mathrm{OL}}} &= \frac{\htmlData{sym=U_DD}{U_{\mathrm{DD}}}}{\htmlData{sym=R_P}{R_{\mathrm{P}}}} = \htmlData{funit=µA,v=0.000702127659574468}{\text{702 }\mu\text{A}}\;\;(\le 3\,\htmlData{funit=mA}{\text{mA}})\end{aligned}

Shown with this lesson’s starting values. In the simulation the numbers change as you move the sliders.

trt_{\mathrm{r}}
Rise time (s · second) : How long a signal takes to rise from LOW to HIGH.
RPR_{\mathrm{P}}
Pull-up resistor (Ω · ohm)
CbusC_{\mathrm{bus}}
Bus capacitance (F · farad) : All the capacitance on a bus wire: pins, traces and cable.
IOLI_{\mathrm{OL}}
Current the pin sinks when LOW (A · ampere)
UDDU_{\mathrm{DD}}
Supply voltage (V · volt) : The positive supply rail (DD: "drain") of a chip. Datasheets usually write it V_DD.

Common questions

Why does I²C use open-drain?

Several devices share the same two wires. With open-drain outputs any device can pull a wire low without fighting the others, and the pull-up resistor takes it high when nobody is pulling.

What value should an I²C pull-up resistor have?

Commonly between 2.2 kΩ and 10 kΩ at 3.3 V. Smaller values give faster, cleaner edges but waste more current when the line is pulled low.

Why is the rising edge of an open-drain signal slow?

The wire acts like a small capacitor, and only the pull-up resistor charges it. That gives the typical RC curve, the shark-fin shape, instead of a sharp edge.

Keep going

Words used in this lesson

Parts in this lesson

All lessons · How components work · Glossary