I am using the BCM-notation for the nodes of the GPIO. Consider the following situation.

  • node 1 (3,3V) is connected to a switch-key
  • the switch-key is connected to node 25 via 1 kOhm
  • node 25 works as an input
  • node 24 works as an output which is true when the switch-key is pressed, that is when node 25 is true.
  • node 24 is connected to a LED via 220 Ohm
  • this LED is connected with GND

What happens now is that the LED is turning on and off randomly. What you need to do is add a pull-down resistor. This works as following:

  • connect the switch-key with GND via 10 kOhm

If the switch-key is not pressed, nothing is connected to each other. How can the pull-down resistor have any influence in this system? I am using a switch-key with 4 contacts.

To sum my problem up:

  • Contact 1 of the switch-key is connected to node 1 (3.3V)
  • Contact 2 of the switch-key is connected to node 25 (INPUT) via 1 kOhm
  • Contact 3 of the switch-key is connected to GND via 10 kOhm.
  • Contact 4 of the switch-key is not used

How can the use of the 10 kOhm have any influence on the system, while the switch-key is not pressed?


You're looking at a floating input. When you read pin 25 without it being connected to anything at all it can be considered to have an undefined, unstable value. That's indicated by the LED randomly turning itself on and off. By pulling the value of the pin to ground with your resistor you render it non-floating.


The point of a pull-down is to ground an input when it otherwise isn't driven to a particular value -- a state known as high impedance or floating.

I was confused by the term "pull-down resistor" the first time I saw it. And the second, third etc. Read the wrong way it implies the resistor is the active element in the "pulling down", which it is not (resistors aren't active components period). In a sense the resistor isn't strictly necessary for the pulling down to occur, but it is required to:

  1. Guard against a short circuit.

  2. Allow the pull-down to be overpowered/overridden when something else is connected to the input.

Hence the resistors used are usually quite large; they sink just enough current to make the input read low. All they need to do is present less impedance than a disconnected "high impedance state" input.

Another explanation of the role of the resistor with regard to point #1 can be found here (although that's about pull-ups, it is not hard to extrapolate).

I imagine the term "pull-down resistor" is commonly used instead of just "pull-down" to emphasize the fact that a pull-down requires a resistor in practical terms, and that a defining aspect of a pull-down's functionality is the impedance in the resistor.

  • 1
    pretty much the exact same things can be applied to pull-up resistors as well. – stevieb Sep 14 '16 at 21:58

enter image description hereTo overcome with pull down issue use the simple pull down circuit with 220 ohm or 330 ohm value resistor i.e you can use any value of resistor below 600 ohm.

  • Why below 600ohm? – Sully Feb 5 at 18:45

A GPIO set as an input will float (randomly read 0 or 1) until it is connected to a fixed voltage. The internal pulls are a convenient way of setting a fixed voltage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.