ST AN2927 Application note

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
2
I
C/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
C
εRε0A
d
--------------- -=
V
IN
V
OUT
R
C
V
IN
V
OUT
t
C
V
TH

1 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 (ε between the two electrodes (d). The capacitance value is summarized with the formula:
Equation 1

Figure 1. Voltage applied on an RC network

), the relative permittivity of air (ε0) and the distance
R
A fixed voltage is applied on V
. The V
IN
voltage increases or decreases proportionally to
OUT
the capacitance value as shown in Figure 2.

Figure 2. Measuring the charge time

The capacitance value (C) is calculated by measuring the charge time (t requires to reach the threshold V
TH
.
) the V
C
OUT
voltage
In touch sensing applications, the capacitance value (C) is the addition of a fixed capacitance (electrode capacitance, C (touch capacitance, C
) when it touches or is close to the electrode. The electrode
T
) and the capacitance added by the human finger
X
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
V
IN
V
OUT
t1
No touch
V
IN
V
OUT
t2
Human touch: the overall capacitance increases (t2 > t1)

Figure 3. Touch acquisition

This is the basic principle used in the acquisition layer of the touch sensing library to detect a human touch.
4/12
Loading...
+ 8 hidden pages