Pull-up Resistor Calculator
Find the ideal pull-up or pull-down resistor for I2C buses, open-drain GPIO lines, and switch inputs. Balances rise time against power consumption for your supply voltage and bus speed.
Pull-Up Resistor Design
Pull-up resistors bias a digital line to logic high when a switch/open-drain output isn't actively driving it low. For I2C buses, the resistor value also controls the rise time — too high and the bus becomes slow; too low and current draw increases. For GPIO buttons, a typical 10 kΩ pull-up is fine. Use quick presets for I2C standard speeds, or enter custom values.
I2C standard = 1000 ns · fast = 300 ns · fast+ = 120 ns
PCB trace + device pins — typically 50–400 pF
Recommended Pull-up
3.30 kΩ
- Minimum allowed
- 11.80 kΩ
- Maximum allowed
- 967 Ω
- Geometric ideal
- 3.38 kΩ
- Static current
- 1.00 mA
Nearest standard value is outside the valid range. Adjust rise time or capacitance.
What a pull-up resistor does
A digital input that isn't connected to anything floats: it picks up noise and reads random HIGH and LOW values. A pull-up resistor ties the input weakly to VCC, so it reads HIGH by default. A button or open-drain output then pulls it firmly to ground (LOW) when active. A pull-down does the opposite.
How to choose the value
There are two limits:
- Not too small. When the line is pulled LOW, current I = VCC ÷ R flows through the resistor. Too small wastes power and may exceed what the driving pin can sink (typically 3–20 mA).
- Not too large. The input's leakage current and the wire's capacitance need a strong enough pull. Too large makes the line slow and noise-sensitive.
| Situation | Typical pull-up |
|---|---|
| Push button on a GPIO | 10 kΩ (or internal pull-up) |
| Battery device, slow signal | 47–100 kΩ |
| Open-drain interrupt line (sensor INT pin) | 4.7–10 kΩ |
| I2C at 100 kHz, short wires | 4.7–10 kΩ |
| I2C at 400 kHz or several modules | 2.2–4.7 kΩ |
| Long wires or noisy environment | 1–4.7 kΩ |
Internal pull-ups
Most microcontrollers include switchable pull-ups, so many button circuits need no external resistor:
- Arduino Uno (ATmega328P): 20–50 kΩ, enabled with pinMode(pin, INPUT_PULLUP).
- ESP32: about 45 kΩ pull-ups and pull-downs on most GPIOs. GPIO34–39 are input-only with no internal pull resistors.
- Raspberry Pi Pico (RP2040): 50–80 kΩ.
Internal pull-ups are weak, so for long cables or interrupt-driven inputs add an external 4.7–10 kΩ.
Pull-up vs pull-down
Pull-up with a button to ground (reads LOW when pressed) is the most common because it works with every microcontroller's internal pull-up. Pull-down with a button to VCC reads HIGH when pressed, which some people find more intuitive.
Formula, inputs and worked examples
Formula and method
For a simple pull-up, I ≈ (VCC − VOL)/R; for I2C, also check rise-time and bus capacitance constraints.
Worked examples
Button on an Arduino pin
A 10 kΩ pull-up to 5 V draws 0.5 mA only while the button is pressed. Or skip it and use INPUT_PULLUP.
Sensor interrupt line
An open-drain INT pin on a 3.3 V ESP32 with 4.7 kΩ sinks 0.7 mA when active and gives fast, clean edges.
Battery-powered door sensor
A 100 kΩ pull-up on a reed switch draws only 33 µA at 3.3 V when closed, extending battery life.
Inputs
- Supply voltage — Unit: V
- LOW-level voltage — Unit: V
- Required sink current — Unit: mA
- Bus speed/capacitance when applicable — Unit: Hz / pF
What the result means
- Recommended resistance range — Unit: Ω / kΩ
- Approximate line current — Unit: mA
Practical tips and common mistakes
- Never leave unused inputs floating; enable the internal pull-up or tie them to ground.
- GPIO34–39 on the ESP32 have no internal pull resistors.
- Pull up to the voltage the input expects, not a higher one.
Assumptions and limitations
- A pull-up must be strong enough for reliable logic transitions but weak enough to respect sink-current limits.
- For I2C, rise time and total bus capacitance matter in addition to DC current.
- Use a pull-down only when the input circuit and logic polarity call for it.
Frequently asked questions
Should I use a 4.7k or 10k pull-up resistor?
10 kΩ is fine for buttons and slow signals. Use 4.7 kΩ (or lower) for I2C at 400 kHz, long wires or several devices on the bus, where a stronger pull-up is needed for fast edges.
Do I need a pull-up resistor if I use INPUT_PULLUP?
Not for a simple button on short wires. INPUT_PULLUP enables the chip's internal 20–50 kΩ resistor. Add an external one for long cables, noisy environments or I2C.
What happens if the pull-up resistor is too small?
More current flows whenever the line is LOW, wasting power, and the driving device may not be able to pull the line low enough to register as LOW.
What is the difference between a pull-up and a pull-down resistor?
A pull-up connects the input to VCC so it reads HIGH when idle; a pull-down connects it to ground so it reads LOW when idle. The button or output then drives the opposite level when active.
Learn more
More Electronics