Sunteți pe pagina 1din 4

The art of capacitive touch sensing

By Mark Lee
Sr. Application Engineer
Cypress Semiconductor Corp.

Touch sensors have been around


for years. But recent advances in
mixed-signal programmable de-
vices are making capacitance-
based touch sensors a practical
and value-added alternative to
mechanical switches in many
consumer products.
Typical capacitive sensor
designs specify an overlay of
3mm or less. Sensing a finger
through an overlay becomes
increasingly more difficult as
the overlay thickness increases.
In other words, as the over-
lay thickness increases, the Figure 3: A simplified circuit diagram of a relaxation oscillator.
process of tuning the system
moves from science to art. To

Sensor
Ground

Figure 1: A PCB implements a Figure 4: The output of the comparator is fed into the clock input of a PWM circuit, which gates a 16bit counter
capacitive sensor button. clocked at 24MHz.

demonstrate how to make a rect application in so-called The conductive property of charge storage capacity added
capacitive sensor that pushes “white goods” (household fingers makes capacitive touch by the finger is known as finger
the limits of today’s technol- appliances). sensing possible. capacitance (CF). The capaci-
ogy, the thickness of the glass At the heart of any capaci- A simple parallel plate ca- tance of the sensor without a
overlay in this example is set tive-sensing system is a set of pacitor has two conductors finger present is denoted as
at 10mm. Glass is easy to work conductors interacting with separated by a dielectric layer. CP, which stands for parasitic
with, readily available and electric fields. The tissue of the Most of the energy in this system capacitance.
transparent. Hence, one can human body is filled with con- is concentrated directly between A common misconception
see the underlying sensor pads. ductive electrolytes covered by the plates. Some of the energy about capacitive sensors is that
Glass overlays also have di- a layer of skin, a lossy dielectric. spills over into the area outside the finger needs to be grounded
the plates, and the electric field for the system to work. A finger
lines associated with this effect can be sensed because it can
are called fringing fields. Part of hold a charge, and this oc-
the challenge of making a practi- curs if the finger is floating or
cal capacitive sensor is to design grounded.
a set of printed circuit traces
which direct fringing fields into Sensor’s PCB layout
an active sensing area accessible Figure 1 shows the top view of a
to a user. A parallel plate capaci- PCB that implements one of the
tor is not a good choice for such capacitive sensor buttons in this
a sensor pattern. design example.
Placing a finger near fring- The button diameter is
ing electric fields adds con- 10mm, the average size of an
ductive surface area to the ca- adult fingertip. The PCB as-
Figure 2: A via in the PCB connects the sensor pad to the trace. pacitive system. The additional sembled for this demonstration
Button Pin Port +5V

0 9 P2[1]
1 8 P2[3] 0.1µF

2 7 P[5] VDD
C1+
3 6 P[7] 1µF T1_OUT 2
C1-
+5V

C1+ 5
0.1µF 1µF C1-
DB9-F
Button0 VDD
P2[7] P0[1]
TX8
Button1 VS+ VSS VS-
+5V
P2[5]
CY8C21434
Button2 1µF 1µF
P2[3]
P2[3] SDA
Button3 SCL
P2[1] P1[1]
VSS
ISSP

Figure 5: For capacitive sensing and serial communication, the circuit uses a Cypress CY8C21x34 series PSoC IC that contains analog and digital func-
tional blocks configured by firmware stored in on-board flash memory.

circuit contains four buttons of glass overlay. Figure 2 shows has an εr of about 5. In this de- presented in this article. A sim-
with centers spaced 20mm a cross-sectional view of the sign example, standard window plified circuit diagram of this
apart. The ground plane is also same sensor pattern. glass is used. Note that the glass oscillator is shown in Figure 3.
on the top layer. The sensor A via in the PCB connects sheet is mounted on the PCB us- The output of the compara-
pad is isolated from the ground the sensor pad to the trace on ing the nonconductive adhesive tor is fed into the clock input of
plane by a uniform gap. The the bottom side of the board. film 468-MP from 3M. a pulse width modulator circuit,
size of the gap is an impor- The dielectric constant, εr, in- which gates a 16bit counter
tant design parameter. If the fluences how tightly the electric Basic components clocked at 24MHz. A finger
gap is set too small, too much field energy can pack into the The fundamental components on the sensor increases the
field energy will go directly to material as the field tries to find of a capacitive sensing system capacitance, thus increasing
ground. If set too large, control the shortest path to ground. are a programmable current the counts. This is how a finger
is lost over how the energy is Standard window glass has an source, a precision analog com- is sensed. Typical waveforms
directed through the overlay. ε r of about 8, while the FR4 parator and an analog mux bus for this system are shown in
The selected gap size of 0.5mm material of the PCB has an εr of that can sequence through an Figure 4.
works well for directing the about 4. Pyrex glass, which is array of capacitive sensors. A re- A schematic for an imple-
fringing fields through 10mm commonly used in white goods, laxation oscillator works as the mentation of this project is
capacitance sensor in the system shown in Figure 5.

Figure 6: The hysteresis in the transfer function provides clean transitions Figure 7: Setting of the threshold levels determines the performance of
between on and off states even though the counts are noisy. the system. With very thick overlays, the SNR is low.
7, along with the threshold
levels.
The noise threshold is set
to 10 counts, and the finger
threshold is set to 60 counts.
The noise component that is
always present in real-count
data is not shown in Figure 7,
so that the threshold levels can
be seen clearly.
Part of the tuning process in-
cludes selecting the level of the
current source DAC and setting
the number of oscillator cycles
to accumulate counts. The
firmware sets current source
to level 200 out of 255, which
in low range of current source,
Figure 8: The difference counts were captured on the host PC via a terminal emulation program and then plotted. is about 14µA. It also sets the
number of oscillator cycles to
For capacitive sensing and Tuning the sensor even though the baseline may 253. Analysis of the raw counts
serial communication, the Ever y time the “start scan” be drifting over time. Figure and difference counts shows
circuit uses a Cypress CY- function is called in the applica- 6 shows the transfer function that the system has a parasitic
8C21x34 series programmable tion program, the capacitance between difference counts and trace CP of around 15pF and a
SoC IC that contains a set of of Button1 is measured. The raw button state that is implemented CF of about 0.5pF. The finger
analog and digital functional count values are stored in an ar- in firmware. changes the total capacitance
blocks. These blocks are con- ray. The user module also tracks The hysteresis in this trans- by about 3 percent. Acquisition
figured by firmware stored a baseline for the raw counts. fer function provides clean of each raw count value only
in on-board flash memory. The baseline value of each but- transitions between on and off takes 500µs per button.
A second IC handles RS-232 ton is an average raw count level states, even though the counts
level-shifting to provide a computed periodically by an are noisy. This provides a de- Measured performance
communications link to a host infinite impulse response (IIR) bounce function for the but- The measured performance of
computer, enabling data log- filter in software. The update tons. The lower threshold is the capacitive sensing system is
ging of capacitive sensing data rate for the IIR filter is program- called the noise threshold, and shown in Figure 8.
at 115,200baud. The pin as- mable. The baseline enables the the upper threshold is called The difference counts were
signments for the four capaci- system to adapt to drift in the the finger threshold. Setting of captured on the host PC via a
tive sensing buttons are shown system due to temperature and the threshold levels determines terminal emulation program
in Figure 5. The program- other environmental effects. the performance of the system. and then plotted using a spread-
mable SoC is programmed A switch-difference array con- With very thick overlays, the sheet. The finger is placed on
through the ISSP header that tains the raw count values with SNR is low. Setting the thresh- the 10mm thick glass overlay
contains power, ground, and the baseline offset removed. old levels in this kind of system for 3s. The on/off state of the
the programming pins SCL and The current on/off state of the is challenging. This is part of buttons is superimposed on the
SDA, while the host PC con- buttons is determined using the art of capacitive sensing. raw counts. The button moves
nects to the capacitive sense the switch difference values. An idealized raw counts cleanly between states, even
board through a standard DB9 This allows the performance of waveform for a three-second with the relatively noisy raw-
connector. the system to remain constant button press is shown in Figure counts signal produced by the

Figure 9: The first sample of the difference count over the finger threshold Figure 10: The button makes a transition to the off state with the first
switches the button state to on. sample of the difference count below the noise threshold.
sensing through the thick glass. is initially off. The first sample is that capacitance-based touch ity. Using the design techniques
Note how the finger and button of the difference count over the sensors don’t wear out through presented here, it is possible
thresholds are adjusted peri- finger threshold switches the long-term use. Recent advanc- to sense a finger press through
odically as the baseline drifts. button state to on. In Figure es in mixed-signal technol- 10mm of glass, and achieve
When a finger press is sensed, 10, the button makes a transi- ogy have not only made touch clean transitions between on
the baseline value locks its value tion to the off state with the first sensor implementations in and off button states using the
until the finger is removed. sample of the difference count consumer products cost-effec- debounce method based on
Figures 9 and 10 show below the noise threshold. tive, but also enabled higher noise and finger thresholds,
detailed views of each state The primary advantage of sensitivity and reliability of making capacitive touch sen-
transition. capacitance-based touch sen- sensing circuits to increase sors a practical alternative to
In Figure 9, the button state sors over mechanical switches overlay thickness and durabil- mechanical components.

S-ar putea să vă placă și