AN2927
Application note
RC acquisition principle for touch sensing applications
Introduction
In applications requiring user interface, capacitive touch-sensitive controls are becoming the solution of choice to replace conventional electro-mechanical switches.
STMicroelectronics has developed a complete touch-sensing software library to transform any 8-bit STM8 microcontroller into a capacitive touchkey controller. For more details, please go to www.st.com/mcu
This touch sensing software library allows to detect human touch by controlling the charge/discharge timing cycle of a RC network formed by a single resistor and the touch electrode capacitance. Any variation in the RC timing due to the electrode capacity change is detected then filtered and eventually reported to a host system using dedicated I/Os or I2C/SPI interface.
The bill of material is low-cost as only one resistor is needed per touch channel to enable this function.
The scope of this application note is to describe the RC time constant acquisition principle used in the touch sensing software library.
Abbreviations
Table 1. |
List of terms |
|
Acronym |
Description |
|
|
|
|
EMI |
|
Electromagnetic interference |
|
|
|
RC |
|
Resistor–capacitor |
|
|
|
TS Library |
|
ST touch sensing firmware library |
|
|
|
March 2009 |
Rev 2 |
1/12 |
www.st.com
Contents |
AN2927 |
|
|
Contents
1 |
RC acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
3 |
|
2 |
Hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
5 |
|
3 |
Firmware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
6 |
|
|
3.1 |
Charge Time measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
6 |
3.1.1 Basic measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 Oversampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Input voltage measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.3 Touched effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4 Multi-acquisitions and HF noise rejection . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 |
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
11 |
2/12
AN2927 |
RC acquisition principle |
|
|
The RC acquisition method is used to detect the human touch of any capacitive touch sensor (key, wheel or slider) by measuring the small variation of the touch electrode capacitance (C).
Electrode capacitance C is periodically charged and discharged through a fixed resistor (R).
The capacitance value depends on the following parameters: electrode area (A), relative dielectric constant of the insulator (εR), the relative permittivity of air (ε0) and the distance between the two electrodes (d). The capacitance value is summarized with the formula:
Equation 1
C εRε0A
= ---------------
d
|
|
|
R |
|
|||||
|
|
|
|
|
|
|
|
|
|
VIN |
|
|
C |
|
|
|
|
VOUT |
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
||||
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A fixed voltage is applied on VIN. The VOUT voltage increases or decreases proportionally to the capacitance value as shown in Figure 2.
VOUT |
VTH |
VIN |
tC |
The capacitance value (C) is calculated by measuring the charge time (tC) the VOUT voltage requires to reach the threshold VTH.
In touch sensing applications, the capacitance value (C) is the addition of a fixed capacitance (electrode capacitance, CX) and the capacitance added by the human finger (touch capacitance, CT) when it touches or is close to the electrode. The electrode capacitance must be kept as low as possible to ensure touch detection which is only a variation of a few picofarads (typically 5pF).
Using this acquisition principle, it is possible to determine if a finger is “touching” the electrode or not.
3/12
RC acquisition principle |
AN2927 |
|
|
No touch
VOUT
VIN
t1
Human touch: the overall capacitance increases (t2 > t1)
VOUT
VIN
t2
This is the basic principle used in the acquisition layer of the touch sensing library to detect a human touch.
4/12