2018-01-12 03:46 AM
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-touchSolved! Go to Solution.
2018-05-04 01:10 PM
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):
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
2018-05-04 01:10 PM
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):
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
2018-05-04 04:24 PM
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.