stupid beginner question: General understanding problem of Pullup resistors

I'm new i the world of arudino and i still have some understanding problems of how everything works.
Yesterday i learned about Pullup resistors and i just can't get my head around it.
I think i understand the concept, but in the process some major questions about my general understandings of electricity came up and i am completly confused now. :confused:

So i do understand that you use a pullup resistor to keep the voltage of a pin at 5V and if you press a button to GND the voltage drops to 0V. Also you need a Resistor (mostly 10K) betweet 5V and pin so you don't get a short circuit if you push the button.

What i don't understand now is how does the pin even measure the voltage. My understanding at the moment is that the voltage is a difference in potential. And if you want to measure a potentialdifference you need two points, for example infront and behind a resistor. But the pin is only at one point in the circuit.
Also if you want a current flow the circuit needs to be closed, so is the pin already connected to GND?
And doesn't the voltage drop to 0V over the resitor, if a current is flowing?

As you see i'm completly confused and there is something very wrong with my understanding.
Maybe someone can help me... Thanks!

Good questions.

Have you read https://forum.arduino.cc/index.php?topic=719995.0 ?

What i don't understand now is how does the pin even measure the voltage. My understanding at the moment is that the voltage is a difference in potential. And if you want to measure a potential difference you need two points, for example infront and behind a resistor. But the pin is only at one point in the circuit.

All correct except the last bit, the pin is at 2 points in the circuit. External to the processor it is at one point, the resistor, internally to the processor it is measuring with respect to ground.

++Karma; // For thinking about it.

Thank you for the quick anwser!
I read the article and it already helped a lot!

One last question:
If the button to GND is not pushed, the voltage is the same behind and infront of the resistor because no current is flowing?
I still have the understanding that the voltage has to change behind a resistor, but that does only apply to closed curcuits when a current is flowing?

You need to understand Ohm's Law to answer your question.

Also, while not directly related to your question, Kirchhoff's circuit laws are also fundamental to understanding electronics.

monsiwav:
What i don't understand now is how does the pin even measure the voltage.

The transistors in the chip that connect to the input are FETs, Field-Effect Transistors. They
respond to the electric field between gate and channel, so are sensitive directly to voltage,
no current needs to flow. Put crudely the voltage across the microscopically thin gate oxide
induces charges to reposition themselves in the channel side, allowing or preventing current
flowing across the channel. Crucially the electric field from the gate is at right angles to the
current flow, so it doesn't contribute directly to the flow, just whether there are charges
available to allow a flow.

Due to the extreme thinness of the oxide insulating layer in FETs (measured in nanometres),
even a few volts externally corresponds to electric fields of 10's or 100's of megavolts per
metre inside such devices.

Voltage is the potential difference, so a reference to 5V or ground is based on the 'end point' difference, the resistor does not come into play until the switch is closed!

Ok, I have:
V=5V
R=10K
so:
I=0,5mA
if the curcuit is closed right?

But what is happening if the voltage is going directly in to the Pin and the button to GND is not pushed?
The curcuit isn't closed and no current is flowing right?
But if no current is flowing how is V=5V if V=R*0?

Ohm's law relates the voltage across a resistor to the current flowing through it. Nothing to
do with ground.

The pin is sensing voltage w.r.t. ground and Vcc.

If the resistor connects to the +5V rail at one end and carries no current, the voltage across
it is zero, so both ends are at +5V w.r.t. ground.

Voltage is always a difference between two points in a circuit, you need to be clear about which
two points. This is why its called "potential difference"

If the button to GND is not pushed, the voltage is the same behind and infront of the resistor because no current is flowing?

I think you are getting confused by the "no current" flows.

With the switch open, the input current into the processor is not really 0, it is in the order of 50/ 1 billion. So the difference between the two ends of the resistor is for all practical purposes 0.

This puts the input to the processor at 5V

With the switch closed, the input to the processor is connected to common. The processor senses this as a logical 0.

Regarding needing two points to measure a voltage. You are correct. In this case all the circuits must be connected to a common point often called ground or GND.

Now if you remove the 10K resistor and the switch is open, the input to the processor doesn't have anything to tell it where to be. It will pickup AC voltage from the air and bounce around. You will never know what it will be. Not a good situation.

Clipboard01.jpg

Clipboard01.jpg

Thank you everybody! I finally got it! :slight_smile:

monsiwav:
Thank you everybody! I finally got it! :slight_smile:

Excellent!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.