Take the 2-minute tour ×
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 seattlerobotics.org/encoder/mar97/basics.html –  user19442 Aug 2 '14 at 13:17

3 Answers 3

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 +5V), or a pulldown resistor (resistor to ground) on the input, with 10K being a common value.

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 Z (high impedance) 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

The electronics dictionary defines pull up as follow: 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 +5 V power supply and is controlled (LED ON & OFF) by Microcontrollers/Microprocessor or other menace , during ON state power-supply may supply high current, in turn high current may damage LED. To LIMIT the High current from supply, Pull Up Resistor, PULLS UP the IMPEDANCE and Limits the current supplying to LED from Power supply(+5v) hence LED is Protected form High currents. Based on the circuit pull up function varies form protection to Wired AND logic to I2C 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.