Why don't push-buttons cause short circuit when pressed?

Hello,

From what I understand, a short circuit occurs when there is very little resistance in a circuit, so the electrons flow very rapidly from one terminal to another, which causes problems.

How does pushing a button, closing a circuit, differ from connecting a solid wire from a high pin straight to GND?

Just to confirm, connecting a HIGH pin to GND will in fact destroy the pin, yes?

A short circuit is when the power supply or rails are shorted out so that large fault currents flow.
Put a push button directly between 5V and GND and indeed it will short circuit the supply (and damage
something).

Push buttons are used with series resistors (typically described as current limiting, or pull-up, pull-down
depending on circuit topology) The max current is small and well defined, not large and ill-defined.

Shorting an output pin to either rail is likely to cause damage, yes.

An input pin is completely open, almost infinite resistance, so no issues connecting to either rail.

I think I got it, thanks!

MarkT:
An input pin is completely open, almost infinite resistance, so no issues connecting to either rail.

Could you elaborate on this? What exactly is it open to?

So long as you don't try and impose a voltage that's outside of the range 0..5V (assuming 5V supply),
an input pin looks like an open circuit - takes no current (well, a current so small you cannot measure it
without specialist equipment).

Well, to be precise, this is only true at DC - the pin has capacitance which means at high frequencies
the pin will impose a current load, but its still a very high impedance nonetheless.

toxicxarrow:
How does pushing a button, closing a circuit, differ from connecting a solid wire from a high pin straight to GND?

Just to confirm, connecting a HIGH pin to GND will in fact destroy the pin, yes?

  1. No difference. A switch is a convenient way to connect (short) two wires.

  2. Not if it’s an INPUT pin.
    Imagine there is (almost) nothing connected to the pin on the inside of the chip.
    That is at least the case if the voltage on the pin is within the boundaries of supply and ground of the chip.

You can apply 0-5volt to a pin if the MCU is powered by 5volt, and NO current will flow in or out of the pin.
Unless you have enabled internal pull up in pinMode (an internal ~30,000 ohm ‘resistor’ between pin and 5volt).
Then, if you ‘short’ the pin to ground, a tiny current of 5/30000= 0.00017A (170uA) will flow to ground.

But if the pin is configured as OUTPUT, and set HIGH, then a signficant current flows when you ground the pin.
At least from the perspective of the MCU.
Short circuit current is limited by the internal resistance of the output fets (~25-50ohm),
so 100-200mA could flow.
That could indeed destroy the pin (40mA absolute max).
Leo…

Thank you, guys. It makes sense.