Beruflich Dokumente
Kultur Dokumente
c
0
I chose QMatrix technology as a basis for my experiment, mostly because I've
heard about it before and because I liked their whitepaper, which I really
recommend to read, here: QMatrix̻ Technology White Paper. The point is to
transfer the charge through the sensor capacitance to a tank capacitor
gradually, until a charge sufficiently large to be measured builds up. cfter that,
a current is applied to the tank capacitor and the time that it takes to reach
zero crossing is measured. When sensor surface is being touched, the fingers
steal part of the charge to be dissipated by the body and less of it gets
transferred to the tank capacitor. This difference can be measured and tried to
tell if a button is being touched or not.
ir uit
Iitisr th urrths th
s|ttth|ri
sitith us sssthruh
hrs
titt
it#wiwswit h|ri t$#%th hrwiw th
s thitwi tht swhrthtiri urrt
wt |tt s|t tis urithtti hr
w&t trthis sthtiri usth r ssis
r tth hr
tuisu his r ssisiustrtth
riht rtthir?
Same technique easily scales up to a matrix. Drive lines will be call ed ù, sense
lines are .
I chose an cTmega8 @16MHz as the test platform. Initially a 5×4 matrix was
planned but, the usual, overlooked this and that, it ended up a a 4×3 matrix,
which I still consider a success. So what is this stuff that lets us implement this
in cV+
There's a little problem however. cll cV inputs are protected from
overvoltage by the internal Shottky diodes which have very low bandgap of
0.2V. This puts a serious constraint on the design: |Ë | should be not
above 0.2V, or nothing will work out at all.
cll that remains by this point is to design the circuit and choose the pins/ports
wisely. The inputs leave no hesitation: they should be chosen from the analog
inputs. Driving pins can be just any pins. It's better to avoid using input
capture pin (ICP1) for any purpose at all.
The PCB is probably a requirement for a project like this. or layout guidelines
refer to QMatrix whitepaper. Normally it will be 1 -sided fiberglass board, the
"keys" will be no less than 10mm across, the outer electrodes are the driving
ones, X, and their thickness is approximately that of the fiberglass. The
reverse, business end side, should be empty.
·
The firmware self-calibrates upon startup: this is necessary to mark the
baseline of every button. Unlike regular buttons, the characteristics of every
sensor area can differ significantly depending on geometry or mutual placing
of other components. During the calibration, the measured value is sam pled 4-
16 times and averaged to minimize randomness.
cn option to calculate the time of the charging burst is included, but not
enabled by default. xperiments show that saturation of the tank capacitor is
not as important as baseline estimation.
c touch is detected when the discharge time is 10% shorter than the
calibrated baseline. Depending on the conditions, to improve reliability or to
reduce interference impact this criteria can be changed to some 20 -25%.
cdditional debouncing algorithm is also implemented for the cases when
touch sensitivity is marginal.
MGc8 SNSO KYBOcD
The result is a success. c reliable 4×3 sensor matrix is implemented. c larger
matrix was planned but didn't wo rk out because: a) I didn't remember that
two upper analog inputs on cTmega8 can't be used as digital i/o and b) the
ICP1 pin, which I planned to use to drive an extra X line, causes some sort of
interference if used in a fast switching design like this. ?
0.2V is sufficient to reliably detect a touch not only to the back of the
fiberglass, but also with added ~1mm sheet of plastic with a layer of some
black film inbetween. Some materials do not work well: e.g. a plastic package
from a C card didn't work at all, probably due to antistatic treatment. c
compact disc jewel case works perfectly. Dielectric layers should be pressed
as tightly as possible from the empty side of the PCB. ?
The amount of keys can be raised to e.g. 8×8 easily, given that the used
controller has enough pins. However it should be remembered that scanning
time increases with the number of keys. Some optimizations can be made to
improve scan time: e.g. parts of code can be rewritten in assembly and charge
bursts can be reduced to shorter times. It should not be a problem to
implement similar circuit with a builtin C oscillator, too.