Pull Down resistor schematic

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.

Thank you

The pulldown on the left is more correct.

edit: I changed my mind. I like the one on the right also. More protection for the input pin.

1 Like

FYI

1 Like

Why not just use the internal pullup, and an external switch that connects the pin to Gnd? Don't mess with connecting things to 5V on the fly, that's not good design practice.

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.
pinMode(switchPin, INPUT_PULLUP);
Note that logic is now reversed. The button pressed now reads a LOW.
Leo..

Why connecting to 5V is worse than connecting to GND?

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.

Definitely bad design practice.

1 Like

It has some practical advantages:

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.