1

I wonder how to calculate pulldown resistor to make interrupt work? I need to connect 5 buttons to A0 and get pressing event via interrupts. Using different resistors, finally, I made work only 4 buttons. On 5th interrupt does not fire. Currently I use the following resistors for the buttons:

R1 Vout
0 5,00
2,7K 4,45
5K 3,70
10K 2,77
22K 1,78

And Pulldown Resistor = 22K.

If pulldown Resistor = 10K I can get event for 1-3 button only. Looks like the voltage 1,78V is quite low. But I’d liked make it work with 1V at most. I use RISING mode.

PS. Arduino Nano

Michel Keijzers
13k7 gold badges41 silver badges58 bronze badges
asked Oct 24, 2018 at 21:10

1 Answer 1

0

An Arduino running at 5V needs at least 3.0V on the pin to read it as rising high. You probably want to go a little more than that. So that means your lowest voltage has to be like 3.3V or so.

Note that the analog pins don't have an external interrupt, you'll have to use pin change interrupts and then read with analogRead in the ISR. So you can't use "RISING". The pin change interrupts act on any edge. So they'll trigger when falling as well.

That's a pretty poor way to handle these buttons. Normally one would just poll buttons like this. If your loop takes so long that you might miss a human pressing a button then perhaps you should look at that instead.

answered Oct 24, 2018 at 23:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.