Okay, Let me dive into this shortly (for me, so no more than an hour or two ;-) ).
As a first response, that I thought of when I started typing about licking down below:
Three year old nephews have very small bodies and a lot of nervous system development left to do, so it is ultimately important you make sure that you get only RoHS and preferably RoHS/REACH parts, since Lead and other heavy metals are no good for tiny nervous systems (nor for adult ones, but we can cope with minor amounts over longer time spans). So don't go to your bargain bins for wire or boxes, but check decent outlets, so you know it's been qualified. Also use lead free solder. For hobby work often I don't fuss about it with people and in fact I use a lot of Leaded myself in prototyping still, but when you're talking about developing children, it's somewhat different.
On to the answer I started with:
First up, as I made clear in the comments, there is no way that making an elaborate architecture around a reduced number of I/O pins is going to be cheaper or more time efficient than just buying the MCU platform with enough I/O pins, but since you say you'd be interested in those tricks anyway:
Let's pretend we're living in the times where a processor platform with some I/O costs €100 to $130 (yes that change of type is intentional) of equivalent now-day-money and the one you'd need for full software solution with "Whoaaaa-many" I/O pins would cost you €300 to $350. In which case trickery may be useful indeed:
There are many ways, both analogue and digital with the inclusion of extra wiring, diodes, resistors and/or capacitors to detect combinatorial paths up to the entire totality of your full 140152 options with less than 12 pins.
I just copied that number by the way, because I'm actually too busy-ish right now to check your maths.
So also, as a heads up: The below methods are not fully thought out, as I would normally do (and waste half a day or more), but lightly explained ideas.
They need feasibility checks and cost estimations as well as more maths, which I'm leaving out due to lack of time.
So treat this as "a way to look at some options I manage to present to you before I need to be back to being useful", rather than a full and complete design guide to exact components and schematics.
Your options (the equations are assuming perfect analogue and/or digital pathways):
- Scan 12 pins, as you point out yourself.
- Use ADC tricks to achieve (ADC granularity)^n = 140152 levels of detection.
- Use timer+ADC tricks to achieve (n-1)x(Timer Granularity)x(ADC Granularity) = 140152+ levels of detection. (the maths here are a bit iffy around the n-value)
- Use timer+Comperator tricks to achieve (Timer Granularity)^n = 140152 levels of detection.
- Do weird shit with tonal filtering using RLC (your option 3) to achieve 140152+ levels using about (estimating heavily) 2 independent PWM pins and 1 or 2 ADC pins.
- Introduce diodes into the system and Charlieplex (this is probably the easiest one).
Where all options have n as being the number of pins you'd need minimally and granularity is just fancy speak for "number of different levels this object can express measured in least significant bits", or what I also refer to as "levels" when preceded by a number (often the number 140152).
Option 1: Scanning
We've been into that in comments and other answers. Not for here.
Option 2: ADC Trickery alone
Work out the pins... So... Your ADC is probably 1024 levels, so to get the number with pure ADC trickery you'd need only 2 ADC pins, but also some very extremely high grade analogue parts to be able to amplify 1/1024th of a response to full scale with only 10 LSB of error. You can also get a 24bit Audio ADC, by the way, probably easier to get that level of granularity.
Using carefully chosen resistive networks, possibly including some capacitances to make sure the mesh of wires and higher resistances doesn't become some resonant antenna for your local radio broadcasts, you can detect the "disappearance" of every single junction in a change in the analogue signal measured across a part of that network. Most common solutions include the "R-2R" series and "R-2R-4R-8R-....." series. I have no time to work it out exactly, but several paths to that exist.
Using a low input offset (JFET) op-amp that signal can be buffered to allow you to get near enough to a 19-ish bit accuracy, but you will need a metal box and proper grounding, as well as some wiring consideration. And when your nephew licks the contacts all kinds of lights and sounds could start playing, because licking is very noisy, electrically speaking.
Then you'd need a good enough ADC (>19 bit resolution, good differential and integral linearity, etc) to capture that, or create a 20 bit internal ADC with a 1 to 1024 voltage division and 1024 factor amplification on the lower response. That last bit, however, is quite tricky to get right over noise and thermal effects, but maybe if you over-sample you can get out 19 to 21 bits of accuracy on a lucky try. Messy though.
3. Timer + ADC tricks:
This one requires more post-maths than full text, but is pretty fun. Here you create a waveform on one pin. It can be a pulse or square wave or even PWM, it's all up to the person doing the maths.
You feed that through an array or network of capacitors that get bridged by wires plugged in using one known resistor. By again decisively choosing capacitances, like in the resistor network, you can get a full picture of gaps and shorts in it. All capacitors should have a voltage rated above the maximum voltage (5V, or 12V, or 3.3V, whatever your digital drive can generate and your analogue system can measure).
If you would use one 8 bit timer to create a variable pulse width, a 10bit ADC to measure the resulting voltage at a changeable interval using another 8 bit timer, I'd be amazed if you couldn't get near a million levels of capacitor measurement range. Change the signal generator to a 16bit timer and it'll easily be tens to hundreds of millions.
Using large capacitances you may need an output buffer, to more strongly force the signal to get reliable results. There's likely to be some driver/buffer chip under €1 that will drive 100mA or more into large-ish capacitances, but usually MCU pins don't like those and start generating more of a triangle or sine output, rather than square wave, making the maths all moot.
Option 4: Use timer and comperator tricks
This is basically the same as above, but rather than measuring the level at an interval, you set a comperator to measure (many Atmels, and as such 'duino's, have internal comperators) one precise, known threshold across the capacitor that is charged after you set an output pin high. By measuring the time it takes to get there, you can use the charge/discharge response of a capacitor to develop the maths to figure out how large the capacitor is, based on the time it takes to charge. By using a 16bit timer and some R/C tuning you get up to 30000+ levels of capacitor sensing.
Add an 8 bit timer (software or hardware) that increments one each time the 16bit one overflows and you can get more than 15 million levels of capacitor detection.
Usually the comperator is more stable than the ADC, so time-to-time and value-to-value will be more stable, but the detection resolution with the same number of timer bits will be quite a bit lower. Apart from that the comperator trick is a lot easier to write code for, as it doesn't include all kinds of moiré-like effects on the two timers.
Option 5: RLC tricks with tone generation
This one needs quite a bit of pen and paper to make really universal, so it'll stay even more conceptual (I hope - already out of time at this point).
PWM tones can possibly be a second (and third) audio channel, if that library works cleanly enough.
You can generate a tone, which then gets through several stages of filters that may stack and short depending on connections. Depending on which tone you make you also get overtones, since you'll create the tone digitally, unless you introduce audio DACs. For small currents the RLC filters needed to let through or filter out one single tone can be relatively small, even in the lower ranges of audio frequency.
If every connector has a band-stop into the connector and another band-pass from the connector to ground, I believe there is a way to do this with a very limited number of tone generators and ADCs, but I lack the time to properly work it out. Just make a small peak-detector with a diode, capacitor and discharge resistor to turn the tone back into a DC signal.
Option 6:"Introduce diodes and charlieplex:
Here you can add diodes across some of the signal pins and ground rings of the connectors. Some in the one direction, some in the other. Again, time is running out, so this will have to keep it at the upper-upper theory level. You may then also need some resistors to make it work properly, but then you can simplify the digital drive and sense technique, you may even also be able to use an ADC more effectively using diodes and charlieplexed outputs with resistors.
But to see if and how that works you may have to take it from here. My thought basically was: If you have diode in one direction, and another one in the other, they combine and become a short to ground for both direction. If you combine two in the same direction they are short in only one direction. Throw in some resistors and possibly some more diode networks and you may end up with a 6 or 7 I/O purely digital way to sense all your possible combinations.
Here I stop.