Arduino Pro Micro 32 buttons + Multiplexer

Which is the best way to increase the number of analog pins with different resistor or with multiplexer?

I trying to build a custom game controller with much buttons and axis.

The best way to handle many buttons is a digital keypad.

Hi,
Are you allowing more than one button at a time to be pressed?

Have you googled arduino input multiplexing

Tom... :slight_smile:

You could indeed use a resistor ladder and an analog input, but this fails the moment more than one button is pushed at the same time.

You can wire the buttons in a matrix - 32 would be a 6x6 matrix, using 12 pins reading a maximum of 36 buttons. If done correctly it should have no problems with having multiple buttons pressed at the same time.

Another option is connecting the buttons to a port expander, such as the PCF8575 or MCP23017 (both offer 16 I/O pins and can be read over I2C).

PCF8575 or MCP23017 are not available for me right now.
6x6 matrix buttons looks a good idea. I will try it.

TomGeorge:
Hi,
Are you allowing more than one button at a time to be pressed?

Have you googled arduino input multiplexing

Tom... :slight_smile:

I have mentions in question ladder resistor or multiplexer.

Shift registers are yet another option. Forgot to mention that.

Matrix multiplexing is the most common way; can be done in conjunction with shift registers or those pin expanders.