In the previous chapters, we have discussed the design of capacitive touch sensors, as well as the operating principles of touch sensing microcontrollers (MCUs). Now, it’s time to combine our knowledge into a realistic application: we will design a capacitive touch sensor, and we will virtually connect it to a controller of the STM32 series. Then, we will simulate the performance of the entire capacitive touch system.
We’ll go step by step through the process, explaining the reasoning behind our design choices and their impact on the system’s performance. Let’s begin.
STMicrocontroller, is one of the leading companies in the microcontrollers industry. One of its most popular offerings is the STM32 family of 32-bit microcontrollers. The STM32 family is based on the Arm ® Cortex ® -M processor and offers new degrees of freedom to MCU users. The products in this family combine very high performance, along with features desirable in touch sensing applications, such as digital signal processing, low power consumption, and low voltage operation.
It comes as no surprise that STM32 products are some of the most popular choices amongst engineers for capacitive touch systems. Therefore, we’ve looked into their catalogue to find a suitable MCU for the application we’ll develop in this example.
We will create a simple layout consisting of 4 touch buttons, as seen in Figure 1. While it may seem too simple and unrealistic, it is not. This layout could easily be used in practice as means for interaction in industrial environments, or for HVAC applications. For example, in the HVAC application, the buttons on the left could be used to control the temperature, and the buttons on the right to control the fan speed.
Figure 1. The layout used in this example
In this relative simple application, a suitable controller choice would be the STM32F071C8Tx controller from the STM32F0 Series. Its touch sensing features are based on the charge transfer method, which we discussed in detail in Chapter 5. To refresh your memory, Figure 2 shows the charge transfer principle schematic of the STM32 MCU.
According to their datasheet, products of the STM32F205xx microcontroller family, have powerful features that make them suitable for a wide range of applications, such as:
Indeed, our envisaged use cases for this application fall within the capabilities of the controller we’re looking to choose. Therefore, we can proceed to the next step, which is the design of the touch sensor, keeping in mind that what we design must be compatible with our controller of choice.
So far, we have decided to design a simple 4 button touch sensor layout, and we have committed to using the STM32F071C8Tx controller. Therefore, we should keep in mind during our design process that our design must be compatible with the capabilities of the controller. In the past, we’ve talked about IC makers providing documentation along with their controllers that help design engineers accomplish just that.
So, we visit ST’s website, and search their resources to find the proper documentation. Document AN4312 is titled “Design with surface sensors for touch sensing applications on MCUs”, and is just what we’re looking for. Table 1 on page 1 of the document lists products for which the guidelines provided in the document are applicable for. The controller we’ve chosen belongs in the STM32F0 Series, therefore we can use the guidelines provided in this document for our project.
First, we will design the layout of the sensor as a dxf file with our CAD tool of choice, and then we’ll import it in Fieldscale SENSE, to create the stackup, connect the controller and perform further analysis. Before we start designing, we consult the guidelines to see any applicable practices we should follow. In page 13, we can see that the recommended electrode size is at least 6 mm, and in page 23 we can see some guidelines regarding the sensor track length, width, and routing, as well as the electrode spacing. We end up with the layout that is presented in Figure 1, which follows all the suggested guidelines by the controller’s documentation.
The next step is to import the dxf file in Fieldscale SENSE and proceed with the creation of the sensor’s stackup. If the reader is interested in seeing or refreshing the steps involved in importing the dxf and setting up the stackup in detail, they can refer to this detailed walkthrough.
Again, before proceeding with this step, we check out the documentation for any guidelines. This time, the documentation provides guidelines both for the materials of the electrodes and their interconnections (page 5), and for the materials of the panel (pages 6-7).
Following the guidelines, we decide that our stackup should consist of 5 layers, as seen in Table 1. Layers 1, 3, and 5 will consist of dielectrics, and layers 2, and 4 will host the conductive materials. The guidelines also provide some ballpark estimates for the dielectric constants (εr) of some common materials used in the stackup. Fieldscale SENSE has its own library of materials, so you won’t need to worry about finding the dielectric constants for most of the materials used in the industry.
Table 1. The stackup used.
As you can see in the guidelines, the suggestion is that for electrodes materials with lower resistivity are used, therefore using copper in our example falls within STM’s guidelines. As far as the rest of the layers of the stackup are concerned, again we are in accordance with the suggestions of the guidelines. We use a relatively thin front panel, made of glass (which has an excellent dielectric constant) and the rest of the materials in the stackup are also suited for the application. Both FR4 (also known as 2-sided epoxy-fiberglass) and PET are widely used in the industry.
It is worth mentioning that the top conductive layer (layer 2) contains the electrodes, the shielding layer and the top traces, while the bottom conductive layer (layer 4) contains the bottom traces. They are connected with a via, which is also made of copper.
To proceed with the analysis of the behavior of the touch sensor, a pointer will also need to be simulated. In the document AN4316, a standard test finger is described. This test finger is a conductive pen-shape tool with a rubber end and a 8 mm diameter that can be used for validation in physical prototypes. It’s dimensions and materials are meant to simulate the widest range of people’s finger characteristics.
In SENSE, you can easily create a similar cylindrical conductive pointer and place it on the areas of the design you are interested in. In this example, 5 different combinations of pointer placement should be run: one with no pointer and one with the pointer above each of the four buttons. This way, we can see the sensitivity of each button and test the controller’s ability to detect the touches in each of them. Again, the reader can refer to this walkthrough for more information regarding these steps.
Key takeaways from this section:
Grab a free copy of this chapter to easily go back to the basics whenever you need!