Need ~90+ pins and even the mega 2560 has to few pins, ideas?

I have a project that has 12 individual parts/sections. I have only programed 7 of these parts and I am already using/ needing more than the 53 pins + A0-A15 that the Arduino Mega 2560 offers.

Each section has:

between min 1 max 14 LED's
between min 1 max 11 buttons
either 1 or 2 (7-segment displays) or
an lcd display.

Full parts list that I know I need so far:

2 - Neopixel Stick
1 - Red 7-segment clock display
3 - 7 Segment Display (2-Digit)
1 - Adafruit NeoPixel NeoMatrix 8x8 - 64 RGB LED Pixel Matrix
27 - Green LED
2 - Yellow LED
1 - 7 Segment Display (Single Digit)
2 - 7 Segment Display - 20mm (4 Digit)
1 - Red Square LED Button
1 - Blue Square LED Button
1 - Yellow Square LED Button
1 - Green Square LED Button
1 - 5-way Navigation switch
1 - Snap-Action Standard Micro Switch with Lever
30 - Mini Pushbutton Switch
1 - RGB Button
3 - LCD Display 16x2 I2C
1 - LCD Display 20x4 I2C

Any suggestions on how I can reduce the number of pins used to control things like LEDs or buttons as those are the ones that take up the most pins. NONE of these LED's will always be in sync and must be individually addressable.

Or any suggestions on how to better build this? The reason I was trying to keep it to 1 arduino board was due to the fact that I want this to be an easy plug and play tool that does not require a web interface or anything else to configure/ sync/ start.

Plus its my first ever real project aside from just the learning courses I took.

Move all the digits and/or LEDs to a MAX7219, will control up to 8 digits or 64 LEDs.

Use neopixels for all the indicator LEDs… too…

Yeah, the big thing is that you don't need 1 pin per LED, ever (and if you did, you could run into power problems WRT maximum per-chip current.)
Matrixes with multiplexing, smart 7-seg displays, smart individual LEDs...
Switches are the same. You can even share pins between LEDs and Switches pretty easily.

But still, it sounds like a project that is big enough to split up between multiple Arduinos, instead of looking for one giant board.

Thought about this a bit more despite having many much better things to do with my time....

Yes, this project really calls for being split up into multiple devices. You could definitely get the pincount way down to where it would fit within the pins of a mega, but that's the wrong approach IMO.

For the LEDs on each one, use APA106 LEDs (WS2812 clones in classic through-hole package) or get WS2811 strings (the ones that look like christmas lights) and chop them to get the right number of LEDs (whichever makes more sense for how you plan to mount them).

Now, each section could be run by a 328p - however, if I were doing this, I'd use a 328PB. Why? Because it has a second UART.

Then, I'd daisy-chain these modules, using serial communication with some simple addressing scheme, wherein each one would pass along messages down the chain, acting on them if it were addressed to them only, and I'd try to keep the code on each module as similar as possible (ideally identical, with the configuration stored in EEPROM).

You could do it with a single UART as on a '328p though, which might be an easier route to making it work quickly, since you could do it with a bunch of pro mini's - just run the serial ports in a ring... (for reasons I've never understood, despite the PB being cheaper, '328pb pro mini's don't seem to exist on the el-cheapo ebay-from-china market)

I forgot to turn on alerts for this thread so sorry for not seeing your replies earlier. I appreciate all of the input.

@DrAzzy are you saying I should use "Through-Hole NeoPixels" or is there a reason I should use a different style that I'm not aware of?

@DrAzzy Does it matter if I use different model boards (Ex. 1 mega for main 4-5 modules, and the other 8 each with their own 328PB Micro? Do I have to stay in the same family of boards or use the same ones for each part?

@CrossRoads I have only used the dotMatrix MAX7219 prebuilt boards so I will have to do some research on how to connect all the LED's manually but that makes a lot of sense if I am trying to reduce the number of pins used and stay single board.

Use some 74HC595 shift registers to get more outputs. They're fast, cheap and can be daisy-chained to give you hundreds of push-pull outputs. Each chip has 8 outputs. All you need is three IO pins.

If you need more inputs you can use the 74HC165 shift register. Works very similar to the HC595 and has 8 input pins.

What's also great about having distributed IOs is that the (PCB) layout tends to be neater, since you can place. the shift register chip right where you need it.

cwegrecki:
I forgot to turn on alerts for this thread so sorry for not seeing your replies earlier. I appreciate all of the input.

@DrAzzy are you saying I should use "Through-Hole NeoPixels" or is there a reason I should use a different style that I'm not aware of?

@DrAzzy Does it matter if I use different model boards (Ex. 1 mega for main 4-5 modules, and the other 8 each with their own 328PB Micro? Do I have to stay in the same family of boards or use the same ones for each part?

@CrossRoads I have only used the dotMatrix MAX7219 prebuilt boards so I will have to do some research on how to connect all the LED's manually but that makes a lot of sense if I am trying to reduce the number of pins used and stay single board.

You should use whatever package of LED is suitable for the way you want to mount the LEDs. You can get breakout boards (from adafruit or much cheaper on ebay) with the 5050 SMD package on them, you can get the WS2811 strings and chop them up if that shape works better - if you don't have to chop em up, so much the better.. Or if it would be more convenient, APA106 through-hole ones. Or design your own board with the SMD ones if that's up your alley (that's what I'd do, but I also will do anything to put off actually building a project, including designing a custom PCB) You should be able to mix-and-match them on one string... I haven't recenly tried a mixed string, but IIRC it worked last time I played with it...

You can use... basically any board with hardware serial?. Hell, if you have 4-5 megas, they've got enough sserial ports that you could probably do the whole thing with direct routes, no wierdness like whgat I descrubed above. I mean, IMO the ring would be way more fun, but... probably less likely to result in a working system, you know?