Hello all. I am building a circuit which requires me to use pull down resistors.
It seems that there are 2 versions of pull down resistors availabe online. The picutre is below. Which set up do you think is the best?
The one on the left will also have 10K resistors.
I don't see any requirements here.
As others said, just connect the switch between pin and ground, no external resistors,
and enable the internal pull up with code.
Note that logic is now reversed. The button pressed now reads a LOW.
Too many cases of folks miswiring and shorting 5V to Gnd when button is pressed. Can damage voltage regulators, is not good for batteries, etc.
Connecting an input pin, which has its internal pullup enabled, to Gnd, only allows tenths of a mA to flow (current = 5V/35K resistor), which cannot damage anything.
Because you are exposing your regulated 5 V supply to the "outside world" - the wiring to your switch (or other input device) where it risks accidental contact with ground (since ground is pretty common) and even if properly insulated, can capacitively pick up transients.
Consider a remote switchbank - if you run 5V to it there are more places for an accidental short of the 5V to the ground (chassis?). Often the chassis can be the ground wire (in automotive wiring this is universally used) - thus saving a wire.
If you only route ground and switch input lines you have a wiring harness that can't generate sparks (another reason this is done in automotive environments).
There's also a bit of historical accident reason for this - the ancient TTL logic families could not be switched to 5V safely (resistor was needed) - but switching directly to ground was safe for the chips.