Pull-up and pull-down resistors: why inputs need them
Pull-up and pull-down resistors explained: floating digital inputs, button circuits, internal pull-ups, open-drain and I2C buses, and how to choose resistor values.
The floating input problem
A digital input draws almost no current. If nothing drives it, for example a button that is not pressed, it picks up noise from the environment and reads random 0s and 1s. Touching the wire with a finger can change the reading. This is called a floating input.
The fix
A pull-up resistor connects the input to the supply, so it reads HIGH by default; the button connects it to ground to read LOW. A pull-down does the opposite. The resistor is large enough to limit current when the button is pressed, and small enough to beat the noise.
Choosing the value
| Situation | Typical value | Why |
|---|---|---|
| Button on a GPIO | 10 kΩ | 0.33 mA when pressed at 3.3 V; robust against noise |
| Battery device, sleeping | 47 kΩ – 100 kΩ | Less current wasted while the button is held |
| I²C at 100 kHz / 400 kHz | 4.7 kΩ / 2.2 kΩ | Faster edges for faster buses and more devices |
| Reset or enable pin | 10 kΩ | Check the datasheet: some chips already include one |
| MOSFET gate pull-down | 100 kΩ | Keeps the transistor off while the MCU boots |
Internal pull-ups
Most microcontrollers have pull-ups (and often pull-downs) you enable in software, typically 20 to 50 kΩ. They are fine for a button close to the chip. For long cables, noisy environments, I²C buses or anything that must be defined before the software starts, use an external resistor.
Open-drain outputs
Some outputs can only pull a line LOW; they let go to go HIGH. I²C, many interrupt lines and alert pins work this way. Without a pull-up they never go HIGH at all, which is one of the most common reasons a first I²C circuit does not work.
Pull resistors become design decisions when several devices share a line, when a signal must hold a state during power-up and reset, or when a battery device must sleep at microamps. Those states are defined and checked in our schematic reviews.
Parts and tools to practise
| Item | What to look for | Buy |
|---|---|---|
| Resistor assortment, 1 % metal film | E24 or E12 values from 10 Ω to 1 MΩ, 1/4 W. Sorted in labelled bags or a box. | View on Amazon ↗ |
| Solderless breadboard kit with jumper wires | Full-size breadboard, pre-cut jumpers and flexible Dupont wires. | View on Amazon ↗ |
| ESP32 or similar development board | To try pull-ups, ADC readings, buses and PWM for real. | View on Amazon ↗ |
| Digital multimeter | Auto-range with continuity beeper, CAT III rated. You will use it every day. | View on Amazon ↗ |
| USB logic analyser, 8 channels | Decodes UART, I²C and SPI on your computer. Essential for bus problems. | View on Amazon ↗ |
Links go to Amazon. As an Amazon Associate we earn from qualifying purchases, at no extra cost to you. We only list tools of the kind we use on our own bench.
Send us what you have. We tell you what it takes to finish it.
Answer five questions and see an indicative budget in two minutes. When you are ready, sign our NDA, upload your documentation and get a fixed quote. Everything by e-mail, with a call whenever you prefer.