How Bus Capacitance Affects I2C Pull-Up Resistor Values
Selecting the correct pull-up resistor value is critical for reliable I2C communication in embedded electronics, and this choice is directly governed by the total capacitance of the bus. Because I2C utilizes open-drain connections, external resistors are required to pull the signal lines high, creating an RC (resistor-capacitor) circuit with the innate capacitance of the PCB traces and connected devices. This article explains how bus capacitance limits the maximum resistance you can use by affecting signal rise times, how to balance this against the minimum resistance dictated by transistor current limits, and how to calculate the optimal resistor values for your specific circuit design.
The Open-Drain Architecture and the RC Circuit
In an I2C bus, the Serial Data (SDA) and Serial Clock (SCL) lines use open-drain (or open-collector) drivers. This means that connected microcontrollers and peripherals can actively pull the lines to ground (logic low), but they cannot drive the lines to a positive voltage (logic high). Instead, when a device releases the line, an external pull-up resistor connected to the voltage supply (\(V_{CC}\)) pulls the line high.
Every wire, PCB trace, and device pin connected to the I2C bus adds a small amount of parasitic capacitance. The sum of all these capacitances is known as the total bus capacitance (\(C_{bus}\)). Together, the pull-up resistor (\(R_p\)) and the bus capacitance (\(C_{bus}\)) form a classic RC circuit.
How Capacitance Dictates Rise Time
When an open-drain driver releases the I2C line, the pull-up resistor must charge the bus capacitance for the voltage to rise from a logic low to a logic high. Because it is an RC circuit, the voltage does not change instantly; it follows an exponential charging curve.
The time it takes for the signal to transition from a low threshold (typically 30% of \(V_{CC}\)) to a high threshold (typically 70% of \(V_{CC}\)) is called the rise time (\(t_r\)). The relationship is governed by the RC time constant (\(\tau = R \times C\)).
If the bus capacitance increases—for example, by lengthening the PCB traces or adding more sensor ICs to the bus—the pull-up resistor must charge a larger capacitor. If the resistor value remains the same, the rise time will become slower. If the rise time is too slow, the voltage will not reach the logic-high threshold before the next clock cycle begins, leading to corrupted data and failed communication.
Calculating the Maximum Pull-Up Resistance
Because bus capacitance slows down the rise time, it strictly dictates the maximum allowable value for your pull-up resistor. The I2C specification defines strict maximum rise times based on the operating speed of the bus:
- Standard Mode (100 kHz): Maximum \(t_r\) = 1000 ns
- Fast Mode (400 kHz): Maximum \(t_r\) = 300 ns
- Fast Mode Plus (1 MHz): Maximum \(t_r\) = 120 ns
Furthermore, the I2C specification limits the maximum allowable bus capacitance to 400 pF for Standard and Fast modes, and 550 pF for Fast Mode Plus.
To ensure the signal rises fast enough for the chosen speed, you calculate the maximum pull-up resistor value (\(R_{p(max)}\)) using the following formula derived from the RC charging curve between 30% and 70% of \(V_{CC}\):
\[R_{p(max)} = \frac{t_r}{0.8473 \times C_{bus}}\]
The Trade-off: Higher Capacitance Requires Lower Resistance
As the formula demonstrates, \(R_{p(max)}\) and \(C_{bus}\) are inversely proportional. If you have a high bus capacitance, you must use a lower value pull-up resistor (a "stronger" pull-up) to supply more current and charge the capacitance quickly enough to meet the \(t_r\) specification. Conversely, if your bus capacitance is very low, you can use a higher value resistor (a "weaker" pull-up), which helps conserve power in battery-operated embedded systems.
The Lower Limit: Minimum Pull-Up Resistance
While bus capacitance dictates the maximum resistor value, you cannot simply pick an arbitrarily low resistor value to guarantee fast rise times. The minimum pull-up resistor value (\(R_{p(min)}\)) is dictated by the current-sinking capability of the open-drain transistors inside the I2C devices.
When a device pulls the line low, it must sink the current flowing from \(V_{CC}\) through the pull-up resistor. If the resistor value is too low, the current will exceed the transistor's maximum rating (\(I_{OL}\)), preventing the device from pulling the voltage down to a valid logic-low level (\(V_{OL}\)) or potentially damaging the pin.
The minimum resistance is calculated as:
\[R_{p(min)} = \frac{V_{CC} - V_{OL(max)}}{I_{OL}}\]
For Standard and Fast modes, \(V_{OL(max)}\) is typically 0.4V, and \(I_{OL}\) is 3 mA.
Practical Design Example
Assume you are designing a Fast Mode (400 kHz) I2C bus operating at \(V_{CC} = 3.3\text{V}\) with an estimated total bus capacitance (\(C_{bus}\)) of 200 pF.
Find the Maximum Resistance (Dictated by Capacitance): For Fast Mode, the maximum rise time (\(t_r\)) is 300 ns. \[R_{p(max)} = \frac{300\text{ ns}}{0.8473 \times 200\text{ pF}} \approx 1.77\text{ k}\Omega\]
Find the Minimum Resistance (Dictated by Current Limits): \[R_{p(min)} = \frac{3.3\text{V} - 0.4\text{V}}{3\text{ mA}} \approx 967\text{ }\Omega\]
In this scenario, the 200 pF bus capacitance forces you to choose a resistor no larger than \(1.77\text{ k}\Omega\). To stay safely between the minimum and maximum limits, a standard resistor value of \(1.2\text{ k}\Omega\) or \(1.5\text{ k}\Omega\) would be ideal. If the bus capacitance were to double to 400 pF, \(R_{p(max)}\) would drop to \(885\text{ }\Omega\), which is below \(R_{p(min)}\), making the circuit impossible to run at 400 kHz without reducing capacitance or using specialized I2C buffer ICs.