Controlling 100 button inputs as well as 100 independent LED outputs

Good day,

I know this is a frequently talked about topic, but I still hope someone can guide me/give advice.

My question is regarding many inputs/outputs based on push-buttons/LEDS/music keyboards for a virtual pipe organ (VPO) project I am busy with.

I want to use an UNO board to interface between a physical setup (push-buttons/LEDs) and music software on the PC. For this, I need to relay MIDI messages to the program (generated based on push-button prompts.

I want to use approximately 100 momentary pushbuttons with LEDs to act as "organ stops" for the project. By pressing a button the code needs to read the button press and generate a corresponding MIDI message (note on/off), this message is interpreted by the software (activates a setting) and returns a MIDI message that the Arduino translates to turn on the corresponding LED. The "tricky" bit here is that the button and LED should not function as one, i.e. I need to be able to control the LED state independently from the button press because changing a setting in the software (via a mouse click or something similar) requires a change in LED status (the software will generate the required note on/off message).

I have managed to get the above setup working perfectly for a test system containing only 5 buttons and LEDs (using the MIDI.h library for the midi functionality). The code perfectly interfaces with the buttons, LEDs and software with no issues at all (proof of concept). My only question is how do I scale this up to handle the multiple inputs/outputs (100 each)?

In short, I would like to have 100 button inputs as well as 100 independently controlled LED outputs. I want to be able to press multiple buttons and/or light multiple LEDs simultaneously if at all possible.

Should I use shift registers for each, and/or also use two different Arduinos for the inputs and outputs? I think the independent nature of the buttons/LEDs would work with two Arduinos if one cannot handle both

Any advice would be appreciated.

Regards,
Gees

Welcome to the forum

The LED part of the requirement is easy. Use addressable LEDs such as the WS2812. Control 100 individual LEDs using a single pin

100 buttons is going to require external hardware

If any LEDs are factory built into the buttons and @UKHeliBob suggestion is not suitable, you might consider 2 x MAX7219 which will drive up to 128 LEDs. For inputs you will need port expander(s) (such as MCP23017 for example) or if you feel like experimenting and have a suitable IR remote with at least 100 buttons you could with only 1 pin get information about a button pressed but this way does not allow multiple buttons pressed at the same time . The IR remote method has been tried and works by eliminating the IR part and connecting directly to the microcontroller pin.

You could easily built it with serial in parallel out and parallel in and serial out shift registers. You can place them in series one group for leds the other group for inputs. Then using a bit of software shift out the bits corresponding on the LEDs that are on/off and read the input of the other set of shift registers while shifting out to the LEDs. There are many other ways of doing this. It is a long SPI.

Thanks all. Just to clarify: It's 100 individual push-buttons with internal LEDs, but they can be wired/connected independently.

I don't actually have to press multiple buttons at once, so that might make things easier. I would however like to be able to change the status of all LEDs simultaneously, but the exact timing or delay is not critical.

I'll read up a bit on the suggestions and play around with some of the components that I do have on hand.

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