if i am having problems with an unstable button, do i need a larger or smaller pull down resistor and why?
Yes! Pull down resistors should solve your problems.
I use 10k though most values in the ball park should work.
Pull down resistors stop the pin from registering small fluctuations of power on the pin as false positives. What size resistors are you using?
Debouncing the switches might be the best solution to poor switching.
The pull-down resistor value must be in-between the resistance of your system when button is released and resistance when button is pressed.
One of the problem that can be found is that the button as still a high resistance when pressed. So you should have a larger resistor value to force the current to go through the pressed button and not to the ground (current goes where the resistance is the lowest).
Don't forget that digital pins of Arduino (of AVR µC to be exact) are not binary, GND or VCC. They receive an analog voltage then have a threshold to go from LOW to HIGH, and it is not half of VCC, rather 3,5 volts for the standard 5V power (exact value is in the datasheet). You can check that you are over this threshold with your button and your pull-down resistor by calculating the voltage-divider bridge (not certain of the translation in english)
What do you mean by "Unstable"? Do you get multiple readings? or the button works sometimes, and doesn't work other times?
If you're getting multiple pushes, you need to look at using a debounce capacitor, or some code for an alternative. There was a library created by one of our users:
http://www.arduino.cc/playground/Code/Bounce
It's generally easier to just add a capacitor, but it's worth learning how to debounce in software!
But if you're just getting high and lows randomly without pushing the button, you need to move your resistor. (assuming you're using one:D)
There's also an easier way to get past this issue with the Arduino. The Arduino has internal PULL-UP resistors that can be turned on in software. This way, you only need to connect one side of the button to the Arduino pin you're using, and the other side to the ground of your Arduino. No need for resistors. (but you also learn NOTHING!(boring))
You enable the PULL-UP's by making the pin HIGH in software, then turn it into INPUT, inside the Setup. Now you'll have to change the way you read a button to act when the pin goes LOW, rather than HIGH.
Here's an example, you still need to debounce the switch, either in software, or hardware.
void setup()
{
pinMode(buttonPin, INPUT); // turn button to input
digitalWrite(buttonPin, HIGH); // enables the internal pull-up resistor
}
void loop()
{
boolean buttonState = digitalRead(buttonPin);
if (buttonState == LOW)
{
//code for world domination
}
}