Pull-Down Resistor help

Thread Starter

afried01

Joined Feb 5, 2011
11
I can't grasp the concept of a pull-down resistor in microcontroller circuit. (See attachment) I realize that the purpose of a pull-down resistor is to keep the input P3 at a low state instead of floating when the switch is open; however, I cannot see why putting the 10k ohm resistor where it is would make any difference. If you do not have a resistor in that position, P3 would be connected to ground, (Vss) and it would be low anyway! I realize you need the resistor there when the button is pushed to prevent excessive current, but when the switch is open,, I don't get it??? (Vdd is at five volts.) Any help in explaining this would be appreciated.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
OK, so remove the 10K and MEASURE the resistance to ground (without the chip too). Should be infinite.

You need the resistor to make that connection to ground when the stitch is open.

Should you thing you can just short out the resistor then bad things happen when you push the switch as you're shorting out the power supply.

The 220 ohm resistor is only there to protect the input pin in case something goes wrong like a spike from the button, say from a static zap from a dry day carpet charge on the user's body.
 

Thread Starter

afried01

Joined Feb 5, 2011
11
OK, so remove the 10K and MEASURE the resistance to ground (without the chip too). Should be infinite.

You need the resistor to make that connection to ground when the stitch is open.

Should you thing you can just short out the resistor then bad things happen when you push the switch as you're shorting out the power supply.

The 220 ohm resistor is only there to protect the input pin in case something goes wrong like a spike from the button, say from a static zap from a dry day carpet charge on the user's body.
I guess the real question was (is) what would happen if ground were connected at the point where the 10k ohm resistor is. In other words, no 10k ohm resistor, just ground. This is for when the switch is open. Would P3 still be low or floating? If floating, why? It seems like P3 would be low since it is connected to ground without the 10k ohm resistor. (see attached)
 

Attachments

tshuck

Joined Oct 18, 2012
3,534
I guess the real question was (is) what would happen if ground were connected at the point where the 10k ohm resistor is. In other words, no 10k ohm resistor, just ground. This is for when the switch is open. Would P3 still be low or floating? If floating, why? It seems like P3 would be low since it is connected to ground without the 10k ohm resistor. (see attached)
Let's take a look... Remove the 10k resistor and replace it with a short.

What is the voltage at that point when the switch is open? Closed?

Now, the switch does nothing. Yes, you have, effectively pulled the pin to ground (through the 220 ohm resistor), but the switch will never do anything to affect the voltage at the pin (the point of the switch).
 

Thread Starter

afried01

Joined Feb 5, 2011
11
Let's take a look... Remove the 10k resistor and replace it with a short.

What is the voltage at that point when the switch is open? Closed?

Now, the switch does nothing. Yes, you have, effectively pulled the pin to ground (through the 220 ohm resistor), but the switch will never do anything to affect the voltage at the pin (the point of the switch).
So the main reason the resistor is there is to allow P3 to "see" Vdd (5 v) when the switch is closed. When the switch is open P3 will "see" a low regardless of whether the 10k resistor is there or not. Obviously, the 10k resistor has to be there for P3 to see any high. But what about this concept of floating voltage when the switch is open? Why would P3 be in a "floating" state when the switch is open when there is no 1ok resistor (assume there is a ground connection as described above), and how does putting the resistor there stop this floating situation? Just trying to learn this stuff. Thanks!
 

ErnieM

Joined Apr 24, 2011
8,377
A "floating" pin has no connections to anything else. If the pin is wired to the 10K or directly to ground it is not floating: it has a well defined voltage on it.
 

MrChips

Joined Oct 2, 2009
30,823
So the main reason the resistor is there is to allow P3 to "see" Vdd (5 v) when the switch is closed. When the switch is open P3 will "see" a low regardless of whether the 10k resistor is there or not. Obviously, the 10k resistor has to be there for P3 to see any high. But what about this concept of floating voltage when the switch is open? Why would P3 be in a "floating" state when the switch is open when there is no 1ok resistor (assume there is a ground connection as described above), and how does putting the resistor there stop this floating situation? Just trying to learn this stuff. Thanks!
No. No. No.

The input to P3 is high impedance and floating. This means that it acts as an antenna and will pick up any electrical signal from everything around you, AC mains, radio, TV, cellphone, wifi, etc. An input with no external connection is NOT at 0V.

You need a resistor to some reference voltage (GND or Vdd) to give it a known logic input. The purpose of the switch is simply to change the input to the opposite state.

The resistor is required so that you do not short the power supply when the switch is closed.

You want the value of the resistor to be at least 10 times lower than the input resistance and not so low that you take excessive current when the switch is closed. 10kΩ is a good value for CMOS inputs. 1kΩ pull-up is better for TTL inputs.

For pull-down on TTL inputs, you need to go much lower to below 200Ω because of higher input currents.
 
Last edited:
Top