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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.