Calibrating analogRead for buttons on resistor ladder

You can make your own poll:

  • It has its place for a project that is only for a few months.
  • It has its place if you make a project for someone you don't like.
  • It has its place if also the software is wrong, for the right balance.
  • It has its place... no, just kidding, it doesn't.
1 Like

This is an unhelpful and arumengtative reply. You don't like resistor ladders. That's fine. That's your opinion and you are entitled to it. That does not make it gospel for everyone else.

@soonerdave, that was not my intention, I'm sorry if it turned out that way. I am using the freedom on this forum which is not a question-answer forum, but also to give direction, background information, alternative solutions and so on. I hope @TomGeorge does not mind that I made a little fun of his reply.

To be serious: You know now that there is discussion about the resistor ladder with buttons. It is up to you to decide if the risks are acceptable. If someday a problem occurs with the resistor-ladder and buttons, then you already know the weak points and perhaps you can fix it quickly.

If you cashed in those resistors and got diodes, you could have 12 switches with just 4 input pins using charlie-plexing.

google it and see if appeals. It would certainly raise fewer objections.

a7

As you climb the knowledge ladder
Logic may have you resist
Or switch to something new

1 Like

I am considering both IR and Bluetooth solutions. I've done some experimentaton with the resistor ladder and while I see how it can work, I'm concerned about frequent reading and possible variability from analogRead.

Still considering all options. Thanks.

Nice senryu. I tried to 5-7-5 that into a proper haiku. Sadly my talents, if any, lie elsewhere.

a7

1 Like

I have looked into charlieplexing for diodes and buttons and while I get that concept, I think the need to do the scanning among the buttons may be a problem for some of the projects I have in mind that may be timing/looping-sensitive. Thanks.

It's your picnic, so you get to decide what kinda sandwiches to bring! Mmm… sandwiches.

For anyone following along who is hearing about this for the first time I am compelled to say

Finding which if any button is pressed on a matrix keyboard should not take significantly more time, nor that much more code, than using the resistor ladder idea or for that matter 9 buttons each on an input pin.

a7

Switches and ladders
Resistors connected well
Software rejoyces

1 Like

How many switches can you connect to a single digital pin and read individually?

I'm not sure what "frequent reading" might have to do with it, but it is not a concern that analogRead may vary, but that the buttons may degrade over time.

I moved away from the button solution and implemented a Bluetooth communication module via an Android controller app. Works fantastically and it was reasonably simple to implement.

1 Like

Can we add to the poll?

A) teaches troubleshooting skills

  1. Offers posters something to discuss other that the topic

  2. provides the opportunity to learn more about analog

IV) simple multiple inputs for a beginner project

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.