Hi Ranjib,
It should be possible to extend I/O ports via the MCP23017 (I2C) . Also the PCA9685 could be used as digital output according the documentation. I have been thinking about a modular electronic/mechanical concept and this is my (mechanical) idea so far:
I made these drawings for myself this morning, because it helps to get a better understanding of the whole concept and questions to be resolved (e.g. size of the modules, way of electrical/mechanical connections, power solutions, etc.)
the I2C bus should work like this (side view, below top view)
Depending on the number of modules required, the I2C bus can be extended and present idea is to have additional 5V and 12V on the 'rail'. I think we should have a small (for single I2C devices, or connection of the single wire DS18B20 sensors) and a larger for I2C controllers with many I/O ports.
Already made a PWM board design with 16 outputs on a 6*13 cm size board (started to learn KiCad :) ) which mechanically would look like this:
The red circles I added as not yet fix for myself. Present idea is to plug module from top on the I2C bus. This will make the total design a little higher but potentially also smaller (width) and think mechanically it's better due to the I/O connectors on the other side.
Unfortunately it's not showing the audio 2 connectors and a 7810 chip. I want to make some modifications to this design to fit the modular concept and most likely will change the I2C address solution.
I know that it contains an SMT component, but if you look at the upper left side of the design, maybe that can be replaced by the PCA9685 module, haven't checked that yet.
Have not designed the piggy back board yet, but basically is copy of part of the main controller
I have some idea's about the overall housing (base with I2C PCBA) which then also connect mechanically to the individual modules (didn't made a drawing of that yet)
I'm waiting for some electronic components to arrive (they are very expensive in Europe and Asia takes time :-( ). I'm also planning to design a MCP23017 module. Any comments/critics are welcome, it can only help me/us to come up with a flexible electronics/housing design.