A simple input control devices such as buttons and toggle switches can be connected to Arduino either directly or using input extension board or "key matrix" grid.With direct connection every switch occupies one Arduino pin, so, with one "Mega" board you can have about 50 switches, with Uno 10-12 or more with analog inputs that can be used as digital inputs too.
When you need to connect some kind of multi-position linear or rotary switch you can use digital pins for each position (see the picture at right) this can take a lot of digital inputs (e.g. 10 pins for 2-engine starter/magneto).
You can use analog pin as additional digital input for Multi-position switch.
Another option is using additional extension board - see Input extention board.
Even with one Mega board, you can have about 50 directly connected switches and buttons. To extend the number of inputs you can simply add more Arduino boards with ArdSim library (up to 9) to your system.
If adding more Arduino boards is not an option, you can use a "key-matrix" inputs. This connection method is a little more complicated than direct connection and needs additional soldering and components (lots of diodes).
The commonly used method to increase the number of inputs for any microcontroller is the input/output multiplexing technique known as "key-matrix". With this method several inputs ("rows") and several outputs ("columns") of the controller form a grid (matrix) . In each intersection (node) of this grid you can place a button that connects one row with one column when pressed.All Arduino row pins (red) are configured as inputs with internal pull-up resistors. The column (blue) pins are configured as outputs. The program reads all input lines one by one when the first output line is set to active state, then repeats this action for each output line and detects changes on each intersection.
To prevent "ghosting and masking effects" when several buttons / switches are pressed simultaneously, a diode should be connected to each toggle and button.
Pro: N input lines and M output lines forms an NxM grid and you can have more inputs than with direct connection using the same number of controller pins.
Cons: Since it is multiplexing method, the larger the matrix dimension the more processing time will be needed to scan all inputs, and that can affect some output devices.
In case you use one Arduino board for switches and buttons inputs only, the matrix size is not critical.
In the picture you can see an example of a key matrix with 5 rows and 6 columns. For each of the 30 nodes (circled) in this example one button or switch can be used. Diodes connected in series with button are needed to prevent interference between nodes.
As an option you can use enough pins as direct inputs and use remaining ones as key-matrix to extend inputs up to the required number. For example, you can have an 8x8 matrix for 64 inputs using 16 pins of Arduino Mega and the other 32 pins as direct inputs for buttons, switches and encoders.
All additional components that you'll need are lots of diodes (you have to connect one diode for each button and switch to prevent interference between nodes and Arduino damage!).