Pull-up Resistor

Dear Forum Members,

I am very new in Arduino world and have very little understanding of electronics. I have a question regarding usage of Pull-up Resistors. I don't understand why there is LOW signal on input when button is pressed (in the schematics bellow).

https://dlnmh9ip6v2uc.cloudfront.net/assets/6/f/b/c/7/511568b6ce395f1b40000000.jpg

Thanks.

Because you're connecting to ground (0volts) when the switch is operated.

And what about VCC ?? where did that 5V go?

You've got a dead short to ground when the switch is closed. Unless R1 is zero ohms, the dead short wins.

Think of it as a voltage divider, with R2 = zero ohms.

Understood. But what will happen if there was no resistor and button was pressed. Will input read high or circuit will be short?

anandadavananda: Understood. But what will happen if there was no resistor and button was pressed. Will input read high or circuit will be short?

You destroy or shut down your power supply due to current overload. Don't do that.

thx a lot.

anandadavananda: And what about VCC ?? where did that 5V go?

It's all dropped across the pull-up resistor.

Jiggy-Ninja:

anandadavananda: Understood. But what will happen if there was no resistor and button was pressed. Will input read high or circuit will be short?

You destroy or shut down your power supply due to current overload. Don't do that.

Wrong, if there is no pull-up resistor and you wire a switch from the input to ground and press the button the input pin will read that as a valid LOW input, no damage will occur. However without the pull-up resistor there is a problem when you release the switch as then there is no valid voltage value wired to the input pin and it is said to be a 'floating input' and will read just noise and can read as either a high or low, so invalid. The only way you can damage a digital input pin is if you apply voltage greater then +5vdc or any negative voltage.

[/quote]

Wrong, if there is no pull-up resistor and you wire a switch from the input to ground and press the button the input pin will read that as a valid LOW input, no damage will occur. However without the pull-up resistor there is a problem when you release the switch as then there is no valid voltage value wired to the input pin and it is said to be a 'floating input' and will read just noise and can read as either a high or low, so invalid. The only way you can damage a digital input pin is if you apply voltage greater then +5vdc or any negative voltage.

[/quote]

I don't understand, why floating input ? If there is a 5v applied onput should read HIGH. Am I wrong? Also I'm interested what should be the applied voltage for input pin to read LOW?

Wrong, if there is no pull-up resistor and you wire a switch from the input to ground and press the button the input pin will read that as a valid LOW input, no damage will occur. However without the pull-up resistor there is a problem when you release the switch as then there is no valid voltage value wired to the input pin and it is said to be a 'floating input' and will read just noise and can read as either a high or low, so invalid. The only way you can damage a digital input pin is if you apply voltage greater then +5vdc or any negative voltage.

I don't understand, why floating input ? If there is a 5v applied onput should read HIGH. Am I wrong? Also I'm interested what should be the applied voltage for input pin to read LOW?

"applied onput" what does that mean?

If there is a pull-up resistor wired to an input pin (either an external pull-up or the software enable internal pull-up for the input pin) then there will be +5vdc applied to the input pin and the pin will read as a HIGH, conversely if you wire a pull-down resistor to an input pin it will read as a LOW inlput. However if there is no pull-up or pull-down resistor used then the input pin is said to be 'floating' and will not read a reliable value as there is no valid voltage wired to the input pin.

retrolefty:

Wrong, if there is no pull-up resistor and you wire a switch from the input to ground and press the button the input pin will read that as a valid LOW input, no damage will occur. However without the pull-up resistor there is a problem when you release the switch as then there is no valid voltage value wired to the input pin and it is said to be a 'floating input' and will read just noise and can read as either a high or low, so invalid. The only way you can damage a digital input pin is if you apply voltage greater then +5vdc or any negative voltage.

I don't understand, why floating input ? If there is a 5v applied onput should read HIGH. Am I wrong? Also I'm interested what should be the applied voltage for input pin to read LOW?

"applied onput" what does that mean?

If there is a pull-up resistor wired to an input pin (either an external pull-up or the software enable internal pull-up for the input pin) then there will be +5vdc applied to the input pin and the pin will read as a HIGH, conversely if you wire a pull-down resistor to an input pin it will read as a LOW inlput. However if there is no pull-up or pull-down resistor used then the input pin is said to be 'floating' and will not read a reliable value as there is no valid voltage wired to the input pin.

I meant if there is a +5v applied to input pin.

If you've got 5v on an input pin and then close a switch to ground, you'll short-circuit the supply

Read this:- http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

AWOL: If you've got 5v on an input pin and then close a switch to ground, you'll short-circuit the supply

Thus the reason we use a resistor (called a pull-up) between +5 and the input pin.

Off subject, but I can’t help but notice that two of the posters in this thread have personal icons sourced from different but equally brilliant Kubrick films.

OTOH, I have an icon sourced from a really piss poor comedy written and directed by talentless hacks.

:frowning: