Understanding pull-up and pull-down resistors

Sharing is caring!

Understanding Pull-Up and Pull-Down Resistors: The Unsung Heroes of Digital Circuits

Free Daily Electronics Newsletter

Tutorials, news, and one component explained simply — every day.

Pull-down resistor circuit diagram
Pull-down resistor circuit: the resistor pulls the pin LOW when the button is released
Subscription Form
Pull-down resistor circuit diagram showing button, resistor, and Arduino connection
Pull-down resistor circuit diagram showing button, resistor, and Arduino connection

Difficulty: Beginner — You wire a button to your Arduino, upload a simple sketch to read it, and the Serial Monitor shows… random garbage. The pin flickers between HIGH and LOW like it can’t make up its mind. You press the button and it sort of works, but not reliably. What’s going on?

Welcome to the world of floating pins — and the simple fix that every digital circuit needs: pull-up and pull-down resistors.

The Floating Pin Problem

Digital inputs have three possible states: HIGH (connected to voltage), LOW (connected to ground), and floating (connected to nothing). When a pin is floating, it’s not connected to any defined voltage level. It picks up random electrical noise from the environment — nearby wires, radio signals, fluorescent lights — and interprets that noise as rapidly switching HIGH and LOW signals.

This is exactly what happens when you connect a button between a pin and ground (or voltage) without a pull-up or pull-down resistor. When the button is pressed, the pin is connected to a defined level. When it’s released, the pin is connected to… nothing. It floats.

Pull-Down Resistors: Keeping It Low

A pull-down resistor connects the input pin to ground through a resistor (typically 10kΩ). When the button isn’t pressed, the resistor gently “pulls” the pin down to 0V (LOW). When you press the button, it connects the pin directly to the supply voltage (HIGH), which easily overpowers the weak pull through the resistor.

The circuit is simple:

  • Button connects between the input pin and VCC (5V or 3.3V)
  • 10kΩ resistor connects between the input pin and GND
  • Button released → pin reads LOW (pulled to ground through resistor)
  • Button pressed → pin reads HIGH (connected directly to VCC)

The resistor value matters. Too low (like 100Ω) and you waste current when the button is pressed. Too high (like 10MΩ) and the pull is too weak to overcome noise. 10kΩ is the sweet spot for most digital circuits — strong enough to define the state, weak enough to draw negligible current.

Pull-Up Resistors: Keeping It High

A pull-up resistor does the opposite — it connects the pin to VCC through a resistor, keeping it HIGH by default. The button then connects the pin to ground when pressed.

Pull-up resistor circuit diagram
Pull-up resistor circuit: the resistor pulls the pin HIGH when the button is released

The wiring:

  • Button connects between the input pin and GND
  • 10kΩ resistor connects between the input pin and VCC
  • Button released → pin reads HIGH (pulled to VCC through resistor)
  • Button pressed → pin reads LOW (connected directly to GND)

Pull-ups are actually more common than pull-downs in practice. Many communication protocols like I2C require pull-up resistors on the data and clock lines. The Arduino itself has built-in pull-up resistors you can enable with pinMode(pin, INPUT_PULLUP) — no external resistor needed.

Arduino’s Built-In Pull-Ups

Every digital pin on an Arduino has an internal pull-up resistor (typically 20-50kΩ) that you can activate in software. This is incredibly convenient for buttons:

pinMode(2, INPUT_PULLUP);  // Enable internal pull-up on pin 2
int state = digitalRead(2); // LOW when pressed, HIGH when released

Note the logic is inverted when using pull-ups: the button reads LOW when pressed and HIGH when released. This trips up beginners constantly, but you get used to it. There are no built-in pull-down resistors on the Arduino — if you need pull-down behavior, you need an external resistor.

Where You’ll Encounter Them

Pull-up and pull-down resistors show up everywhere in electronics:

  • I2C buses — both SDA and SCL lines need pull-up resistors (typically 4.7kΩ)
  • Reset pins — microcontrollers often have a pull-up on the reset pin to keep it HIGH (not resetting) during normal operation
  • Chip select lines — SPI devices often need pull-ups to keep them deselected when not in use
  • Any button or switch — every switch input needs a defined default state
  • Transistor base pins — pull-down resistors ensure transistors stay off when not being driven

If you’ve ever looked at an Arduino project like a soil moisture sensor or a fingerprint door lock and wondered why there are resistors that don’t seem to be doing anything, they’re almost certainly pull-ups or pull-downs keeping pins in a known state.

Quick Reference

  • Floating pin? → Add a pull-up or pull-down resistor
  • Default state should be LOW? → Pull-down (resistor to GND)
  • Default state should be HIGH? → Pull-up (resistor to VCC)
  • Standard value: 10kΩ for general use, 4.7kΩ for I2C
  • Lazy option: INPUT_PULLUP in Arduino code (pull-up only)

Recommended Tools & Parts

Components for learning about pull-up and pull-down resistors (affiliate links):

Free Daily Electronics Newsletter

Tutorials, news, and one component explained simply — every day.

Subscription Form (#5)
Scroll to Top