I am using an Arduino Uno R3 with a 12v power supply funning a 12v motor. I have eight switches that don't do anything, they are just either off or on and I need to be able to tell which ones are on at any given moment. I have found numerous discussions about various configurations with one resistor, eight resistors or even a different value resistor for each switch. Cautions about where to but the resistors - power side, ground side, before the pin, after the pin in order to avoid noise. And to twist the wires to avoid noise. Since I am packing all this into an 8" box I suppose noise could be a concern. Being a novice all this research has been a bit confusing.
So, my question is, does this look like it will work? Can I get away with using this few pins? (I have other things to use pins for)
Thanks for the Typical Switch Wiring diagram, I'll definitely keep that in my kit.
To my novice eyes it looks like my wiring example is equivalent to the S1 External Pull Down example except that I have my resistor on the wrong side of the switch (and it's not a high enough value)
Can I get away with using only one power wire, one ground wire and one resistor for all eight switches?
I believe that you will need one resistor per input pin unless you go to a more sophisticated scheme like scanning (which may involve you in diodes).
What is the problem? Each input pin already has the power wire and the resistor internal to the Arduino and for free (see INPUT_PULLUP).
Doing it this way, you will only need eight switches with each switch wired to a different input, and one ground wire connected to all of the switches (on the other end from the input pin connection of each switch).
Don't make things more complicated then they are.
Just wire each switch from Arduino pin to ground (no 5volt, no 10k resistor). Like S3 in larryd's diagram.
Ground to one contact of all switches, the other contact of the switches to multiple pins.
Leo..