cancel
Showing results for 
Search instead for 
Did you mean: 

Capacitive touch sensing for STMF103

Christoph Hesse
Associate II
Posted on January 12, 2018 at 12:46

Hello,

I am trying to implement a long 1D capacitive touch slide sensor or around 7 or more separate capacitive touch buttons using STM32F103. 

I read that the touch sense library is not available for F103. Is this correct? Does the F103 lack touch functionality? Does ST provide any means of implementing touch sensing with F103?

On Github / the net, I find an implementation for STMDuino, but no implementation in C using the current HAL or LL environment. 

What other libraries or examples of touch buttons for F103 are available or easy to port?

Thank you & regards,

Christoph

#capacitive-touch
1 ACCEPTED SOLUTION

Accepted Solutions
Jaroslav BECKA
ST Employee
Posted on May 04, 2018 at 22:10

Hello Christoph,

I would highly recommend you to use a STM32 microcontroller that embedds touch sensing controller peripheral. 

Hence, you should select among STM32F0, F3, L0 and L4 families.  

The easiest way would be to get the STM32F072RB-discovery board that has a slider on it and thus allows evaluation of touch sensing functionality.

The slider consists of three channels that can be also configured as basic touch keys.

There is no way how to evaluate touch sensing with nucleo boards.

There are a few examples in the STM32CubeF0 embedded FW package based on STMTouch Driver (ST touch sensing library). If you are using STM32CubeMX the package can be downloaded via this tool or alternatively using the following link:

http://www.st.com/en/embedded-software/stm32cubef0.html

You will find them under the following path:

....\STM32Cube_FW_F0_V1.9.0\Projects\STM32F072B-Discovery\Applications\TouchSensing

A touch key example is available for STM32072_B evaluation board folder. It can be easily ported to the discovery board.

For touch sensing application a full understanding of the charge transfer principle is essential.

Additionally, the PCB layout is crucial for these applications.

Therefore you should read thoroughly the following application notes (in addition to relevant chapters in datasheet and reference manual):

0690X0000060AziQAE.png

It is extremely challenging to implement touch sensing functionality on MCUs without touch sensing controller peripheral (full software solution) and achieve good performance and reliability.

I hope that it will help you to progress.

Best regards,

Jaroslav

View solution in original post

2 REPLIES 2
Jaroslav BECKA
ST Employee
Posted on May 04, 2018 at 22:10

Hello Christoph,

I would highly recommend you to use a STM32 microcontroller that embedds touch sensing controller peripheral. 

Hence, you should select among STM32F0, F3, L0 and L4 families.  

The easiest way would be to get the STM32F072RB-discovery board that has a slider on it and thus allows evaluation of touch sensing functionality.

The slider consists of three channels that can be also configured as basic touch keys.

There is no way how to evaluate touch sensing with nucleo boards.

There are a few examples in the STM32CubeF0 embedded FW package based on STMTouch Driver (ST touch sensing library). If you are using STM32CubeMX the package can be downloaded via this tool or alternatively using the following link:

http://www.st.com/en/embedded-software/stm32cubef0.html

You will find them under the following path:

....\STM32Cube_FW_F0_V1.9.0\Projects\STM32F072B-Discovery\Applications\TouchSensing

A touch key example is available for STM32072_B evaluation board folder. It can be easily ported to the discovery board.

For touch sensing application a full understanding of the charge transfer principle is essential.

Additionally, the PCB layout is crucial for these applications.

Therefore you should read thoroughly the following application notes (in addition to relevant chapters in datasheet and reference manual):

0690X0000060AziQAE.png

It is extremely challenging to implement touch sensing functionality on MCUs without touch sensing controller peripheral (full software solution) and achieve good performance and reliability.

I hope that it will help you to progress.

Best regards,

Jaroslav

henry.dick
Senior II
Posted on May 05, 2018 at 01:24

I think you will find it quite trivial to do capacitive sensing with charge transfer (

https://github.com/dannyf00/Arduino-Based-Capacitance-Meter

 ) you basically measure small capacitance. My experience suggests that the reliability is quite good.

capacitive sensing with GPIO can be difficult, especially in noisy environment. I can get it to work in a clean environment, on a fast MCU but getting it to work reliably in an actual application has been a struggle.

However, your odds of success do go up if you run it on a fast chip - which you seem to have.