digital input pin (in pullup mode) - what's max resistor value?

Hello,
If I configured a input pin as INPUT_PULLUP, what's the maximum resistance I can have between the ground and the input pin when running at 5V? What about 3.3V?

I'm asking because I would like to use a 3.3V nano if possible. The buttons I'm using give pretty high resistance when pressed, unfortunately. Is something like 1K ohm OK? What about 10k ohm?

Do not use this configuration but connect the button between input and ground and use the internal pull up resistors.

Grumpy_Mike, I think you mis-read his question.

The internal pullup is ~30k. With buttons that have 1k resistance when pressed, you're okay. With 10k... it should still work, though it makes me a little uncomfortable. If worse comes to worse, you could always use analogRead() on them (assuming you have enough analog pins) - that would easily distinguish between them.

Grumpy_Mike, I think you mis-read his question.

Why is that then? My reading is consistent with your answer.

I assume he is using the stupid pull down resistor with the button connected between input and positive configuration, not the correct one.

Having too high a pull down reduces the noise margin much more than a too high pull up resistor in my experience.

My interpretation is that he has the internal pullup enabled on the pin, and the pin connected to one side of a button, and the other side of the button connected to ground. The usual configuration - complicated by the fact that he is using a highly non-ideal button (because it's flexible, or super thin, or is in a wearable connected with conductive thread) with >1k of resistance while "on".

That is what I also understand.

Worst case pullup resistor could be 20k.
AFAIK, "low" switch point is 0.3VCC.

In theory 8k57 should still work. 5volt or 3.3volt Arduino makes no difference.
Leo..

Highest voltage still considered a valid "low" is 0.3 x Vcc.
So 0.99V with Vcc = 3.3V.
So it becomes a simple voltage divider question, Vout = Vin x R2/(R1 +R2), Vout the junction of the internal pullup R1, R2 the switch resistance, fed by the Vin, the Vcc of the chip.
solving for R2: R2 = Vout x R1/(Vin - Vout)
0.99V x 20000 ohm/(3.3V - 0.99V) = 8571 ohm
So R2, resistance of the switch, can be pretty large and still get a valid low reading.

And as Wawa said, works for 5V also.
1.5V x 20000 ohm/(5V - 1.5V) = 8571 ohm

:o I do it the short way.
I see switch points as a ratio 3:7
20 x 3/7 = 8k57...
Leo..

One can do shortcuts, or one can derive it and teach someone else in the process.

Where 3:7 or 3/7 is coming from?

CrossRoads:
Where 3:7 or 3/7 is coming from?

Low switch point is 0.3VCC, so pullup is the remaining 0.7VCC
The 20k pull-up resistor is the 0.7 part.
(20/7)*3
I guess it't how your brain works.
Leo..

DrAzzy:
My interpretation is that he has the internal pullup enabled on the pin, and the pin connected to one side of a button, and the other side of the button connected to ground. The usual configuration - complicated by the fact that he is using a highly non-ideal button (because it's flexible, or super thin, or is in a wearable connected with conductive thread) with >1k of resistance while "on".

Yup yup, that was my question. The circuit is correct, just a non-ideal button. Thanks!