Application note

How to choose the sampling capacitor for touch sensing applications on STM32 MCUs

Rev 8 - February 2025

Introduction

Capacitors feature some non-ideal characteristics that unfortunately limit their use in some applications. The objective of this document is to help designers in selecting the right sampling capacitor (CS) for their touch sensing applications by investigating the most important undesirable characteristics.

STMicroelectronics is providing free STMTouch touch sensing firmware libraries, directly integrated into the corresponding STM32Cube package (such as STM32CubeL4).

Table 1. Applicable products
TypeProduct series
Microcontrollers
  • STM32F0 series, STM32F3 series
  • STM32L0 series, STM32L1 series, STM32L4 series, STM32L4+ series, STM32L5 series
  • STM32U0 series, STM32U3 series, STM32U5 series
  • STM32WB series, STM32WBA series

Charge transfer acquisition principle overview

An MCU-based touch sensing applications may use the charge transfer acquisition principle, supported by STMTouch touch sensing libraries, to sense changes in capacitance. The electrode capacitance (CX) is charged to a stable reference voltage (VDD for general purpose Arm®-based STM32 microcontrollers). The charge is then transferred to a known capacitor referred to as the sampling capacitor CS. This sequence is repeated until the voltage on CS reaches the internal reference voltage VIH. The number of transfers required to reach the threshold depends on the size of the electrode capacitance and represents its value.

To ensure stable operation of the solution, the number of transfers needed to reach the threshold is adjusted by an infinite impulse response (IIR) filter that compensates for environmental changes such as temperature, power supply, moisture, and surrounding conductive objects.

Since CS is an integral part of the design, the non-ideal effects of capacitors must be considered.



Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.