How to connect 22 switches to an Arduino?

Status
Not open for further replies.

steven834

Newbie level 6
Joined
Dec 10, 2014
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
106
I have built in place 22 momentary SPST pushbutton switches with 23 wires (one common wire and 22 separate running to all the switches). Note there is electromagnetic interference noise in the area.
Option one .
Use Arduino Mega2560
Put my common wire to ground
Put a 100 ohm pullup resistor on each separate line and connect each line to a different io port.
Option two
Daisy-chain together three 74HC165N Shift Register and connect to arduino.
I don’t have a clear understanding of exactly how to do this and if I need any resistors or capacitors (I can’t find a wiring diagram).
I think when I use the shift registers I don’t have to program for debounce.

Is one solution better than the other or something else?
Thanks
Steven
 

aren't the 100 ohm pull-ups better for my noisy environment? ( to increase the current and reduce effects of noise coupling)

Any comments on my bigger question?
 

Hello!

If you want 22 switches, you can use a 5 line x 5 columns grid. In this
case you can use up to 25 switches, and it will cost you only 10 signal
lines. As far as I remember, you may be able to do that with Arduino, even
the UNO type.

Beside this, 100 ohm sounds indeed very low, even in a noisy environment.
100 ohm will means 50 mA in 5V, which is more than 1A for your 22 switches.
In a noisy environment, even 50k would make it, except possibly in extreme
environments. What is the environment exactly?

Dora
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…