Sign up ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have come across many simple circuits that show how to switch on an LED or something else. Pull up resistors are often mentioned. What do they do? Some GPIO pins require pull up resistors and others do not, what is the difference?

share|improve this question
I looked at the Wikipedia explanation and it made no sense whatsoever. I was going to edit the question to reflect this but you answered first. – Menuta Jan 19 '13 at 10:30
very well explained in this site – user19442 Aug 2 '14 at 13:17

4 Answers 4

up vote 4 down vote accepted

From the Arduino website:

Often it is useful to steer an input pin to a known state if no input is present. This can be done by adding a pullup resistor (to +5 V), or a pull-down resistor (resistor to ground) on the input, with 10 kΩ being a common value.

BUT: That is from the Arduino website. Remember that Raspberry GPIO pins are only 3.3 V tolerant (so, do the pullup to 3.3 V, not 5 V on the Raspberry Pi)!!!

Here's an example of a pull-up resistor schematics.

A pull-up will make sure the pin is up without taking in too much current. A gate has three possible states: ON, OFF and FLOATING.

The FLOATING state is not very useful since it can't be converted to a boolean value. Hence pull-up and pull-down resistors: they are there to eliminate the FLOATING state.

share|improve this answer
Technically FLOATING is not a logical state but a loose technical term used to describe that it is unconnected and may receive random combinations of HIGH/LOW caused by static discharge noise generated by nearby objects. There is no logical variable for floating, except the mathematical number. Digital is either 1 or 0. – ppumkin Aug 2 '14 at 14:52

A pull-up or pull-down resistor are used on input pins to define a state in the case an input does not have anything connected or the connected part is in the high impedance (Z) state. Inputs without a defined state have the problem that the input value can be anything (0 or 1), called floating.

This is explained in more depth in the article on Wikipedia (that Jivings added to the comments of your question), and a little more visually in this article on SparkFun.

share|improve this answer
The sparkfun description is brilliant compared to Wikipedia a makes far fewer assumptions about a readers knowledge – Menuta Jan 19 '13 at 10:36

Something to keep in mind (confused me a bit at first) is that a pull-up or pull-down resistor is just a standard resistor in a specific role. More than one person has tried to buy pull-up resistors only to find they don't exist. Otherwise it is just as it sounds, a standard resistor pulling the voltage up to 5V/3.3V or down to 0V as the normal state.

share|improve this answer
Part of what's confusing here is it isn't really the resistor doing the "pull-up" -- the pull up is what on the other side of the resistor. The resistor is just control the current flow through through the pull-up.… – goldilocks Apr 22 at 17:56

The electronics dictionary defines pull-up as follows:

pull-up: Descriptive of a circuit or component used to raise the value (e.g., impedance) of a circuit to which it is connected.

If an LED is connected to a +5 V power supply and is controlled (LED ON & OFF) by a microcontrollers/microprocessor or by some other means, during ON state the power-supply may supply high current, in turn high current may damage the LED.

To limit the high current from the supply, a pull-up resistor, pulls up the impedance and limits the current supplying the LED from the power supply (+5 V). Hence the LED is protected form high currents. Based on the circuit, a pull-up function varies and form protection to wired AND logic to an I²C bus.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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