256 Plus digital Inputs

We need at least 256 digital inputs, (buttons) maybe up top 512. When a button is pressed we will display something on the LCD for 30 seconds, and ignore any other button presses until the 30sec is over. If we use shift registers do we need a resistor for every button? We want to keep the hardware to a minimum.

It seems if you use port expander you are limited to 128 inputs, using 8 x 16bit via i2c.

Another suggestion was made to use clone mega 2560s (cheap) and i2c master and slaves and just plug the button in the digital slave pins and use internal pull ups. Since the hardware is a small cost of the entire solution we would purchase Arduino brand to support the community

Please point us in the proper direction.

Multiplexer ICs will let you scan inputs from several resources into a single pin. With a bit of planning you can cascade them and get as many inputs as you need. Just make sure you do the scan frequently enough, so that you don't miss any button press.

Edit: You can also get a cheap MCU with many pins, and program several of these as smart input readers. No need for complete Mega boards.

Hi,

How about this idea?

Arduino pins 2 - 9 are set as INPUT_PULLUP. Pins 10 & 11 are used to shift in a single zero bit into the shift register, all other bits are 1. This grounds one column at a time, allowing the Arduino to read the 8 switches in that column (button pushed --> LOW).

If you can't find a74xx596 (which has open collector outputs), use a 74xx595 with a diode on each of the Q outputs.

For a 512 switch matrix, add a second '596 to allow a further 8 columns, feeding the QH* from the 1st register into SER on the second register, and connecting the SCK inputs together, so no more Arduino pins needed.

Paul