Electronic – Doesn’t voltage on ground make it not ground anymore

currentgroundmicrocontroller

schematic

simulate this circuit – Schematic created using CircuitLab

Beginner here, trying to learn enough to start using a microcontroller.

  1. If the I/O pins are internally high, wouldn't pressing one of the buttons put voltage on the ground wire, making it no longer ground? Including Vss?

  2. I added R1 = 100Ω based on the STM8S003F3 datasheet max "Total current out of VSS ground lines (sink)" = 80 mA, and R2 = 270 Ω based on max "Output current source by any I/Os and control pin" = -20 mA. Am I doin' it rite? Is an additional resistor needed to limit current through (decoupling capacitor) C1?

Best Answer

Ground is not 0V.

Ground is merely a point of reference from which all other voltages can be measured.

Note: A voltage is a potential difference between two points. When you measure 5V you are measuring a 5V difference between two points.

It is entirely up to you what point in your circuit you choose as ground. Normally it is the point of "least potential" (such as the - terminal of your battery), but not necessarily.

So your "ground" is always "ground" because that is what you have chosen it to be. The voltage at ground, with respect to ground will always be 0V, since nothing can have any difference to itself.

When you press one of your buttons (with those two resistors removed, please) the lower side of the internal resistor (I assume that is what you mean in your question) is connected to ground, thus making that point measure 0V. When the button is released there is no connection to ground, so the voltage at that point is the supply voltage minus whatever is dropped by the resistor caused by any current flowing through it (typically a very small amount for an input pin).

Related Topic