The Engineering Desk
From the makers of RS-1

DesignElectrical Engineering

Choosing I²C pull-up resistor values

Sink current sets the smallest value, and rise time and bus capacitance set the largest.

I²C uses open-drain outputs. Devices can only pull the clock and data lines low; a resistor pulls them back high. Choose that resistor too small and devices can't pull the line low enough. Choose it too large and the line rises too slowly for the bus speed. Both limits can be calculated.

The lower limit: sink current

When a device drives the line low, it must sink the current flowing through the pull-up while keeping the voltage below the logic-low threshold. The I²C specification limits the low-level output voltage VOLV_{OL} to 0.4 V at a sink current IOLI_{OL} of 3 mA in standard and fast modes. That gives the smallest allowed resistor:

Rp,min⁡=VDD−VOLIOLR_{p,\min} = \frac{V_{DD} - V_{OL}}{I_{OL}}

For a 3.3 V bus:

Rp,min⁡=3.3−0.40.003≈967 ΩR_{p,\min} = \frac{3.3 - 0.4}{0.003} \approx 967\ \Omega

The upper limit: rise time

The line rises as an RC charge through the pull-up into the total bus capacitance CbC_b, which includes every device pin, the traces and the connectors. The specification defines rise time between 30% and 70% of VDDV_{DD}. For an RC curve that interval is 0.8473 RC0.8473\,R C, so:

Rp,max⁡=tr0.8473 CbR_{p,\max} = \frac{t_r}{0.8473\,C_b}

The maximum rise time trt_r is 1000 ns in standard mode (100 kHz) and 300 ns in fast mode (400 kHz).

Worked example

A fast-mode bus at 3.3 V with an estimated 150 pF of capacitance:

Rp,max⁡=300×10−90.8473×150×10−12≈2.36 kΩR_{p,\max} = \frac{300 \times 10^{-9}}{0.8473 \times 150 \times 10^{-12}} \approx 2.36\ \text{k}\Omega

Any value between about 1 kΩ and 2.36 kΩ works. A 2.2 kΩ resistor is a common choice. At standard mode the upper limit rises to about 7.9 kΩ, which is why 4.7 kΩ is the familiar default for slow buses.

ModeMax rise timeR max at 150 pFR min at 3.3 V
Standard (100 kHz)1000 ns7.9 kΩ967 Ω
Fast (400 kHz)300 ns2.36 kΩ967 Ω

Practical points

  • Estimate capacitance honestly. Each device adds roughly 5 to 10 pF, and cable can add tens of picofarads per foot. Measure rise time with a scope on the finished board.
  • Only one set of pull-ups. Breakout modules often include their own resistors. Several modules on one bus put them in parallel and can drop the value below the minimum.
  • Long buses may need a bus buffer or a lower bus speed rather than an ever-smaller resistor.
  • Power. Smaller resistors waste more current whenever the line is low. On battery devices, choose the largest value that still meets rise time.

More in Electrical Engineering