Showing results for 
Search instead for 
Did you mean: 

Using Touch Sensing Controller on STM32L053R8 nucleo64

Posted on April 18, 2016 at 15:18

Hi everyone,

I'm trying to set up 3 capacitive touch keys using HAL touch sensing controller library but I'm facing some problems. I followed the instructions in AN2869 application note for implementing one sensor using Active Shield. The TSC is initialized with CubeMX. I have a 10mm x10mm copper touch key connected to pin PA6 (G2_IO3) and the corresponding sampling capacitor (10nF) on PA7 (G2_IO4). The active shield is connected to PA11 (G4_IO3) and correponding sampling capacitor is on PA12 (G4_IO4). I placed a 2.5mm plastic overlay on the touch key.

The problem is that I have too much parasistic capacitance and a touch is always detected. I tried to disconnect the touch key from the mcu but even without the touch key I see the voltage on the sampling capacitor increasing with the counts.

What am I doing wrong ? Is the touch sensing controller on STM32L053 nucleo board recommended to detect touch events through 2.5mm plastic overlay ?

Thank you,

#stm32l053r8-nucleo #touch-sensing #touch-sensing
Associate II
Posted on April 20, 2016 at 07:20


try to use greater capacitor and series resistor (in my app I used 30nF and 4R7)

Jaroslav BECKA
ST Employee
Posted on August 29, 2017 at 13:14

Hello Lucas,

the charge transfer principle useselectrical properties of a capacitor.

In the first step you charge the sensor capacitanceto VDD. Then, part of this charge is transferred to sampling capacitor.

This is repeated several times until voltage on sampling capacitor reaches the VIH level (minimum input voltage to be considered as HIGH).

After that the acquisition is over and the number of cycles needed to charge sampling capacitor to this level represents the sensorcapacitance.

By touching a touch key you increase the sensorcapacitance, thus the sampling capacitor is charged faster and the number of cycles decreases.

You basically connect a small capacitor in parallel.

Even if you disconnect the touch key, there is still the pin capacitance, i.e.the voltage on sampling capacitor will be always increasing during the acquisition.

You are probably facing sensitivity issues. There are severaltechniques to increase sensitivity described in the AN4312Guidelines for designing touch sensing application with surface sensors, but since you are not at the stage of PCB design, it won't help us in this case. Anyway, I would recommend to read this application note thoroughly.

You may find helpful AN4316Tuning a STMTouch-based application.

I am attaching it.

The best what you can do now is to play a little bit with the sampling capacitor value as advised by Lukas.


Attachments :

AN4316.pdf :