With a load of inductors and capacitors on order, it was time to prepare a PCB for etching to see if this thing will actually work. Even now, we’re not entirely sure that it will, but here’s the theory behind our current approach:
We’re going to dynamically add a ground to each “column” of sensors; the idea being that we can attach multiple oscillators to the same input pins, and activate only the column we want to read by giving a ground to the “left-hand-side” of the circuit. Instead of connecting and removing the blue wire, we’re going to set an i/o pin to a high output, then turn it to an input. By turning the pin to a (high impedence) input pin, we’re effectively removing the power source and setting the oscillator running.
Now we need to create a grid of sensors, attaching multiple oscillators to each i/o pin. Consider the diagram below (we’re still not sure this will actually work, but this is the theory so far!)
Let’s say we want to read the left-most column of sensors. We set the output pins on the shift register such that Q0 is low and Q1-Q7 are high. This means that the capacitors and inductors C1-C4 and L1-L4 have no ground connection and – in theory – are taken out of the “read” part of the circuit.
If we turn PORTB into an output and make the entire PORTB high, capacitors C5-C8 should begin to charge and only coils L5-L8 have a ground connected to them (capacitors C1-C4 and coils L1-L4 have no ground connection and should not be affected). Now let’s concentrate on just C5/L5:
If we make all of PORTB an input, C5 should begin to discharge. But there’s nothing stopping it discharging through coils L6-L8 as well as (or instead of?) L5. But if we make ONLY PORTB.0 an input, C5 should only be able to discharge through L5 (since L6-L8 has power still connected to the “right-hand” side of the circuit). So we should be able to read the time taken for the current to oscillate through L5 and use this to determine whether or not a metallic object is interrupting the magnetic field of L5.
We then turn PORTB.0 to a high output pin and turn PORTB.1 to an input pin and repeat for L6. After reading L6, we should be able to read L7 and L8 in a similar fashion.
Now presuming all this actually works, we should be able to adjust the output from our shift register, to make Q0 high and send Q1 low (keeping Q2-Q8 high). This in turn provides a ground connection for the right-most “column” of sensors only. By repeating the reading process, we should be able to detect the presence of metal objects above L1-L4.
At this stage, it’s all supposition and makes a lot of assumptions. But there’s only one way to find out if this will actually work – and that’s to make up a PCB and give it a try!