Touch pins through multiplexer

Status
Not open for further replies.

dimaugh

Member
Hi there!

I want to build a musical keyboard with around 300 hundred keys using the touch pins. Obviously, I'm gonna need some multiplexer. I ran some tests on the classic 74HC4067, but the base level (value read when the key is not being pressed) goes up to 3000, and the reading take much longer. Now, I'm gonna guess the touch pins work by sending some voltage to the key (whatever is soldered to the pin) until it's capacitance is full, like measuring the time it takes for a capacitor to charge. The 74HC4067 has an internal resistance of around 250 Ohms in an open channel, which is probably what is slowing down so much the time the key takes to charge. Is this right?

Now, the question is:
a) can we somehow use a higher voltage on the touch pins so that the key charges up faster, despite the resistance?
b) is there any other multiplexer similar to the 74HC4067, but with a lower internal resistance? I found one, but it was too small to solder by hand.
c) can the circuit behind the touch pins be easily replicated?
 
Tiny mistake (apparently I can't edit the post), the 74HC4067 ON resistance is only 80 Ohms. Still, I think that's what's slowing down the readings so much.
 
In opposite to "classic" touch behavior as seen for example on AVR and PIC cpus where simply the pulse delay of a RC combination (R fixed, C varying depending on touch) is measured, the Teensy touch engine (TSI) is ways more precise, sensitive and complex. It works basically with 2 oscillators, a reference oscillator and a variable oscillator in parallel to eliminate temperature drift. These oscillators are switched constant current sources to measure the charge and uncharge time of a capacitor, which is an internal 1pF capacitor for the reference oscillator and which is the capacitance seen at the touch pin for the variable oscillator.

Charging and uncharging a capacitor with constant current means that a series resistance has nothing to do in such a circuit because there will be a constant voltage drop or offset (current x resistance) which will prevent the oscillator from working properly since the upper and lower voltage thresholds responsible for switching from charge cycle to uncharge cycle and vice versa will not longer reflect the "true" charge of the capacitor, but will reached too early or not at all due to that voltage offset.

Thus, multiplexing TSI pins with simple CMOS switches is basically a bad idea. Not only because of the resistance itself, but that resistance varies with the voltage which makes the result still less predictable.

If I had to build a device with so many touch keys, I'd rather go for specialized multichannel touch ICs, something like the Atmel AT42QT264 which can handle 64 touch keys in a matrix, and use 5 of these, all interfaced via 4MHz SPI to the Teensy.
 
Thank you so much for your answer!

Do you have any link where the mechanism for the touch pins in the Teensy (or any similar mechanism on the same principle, with two oscillators) is explained at length? I'd like to get a better grasp at the theory.

As for the AT42QT264, I fear the pins are a bit too small to be soldered by hand. Is there any alternative with less touch keys and a bigger package? I could interface many with one or several Teensies connected to a master Teensy, or some other board.
Also, are those keys sensitive? I mean, some chips offer On/Off capacitive switches, detecting only if a threshold is surpassed, but I'm after something like the Teensy touch pins, giving me a nuanced, precise value.
 
I don‘t think that these touch matrix ICs are sensitive. They most probably do only on-off. Since you didn‘t tell more details about your project, I guessed from the „around 300“ that you were building an organ with 3 manuals, pedal and about 80 stop switches, where a simple on off function would be sufficient.

The KINETIS TSI engine is described in the MK20DX256 reference manual, available on the PJRC website. Teensy - Reference - Datasheet. If I remember correctly, it’s one of the last chapters.

... And these IC packages can be soldered by hand. The spacing is 40 pins per inch which can be hand soldered, using magnifier glasses (12€ at Amazon)
 
Yes, that's the thing. I could, however, multiplex the ON pins instead of the signal pin, but it still would be incredibly messy, long cables from each key to the teensy and back, an insane lot of soldering work... I think I'm just gonna go for some Velostat and doing normal analogReads. Not so elegant, but less noisy after all.
 
Status
Not open for further replies.
Back
Top