AN2927 application note introduces capacitive touch sensing control technology and introduces ST's touch sensing software library, which can achieve low-cost touch detection function.
The document explains how capacitive touch-sensitive controls can replace conventional switches by detecting variations in electrode capacitance. It details the RC acquisition method where a fixed resistor and the touch electrode capacitance form a network whose charge/discharge timing is measured to determine if a finger is touching or near the sensor.
The note covers both hardware implementation, which requires only one resistor per channel, and firmware implementation for STM8 microcontrollers. It describes two methods for measuring charge time: using an input capture timer or a software sequence with oversampling to achieve fixed measurement resolution equal to the CPU frequency.
It detects human touch by measuring the small variation of the touch electrode capacitance (C) caused by a finger, which changes the charge time of an RC network.
Only one resistor is needed per touch channel to enable this function.
The capacitance added by a human finger (touch capacitance) is typically around 5pF.
For STM8 microcontrollers, the number of measurements necessary to span all values is equal to 8.