10k- v 220-ohm resistor and a push button.

p35 of the starter kit book states, when adding a push button to the project, "You'll also need to add a 10k-ohm resistor from ground...That pull-down resistor connects the pin...so it reads LOW..."

Fine. It works. All is well. I removed the 10k-ohm resistor and replaced it with a 220-ohm resistor. Again, all is well.

The bit I can't understand is why the 10k-ohm resistor is chosen over the 220-ohm resistor. Clearly, the 10k-ohm was chosen for a reason. I really couldn't see any difference over the 220-ohm one. Can somebody explain why?

I've got nothing else on the circuit: just the push button and a tiny bit of code to react when it's pressed or not.

They indeed both work, but think about what the difference is when pushing the button with either resistors. in both cases you register the button push, that's great, but: with the 10k resistor you now have a current of 5V/10000-Ohm = 0.5mA flowing from 5V to ground. With the 220-ohm resistor you now have a current of 5/220-Ohm = 23mA flowing from 5V to ground.

Imagine this were battery powered. For no reason at all (since they both work), when the button is pushed your system now draws 50 times more power from your battery than the other option :). That's why they use such high values of resistors (why not even higher values? they still need to be able to pull up/pull down the pin reliably, the highest values of resistors are getting pretty close to electrical insulators).

arduino_obc_and_rbc: Fine. It works. All is well. I removed the 10k-ohm resistor and replaced it with a 220-ohm resistor. Again, all is well.

Yep.

arduino_obc_and_rbc: The bit I can't understand is why the 10k-ohm resistor is chosen over the 220-ohm resistor. Clearly, the 10k-ohm was chosen for a reason. I really couldn't see any difference over the 220-ohm one. Can somebody explain why?

The 220 Ohm will turn more electricity into heat. That annoys engineers...

No need for an external resistor at all if you do it correctly:- http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

With the answer.

As so often happens.

Interesting items on the website link. I've bookmarked it. (As they say in Crawley, fumzup)

Power usage..... you'd be waisting energy just sitting idle (you could use the power for something else).. 23ma (how much is being wasted) could be used to light an LED, total waste as a pulldown/up.

Power usage..... you'd be waisting energy just sitting idle

No when it is sitting there with no button being pressed it does not waste energy because the impedance of the input is so very high. Therefore the current flowing is so small the actual resistor size is insignificant.

It is only the small period when the button is being pressed is energy being used. It is not wasted because it is ensuring against interference. So you can reduce the energy at the expense of being more susceptible to interference. Like most things in electronics it is a balance.

Keep forgetting there's a button involved, I just thought pulldown...

Then yes when the button's pressed, eg you'd not want a 200ohm resistor on A0 pin for example as a pulldown to keep it at 0v to stop it floating a 10k would be better...