Button, why a connection to ground? - Noob questions

Why do you believe that the most logical way is switch between +V and input?

JCA34F:
Why do you believe that the most logical way is switch between +V and input?

Who are you addressing. I don’t. The best way is to switch between the input and ground, with a pull up resistor to 5V on the input.

This is best because it works for all semiconductor technologies and it prevents you having long runs of + voltages running over the circuit which is a hazard if accidents happen and shorts occur.

Silkworm:
Knowing that, I want to "tap in" with my Arduino and detect when a button was pressed on the head unit, without installing a second switch under the plastic cover of the button.
Basically, what I want to do, is to connect one wire from the right terminal of the button to an input pin of the Arduino (which already shares the ground with the head unit - i.e. their ground is the same as that of the whole car).

OK, the way to do this is to use a diode between the switch input and the Arduino, cathode to switch and anode to Arduino input. The switch can only pull the input down to ground but can not pull it up. You use a pull-up at the Arduino input; the internal [pull-up (INPUT_PULLUP mode) may be sufficient as the diode will be immediately adjacent to the Arduino, not mounted any distance away in the wiring.

There is a slight risk that there may be some irregularities in the grounding so that the switch input can pull more negative than the Arduino ground, so a second diode with cathode to switch and anode to Arduino ground can be added, both protected by a 2k2 resistor between switch input and the diodes. I had that circuit in a previous post. Oh well, here we go, do it again!

safeInput.png
Note whatever you do that if the power to the "head unit" is shut off, it will pull the switch inputs down and appear as if all switches are pressed! :astonished:

safeInput.png