Easy Question: Momentary Pushbutton to Arduino

Hi!

I have a question that I'm sure has a simple explanation, but current confuses me.

Let's say I have a power supply that can do 5V @ 10A, and it is powering all sorts of things in my project. One thing I want to have is a pushbutton that I connect to an input pin on the Arduino and poll to send over serial to my PC.

My question is how much current will this use when the button is pressed?

I can think of two ways to wire this up:

  1. Digital pin to my +5V power supply. Ground to my button to the digital pin. When I press button, ground goes to pin and pin goes low.

  2. Digital pin to ground. +5 power supply to my button to the digital pin. When I press button, +5 goes to pin and pin goes high.

In both cases, these seem like a short to me, and that the full 10A would run through the connection (uh-oh). Do I need a resistor? Do I need a resistor rated to handle 10A? Will I be dissipating tons of power?

What's the right way to do this?

My question is how much current will this use when the button is pressed?

Too small to worry about.

connect the push button :_ one end to the digital input pin the other end to ground.

In software make the pin an input and enable the internal pull up resistors by writing HIGH to that input pin.
That's it.

Hmm, it's worth noting that this might not work because I am going to be multiplexing 16 different sensors to that digital pin - so maybe I can't just set it HIGH in software?

In which case add an external pull up resistor on each switch, 10K will do.

The sort of questions in this thread, and similar ones, are answered in a sequenced manner in my (free) Arduino course at....