Wiring Multiple Inputs To Arduino

Hello,
I've built a machine and starting wiring up my I/O to my uno board but have run into a problem hopefully you can help me out with :slight_smile: I have multiple switches and buttons wired on one side of each device to a 5V bus bar jumped off my board. The other ends need to go to their respected input pin but also requires a pull down resistor to ground. I'm not completely sure which is the best way to go about this. I have attached a very poor paint electrical diagram. Should point A (blue boxes) on both lines be attached to ground with a diode? I have done some googling and found some people just using a resistor to jump to ground but that doesn't make sense to me because I would imagine current would then flow to all of the inputs attached to the ground bus bar if any switch closed. Also if you happen to know what is the ideal value of a pull down resistor? I hear 10K but opinions seem to vary. Any input is appreciated (no pun intended) and thank you for your time.

Do they have to be connected to power? If you use the internal pull-up, you can wire them directly to ground without the additional external resistors.

If you still want to use pull-downs, then yes you just connect the blue points to ground through resistors. You're right that there technically is an electrical path with those resistors in place but charge won't flow in the way that you're worried about. Just remember that charge only flows from higher potential to lower potential and it should make sense why.

First off thank you very much for the reply, I literally just posted that (you rock!!.) I will use the resistors. I'm kind of building this thing out of stuff I have lying around, do you think 180 ohm resistors would be sufficient or should i go with something higher. I just happen to have about 100 of these resistors that's why I'm asking. Again thank you for your expertise.

A safer way is to use a common GROUND for all switches, and wire a switch between pin and ground.
Then you don't have 5volt running around, that can short/damage things.

If you enable the internal pull up resistors in void setup(),
pinMode(pinX, INPUT_PULLUP);
then you don't need external resistors.

Yep, pull up/down is needed, so the pins will not be "floating" when the switch is not "ON", and have an undefined value.

Change the code. A pressed switch is now LOW, and a not pressed one is HIGH.
Leo..

Thank you Leo, I appreciate the input.

180 is a very strong pull-down so it is an unnecessary waste of power but it should still work.

At 5V, P = V^2/R = 25/180 = ~140mW. So just make sure they are at least 1/4 watt resistors.

ok I'll step it up, thank you sir

Hi Michael,

Re-using old electronics is a great way to learn, and save some scratch at the same time!

Are you doing something special with the signal at "point A", or are you just trying to read the switches? If the latter, then replies 1 and 3 are pertainent. Of course you CAN use pull-down resistors, and use that three way connection. Most users take the easy (and frankly, more reliable and more forgiving of human error) way to read a switch, use the pinMode of INPUT_PULLUP, and wire through the switch directly to ground, like this:

This has the effect of using a tiny 20-ish kilohm resistor inside the Arduino's chip that connects the pin to 5 volts. in your loop when you read the pin using digitalRead(switchPin) it returns true if the switch is open, and false if it is closed.

Save your 180 ohm resistors to light any LEDs you want to shine near their maximum brightness. They are the perfect resistance for that.

Thank you Chris!!

michaelszabo:
ok I'll step it up, thank you sir

No no, don't step it up. Most of us here are saying to not use the resistors. The microcontroller has pull up resistors built into it. As long as you are not in an electrically noisy environment or putting the button at the end of a stupidly long cable, they will be good most of the time. Adding the extra wiring and hardware to duplicate something that's built in is just pointless.