ST AN2869 APPLICATION NOTE

AN2869
Application note
Guidelines for designing touch sensing applications
Introduction
This application note describes the layout and mechanical design guidelines used for touch sensing applications.
Capacitive sensing interfaces provide many advantages compared to mechanical user interfaces. They:
offer a modern look and feel
are easy to clean
are waterproof
are robust
Capacitive sensing interfaces are more and more used in a wide range of applications. The main difficulty designing such interfaces is to ensure that none of the items interfere
with each other. This document provides simple guidelines covering three main aspects:
1. Printed circuit board (PCB)
2. Overlay and panel materials
3. All other items in the capacitive sensor environment Depending on which application you are designing, you may not need to refer to all of the
contents of this document. You can go to the appropriate section after reading the common part which contains the main capacitive sensing guidelines. For example, if you are developing an application with only projected electrode, you should first read the main capacitive sensing guidelines and then go through the sections giving specific recommendations for projected electrode designs.
Ta bl e 1 lists the microcontrollers concerned by this application note.

Table 1. Applicable products

Type Applicable products
Proximity and touchkey microcontrollers STM8A automotive microcontrollers STM8L ultra-low-power microcontrollers
Product family
STM8S mainstream microcontrollers STM8T touch-sensing microcontrollers STM32 F0 entry-level Cortex™-M0 microcontrollers STM32 L1 ultra-low-power ARM Cortex™-M3 based microcontrollers
May 2012 Doc ID 15298 Rev 6 1/43
www.st.com
Contents AN2869
Contents
1 Capacitive sensing technology in ST . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 RC acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Charge transfer
1.3 Surface ProxSense
1.4 Projected ProxSense
1.5 Surface capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Projected capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Main capacitive sensing guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 Substrates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
TM
acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . 5
TM
acquisition principle . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 Electrode and interconnection materials . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.3 Panel materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4 Mechanical construction and PCB to panel bonding . . . . . . . . . . . . . . . 13
2.2.5 Metal chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.6 Air gap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.7 Transfer of an electrode from PCB to the front panel . . . . . . . . . . . . . . . 14
2.3 Placing of LEDs close to sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3 Surface electrode design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 Touchkey sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Touchkey matrix sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3 Linear sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.1 Normal patterned linear sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.2 Interlaced linear sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4 Rotary sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4.1 Normal patterned rotary sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4.2 Interlaced patterned rotary sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4.3 Rotary sensor with central touchkey . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.5 Specific recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5.1 LEDs and sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2/43 Doc ID 15298 Rev 6
AN2869 Contents
3.5.2 Driven shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5.3 Using electrodes separated from the PCB . . . . . . . . . . . . . . . . . . . . . . 28
3.5.4 PCB and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.5.5 Component placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5.6 Ground considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5.7 Rotary and linear sensor recommendations . . . . . . . . . . . . . . . . . . . . . 32
4 Projected sensor design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1 Touchkey sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1.1 Diamond type sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.1.2 H sensor single layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.1.3 H type sensor two layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.2 Linear sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3 Rotary sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.4 Specific recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.4.1 PCB and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Doc ID 15298 Rev 6 3/43
List of figures AN2869
List of figures
Figure 1. Equivalent touch sensing capacitances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 2. Example of capacitive sensor construction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 3. Clear ITO on PET with silver connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 4. Silver printing on PET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 5. Flexible PCB (FPC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 6. FR4 (2-sided epoxy-fiberglass). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 7. Typical panel stack-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 8. Examples of cases where a LED bypass capacitor is required . . . . . . . . . . . . . . . . . . . . . 15
Figure 9. Typical power supply schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 10. Sensor size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 11. Recommended electrode size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 12. Simple matrix implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 13. Normal patterned linear sensor with five electrodes (20-50 mm long) . . . . . . . . . . . . . . . . 20
Figure 14. Interlaced linear touch sensor with three elements (up to 60 mm long) . . . . . . . . . . . . . . . 21
Figure 15. Normal patterned rotary sensor (three electrodes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 16. Interlaced patterned rotary sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 17. Back-lighting touchkey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 18. STM8T141 driven shield solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 19. Simple driven shield using RC acquisition principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 20. STM8L1xx driven shield example using the charge-transfer acquisition principle . . . . . . . 26
Figure 21. STM32L driven shield example using the charge-transfer acquisition principle . . . . . . . . . 27
Figure 22. Printed electrode method showing several connection methods . . . . . . . . . . . . . . . . . . . . 28
Figure 23. Spring and foam picture (both are not compressed) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 24. Track routing recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 25. Ground plane example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 26. Hatched ground and signal tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 27. Electric field between 2 surface electrodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 28. Diamond implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 29. H sensor (single layer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 30. Two-layer implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 31. Normal linear sensor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 32. Small linear sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 33. Rotary sensor made of 5 parcels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Figure 34. Ground floods around Tx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 35. Potential false key detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4/43 Doc ID 15298 Rev 6
AN2869 Capacitive sensing technology in ST

1 Capacitive sensing technology in ST

STMicroelectronics offers different capacitive sensing technologies for STM8 and STM32 family products. These technologies are based on:
The RC acquisition principle for STM8A, STM8S and STM8L microcontrollers.
The charge transfer acquisition principle for STM8L, STM32 F0 and STM32 L1
microcontrollers.
The surface ProxSense
The projected ProxSense
Note: ProxSense™ is a trademark of Azoteq.

1.1 RC acquisition principle

The RC acquisition principle is based on the charging/discharging time measurement of an electrode capacitance through a resistor. When the electrode is touched, the charging/discharging time increases and the variation is used to detect the finger proximity. The RC acquisition principle is detailed in AN2927.
TM
acquisition principle for STM8T14x microcontrollers.
TM
acquisition principle for STM8TL5x microcontrollers.

1.2 Charge transfer acquisition principle

The charge transfer acquisition principle uses the electrical properties of the capacitor charge (Q). The electrode capacitance is repeatedly charged and then discharged in a sampling capacitor until the voltage on the sampling capacitor reaches a given threshold. The number of transfers required to reach the threshold is a representation of the size of the electrode’s capacitance. When the electrode is “touched”, the charge stored on the electrode is higher and the number of cycles needed to charge the sampling capacitor decreases.
1.3 Surface ProxSense
The surface ProxSenseTM acquisition principle is similar to the charge transfer one, except that the acquisition is fully managed by a dedicated hardware IP providing improved performance. For more information, please refer to the application note AN2970.
1.4 Projected ProxSense
The projected ProxSenseTM acquisition principle is a measurement of a charge transferred by a driven electrode to another one. Like the charge transfer, there is also a sampling capacitor which stores the charges coming from the electrodes which form a coupling capacitor with less capacitance than the sample one. When a finger approaches, the dielectric (between the two electrodes) is modified and so the capacitance decreases. As a consequence, the time taken to load the sample capacitor will increase and this difference is used to detect if a finger is present or not.
TM
acquisition principle
TM
acquisition principle
Doc ID 15298 Rev 6 5/43
Capacitive sensing technology in ST AN2869
Application
Electrode
C
X
C
T
C
F
Earth
Application ground
ai15083
V
SS
CH

1.5 Surface capacitance

A capacitance is modified when a finger gets close to a sensing electrode. The return path goes either through:
a capacitor to ground through the user’s feet
a capacitor between the user’s hand and the device
a capacitor between the user’s body and the application board through the air (like an
antenna)
Background

Figure 1. Equivalent touch sensing capacitances

C
is the parasitic capacitance of the electrode.
X
C
is composed of two capacitances: the first one refers to earth, which is not significant
X
and can be ignored, and the second one refers to the application ground, which is dependent on the PCB or the board layout. This latter parasitic capacitance includes the GPIO pad capacitance and the coupling between the electrode tracks and the application ground.
The PCB and board layout must be designed to minimize this parasitic capacitance. C
is the feedback capacitance between earth and the application. Its influence is important
F
in surface capacitance touch sensing applications, especially for applications which do not feature a direct connection to earth.
6/43 Doc ID 15298 Rev 6
C
is the capacitance created by a finger touch and it is the source of the useful signal. Its
T
reference is earth and not the application ground. The total capacitance measured is a combination of C
meaningful for the application. So we measure C by the formula: C
+ 1 / ((1 / CT) + (1 / CF)).
X
, CF and CT where only CT is
X
plus CT in parallel with CF, which is given
X
AN2869 Capacitive sensing technology in ST

1.6 Projected capacitance

A capacitor is modified when the finger gets close to a sensing electrode. The finger changes the dielectric properties.
The sensor consists of two electrodes:
Tx driven by a port in Output mode,
Rx in the return path to a dedicated port in Read mode.
Doc ID 15298 Rev 6 7/43
Main capacitive sensing guidelines AN2869
MS18973V1
Glass/plexiglass panel
Silkscreen printing
Copper pad (Cu)
electrode
Fiberglass PCB

2 Main capacitive sensing guidelines

2.1 Overview

A surface or projected capacitive sensor is generally made up of the following different layers:
A fiberglass PCB
A set of electrodes made of a copper pad
A panel made of glass, Plexiglas, or any non-conductive material
A silk screen printing

Figure 2. Example of capacitive sensor construction

2.2 Construction

2.2.1 Substrates

The substrate is the base material carrying the electrodes. A substrate can be chosen among any non-conductive material, in practice, PCB materials
(e.g. FR4, CEM-1), acrylics like Polyethylene Terephthalate (PET), or Polycarbonate can be used. Glass is also an excellent material for this purpose.
Note: For the projected materials (technologies) listed above, it is not recommended to use a
8/43 Doc ID 15298 Rev 6
relative permittivity (
ε
) that is too high.
R
In many cases, the substrate which is used in electronic application will also work well for capacitive sensing. Special care is required to avoid materials which can retain water contained in the atmosphere (e.g. hygroscopic material such as paper based). Unfortunately, this would modify
ε
(relative permittivity) with environmental conditions.
R
AN2869 Main capacitive sensing guidelines
It is not recommended to directly set the substrate against the front panel without gluing it by pressure or by bonding. Some moisture or air bubbles can appear between them and cause a change on the sensitivity. Indeed, if the substrate and the panel are closely linked together this will avoid a varying sensitivity loss which is hard to predict (when the air bubbles are greater than 2 mm diameter). Hence, the way used is to strongly glue them all mechanically or with a suitable bonding material.
It is possible to construct sensors that do not rely on a substrate. These are described in this document under separate sections (Section 2.2.7, Section 3.5.3 and Chapter 4.4.1).

2.2.2 Electrode and interconnection materials

Generally, an electrode is made with the following materials: copper, carbon, silver ink, Orgacon
TM
or Indium Tin Oxyde (ITO).
The resistance to electric current of a material is measured in ohm-meters (Ωm). The lower this degree of resistivity the better, as well as a good RC time constant. That is why interconnections will be made with low Ωm material. e.g. a printed silver track at 15.9 nΩm that is 100 mm long, 0.5 mm wide and 0.1 mm thick (so the area is 0.05 mm²) will have a resistance of 32 µΩ.
About metal deposition, another well-known approach is to consider the Ω/
(a)
of a material. For instance, you can compare silver and ITO (which is about 10 times greater) and deduce which material is well suited for the connections.
Figure 3. Clear ITO on PET with silver connections
a. Pronounced “Ohms per square” and also called sheet resistance; if you know this constant (given by the
manufacturer) and how many squares are put in series, you can deduce the overall resistance of the line.
Doc ID 15298 Rev 6 9/43
Main capacitive sensing guidelines AN2869
Figure 4. Silver printing on PET
More and more applications need a flex PCB or FFC/FPC
(b)
to interconnect circuitry; it is suitable, provided that the overall application is mechanically stable. Furthermore, the FPC tracks will be part of the touch sensor. So if the flex moves a little bit, even a few micrometers, the capacitance to its surroundings will definitely change and might be significant, causing false touch detections or drops in sensitivity. Putting the flex in close proximity to a metal chassis or other signals, or on top of noisy circuitry, can cause problems as well (loss of sensitivity or spurious detection).
Table 2. Potential application problems with flex PCB placement
When the flex PCB is in close proximity to... ...the following can occur.
...the ground or to a metal chassis connected to the ground.
... a floating metal object or to a floating metal chassis
... a source of noise
...the sensitivity is reduced.
... the object or the chassis conducts the touch to the electrode
... the acquisition will be strongly perturbed and so the touchkey will become non-usable
b. FFC = Flat Flexible Conductor, FPC = Flexible Printed Circuit
10/43 Doc ID 15298 Rev 6
AN2869 Main capacitive sensing guidelines
Figure 5. Flexible PCB (FPC)
Figure 6. FR4 (2-sided epoxy-fiberglass)

2.2.3 Panel materials

You can choose the panel material which best suits your application. This panel material MUST NOT be conductive. The material characteristics impact the sensor performance, particularly the sensitivity.
Dielectric constant
The panel is the main item of the capacitor dielectric between the finger and the electrode. Its dielectric constant ( propagation of the electric field inside the material is given by this parameter. The higher the dielectric constant, the better the propagation.
Glass has a higher
materials used in a panel construction). Higher numbers mean that the fields will propagate
through more effectively. Thus a 5 mm panel with an sensitivity to a 2.5 mm panel with a relative epsilon of 4, all other factors being equal.
A plastic panel up to 10 mm thick is quite usable, depending on key spacing and size. The circuit sensitivity needs to be adjusted during development to compensate for panel thickness, dielectric constant and electrode size.
The thicker a given material is, the worse the SNR. For this reason, it is always better to try and reduce the thickness of the front panel material. Materials with high relative dielectric constants are also preferable for front panels as they help to increase SNR.
ε
) differentiates a material when it is placed in an electric field. The
R
ε
than most plastics (see Table 3: Dielectric constants of common
R
ε
of 8 will perform similarly in
R
Doc ID 15298 Rev 6 11/43
Main capacitive sensing guidelines AN2869
T
V
t
ε
R
----- -=
T
VSTACK()TV layers()
=
Table 3. Dielectric constants of common materials used in a panel construction
Material
Air 1.00059
Glass 4 to 10
Sapphire glass 9 to 11
Mica 4 to 8
Nylon 3
Plexiglass 3.4
Polyethylene 2.2
Polystyrene 2.56
Polyethylene terephthalate (PET) 3.7
FR4 (fiberglass + epoxy) 4.2
PMMA (Poly methyl methacrylate) 2.6 to 4
Typical PSA 2.0 - 3.0 (approx.)
ε
R
Sensitivity
A useful parameter to consider with panel material and thickness (T) is the electric field equivalent vacuum thickness T
Equation 1
where t is the thickness of the dielectric. T
is the thickness of vacuum with an electric field conduction equivalent to that of the
V
material. The smaller it is, the easier the field can reach through. Panels with the same T make keys with identical sensitivity. This works for both directions of course and may be used to evaluate the touch sensitivity from the back side of the application.
For a panel built from a stack of different materials, it is possible to add the vacuum equivalent thickness of each layer:
Equation 2
Each material has an influence on the sensitivity. So the equation can be used when, for example, the electrodes are on the bottom surface of the PCB substrate, then the thickness and
ε
of the substrate will be also factors of the global sensitivity.
R
.
V
V
12/43 Doc ID 15298 Rev 6
AN2869 Main capacitive sensing guidelines
MS18974V1
Non-conductive panel
PCB
OR
Pressure-sensitive adhesive (PSA)
e.g. 3M467
Copper electrode

2.2.4 Mechanical construction and PCB to panel bonding

In order to ensure stable touch detection, the PCB must always be at the same place on the panel. The slightest variation, even as small as 100 microns, may lead to differences in the signal which can be detected. This must be avoided to ensure the integrity of the touch detection. The panel and other elements of the device must not be moved, or only as little as possible, by the user’s finger. To avoid this kind of problem, glue, compression, co-convex surfaces can be used to mechanically stabilize the PCB and the panel very close together.
In the list of the different ways to achieve this, we can put: heat staking plastic posts, screws, ultrasonic welding, spring clips, non-conductive foam rubber pressing from behind, etc.
Figure 7. Typical panel stack-up
Normal construction is to glue a sensor to a front panel with Pressure Sensitive Adhesive (PSA). 3M467 or 468 PSAs work very well.
Doc ID 15298 Rev 6 13/43
Loading...
+ 30 hidden pages