I2C Pull-Up Resistor Calculator Formula
Understand the math behind the i2c pull-up resistor calculator. Each variable explained with a worked example.
Formulas Used
Minimum Resistance
r_min = (vcc - vol_max) / (iol_ma / 1000)Maximum Resistance
r_max = rise_time_ns * 1e-9 / (0.8473 * bus_cap_pf * 1e-12)Recommended Value
r_recommended = ((vcc - vol_max) / (iol_ma / 1000) + rise_time_ns * 1e-9 / (0.8473 * bus_cap_pf * 1e-12)) / 2Variables
| Variable | Description | Default |
|---|---|---|
vcc | Supply Voltage(V) | 3.3 |
vol_max | Max Low-Level Voltage(V) | 0.4 |
iol_ma | Sink Current Capability(mA) | 3 |
bus_cap_pf | Total Bus Capacitance(pF) | 200 |
rise_time_ns | Required Rise Time(ns) | 300 |
How It Works
I2C Pull-Up Resistor Sizing
I2C uses open-drain outputs with pull-up resistors. Too small a resistor exceeds sink current; too large slows the rise time.
Formulas
R_min = (VCC - V_OL) / I_OL (current limit)
R_max = t_rise / (0.8473 x C_bus) (rise time limit)
The 0.8473 factor comes from the RC time constant to reach 0.7 x VCC.
Choose a standard value between R_min and R_max. Closer to R_min for faster speeds, closer to R_max for lower power.
Worked Example
3.3 V supply, standard I2C (3 mA sink, 300 ns rise time), 200 pF bus.
vcc = 3.3vol_max = 0.4iol_ma = 3bus_cap_pf = 200rise_time_ns = 300
- 01R_min: (3.3 - 0.4) / 0.003 = 967 ohms
- 02R_max: 300e-9 / (0.8473 x 200e-12) = 1770 ohms
- 03Recommended: (967 + 1770) / 2 = 1369 ohms
- 04Use nearest standard value: 1.2k or 1.5k ohms
Ready to run the numbers?
Open I2C Pull-Up Resistor Calculator