[Guide]Capacitive touch switches that use electrostatic capacitance between the human body and electrodes to work, were first used in smart phones, and then widely used in home appliances, AV equipment, automobiles, and industrial equipment. The composition of the touch switch does not require mechanical parts, so it is very flexible to use and can even be installed on a hard curved surface. Based on Renesas Electronics’ electrostatic capacitive touch technology, this article introduces the basic principles of touch switch detection and anti-interference technology.
Capacitive touch switches that use electrostatic capacitance between the human body and electrodes to operate were first used in smart phones, and then widely used in home appliances, AV equipment, automobiles, and industrial equipment. The composition of the touch switch does not require mechanical parts, so it is very flexible to use and can even be installed on a hard curved surface. Based on Renesas Electronics’ electrostatic capacitive touch technology, this article introduces the basic principles of touch switch detection and anti-interference technology.
Introduction to the principle of touch switch detection
The capacitive touch switch captures the slight change in the electrostatic capacitance (below 1pF) between the human body and the electrode to determine the ON/OFF state of the switch. There are many ways to convert the electrostatic capacitance into the ON/OFF state of the switch. The simplest method is to use electrostatic capacitance and resistance to form a low-pass filter (LPF), and determine the change in electrostatic capacitance by measuring the change in charge/discharge constant. This method is called the relaxation oscillation method. Because of its simple Circuit, no special capacitance measuring Circuit is needed, so it is widely used. However, the anti-noise performance of this method is weak, and sometimes misjudgment occurs due to the inverter noise of lighting fixtures or home appliances.
The electrostatic capacitance touch detection method developed by Renesas Electronics uses a switched capacitor filter (SCF) to convert the electrostatic capacitance into a current. After the signal is amplified and digitized, the ON/OFF state of the switch is determined based on it. This method has the advantages of high sensitivity and strong anti-noise performance. The specific detection process is shown in Figure 1. This chapter describes the basic knowledge of electrostatic capacitive touch switches according to the flow in Figure 1.
Fig.1 The detection process of electrostatic capacitive touch switch (“Number. Number” means chapter number)
The occurrence of electrostatic capacitance
The mechanism of electrostatic capacitance is shown in Figure 2. There is a parasitic capacitance (Parasitic Capacity: Cp) between the electrode and the surrounding conductor (ground wire, metal frame, etc.). When the human body approaches and touches the electrode, a new electrostatic capacitance (Finger Capacity: Cf) is generated between the human body and the electrode through the finger, and is connected to the earth through the conductive human body (as shown by the red line in Figure 2).
Fig. 2 The occurrence of electrostatic capacitance (self-capacitance method)
The total capacity (Total Capacity) of the electrostatic capacitance generated on the electrode is as follows:
The electrostatic capacitance type touch switch measures the electrostatic capacitance of the electrode in a certain cycle, and determines the ON or OFF state of the touch switch according to the increase Cf of the electrostatic capacitance generated when the human body touches.
The occurrence of electrostatic capacitance
like[静电电容的发生]As described above, the method of converting the electrostatic capacitance generated between the human body and the electrode into the amount of current uses a switched capacitor filter (Switched Capacitor Filter: SCF). As shown in Figure 3, the SCF is composed of two switches, a control pulse that controls the interactive ON/OFF actions of the two switches, a power supply, and a capacitor.
Fig. 3 SCF configuration and capacitor charging and discharging actions
SW1 and SW2 are under the action of the control pulse, when one switch is ON, the other switch is OFF. As shown in the left diagram in Figure 3, when SW1 = ON; SW2 = OFF, the capacitor is charged. Then, as shown in the right diagram in Figure 3, the capacitor is discharged after switching to the state of SW1 = OFF; SW2 = ON. The relationship between the current i flowing through the capacitor, the switching frequency f of the switch, the capacitance value c, and the circuit power supply voltage v is shown in the following formula:
i = fcv
If f and v are fixed, the current i is proportional to the capacitance c. Therefore, the SCF can be used to convert the change in electrostatic capacitance generated when the human body approaches into a change in the amount of current. By adjusting the switching frequency f and the supply voltage v, the proportional coefficient between the change in electrostatic capacitance and the change in current can be changed.
Numericalization of current
After the capacitance value of the capacitor is converted into a proportional amount of current, it is converted into an oscillating pulse proportional to the amount of current through a current-frequency conversion circuit. Then, the counter counts the oscillating pulses, and then converts the current into a proportional digital value.
The numerical flow of current is shown in Figure 4. When charging and discharging the capacitor of the SCF cyclically, an alternating current will be generated in the capacitor. After the subsequent current smoothing circuit converts the alternating current into a direct current, the current is input to the current oscillator and converted into an oscillating pulse whose frequency is proportional to the input current. The pulse counter counts the pulses within a certain period of time and saves the counting result.
Fig. 4 Flow of current digitization
Switch ON/OFF judgment
like[静电电容的发生]As mentioned, the self-capacitance method judges whether the human body touches the electrode by detecting the increase of the electrostatic capacitance. Perform the electrostatic capacitance measurement described in chapter 2.1~2.3 in a certain cycle, and it can be determined whether the human body touches the electrode according to the change of the measured value.
When the finger approaches and leaves the electrode, the ON/OFF determination process of the switch is shown in Figure 5. The electrostatic capacitance measurement is performed at regular intervals according to the sequence shown in the figure. The measured value is shown by the blue line in the figure. When the finger is far away from the electrode, it remains at a certain count value; when the finger approaches the electrode, the electrostatic capacitance and the count value gradually increase. When the finger moves away again, the count value gradually drops and remains at a certain value. The count value when the finger is far away from the electrode is used as the reference value (the green dotted line in the figure). A threshold is superimposed on the base value as the critical value. When the measured value exceeds the critical value, the judgement switch is ON. When the measured value is lower than the critical value, it is determined that the switch is OFF. In this way, the ON/OFF switching of the electrostatic touch switch can be realized.
In addition, changing the size of the threshold can adjust the sensitivity of the touch switch. Changing the measurement period and calculating the average value of multiple counts can suppress the chattering of the switch and adjust the response speed of the switch.
Fig. 5 ON/OFF judgment of switch
Hardware and software anti-jamming technology
The electrostatic capacitance type touch switch operates based on the slight change in electrostatic capacitance. Therefore, the influence of noise and power supply fluctuations must be avoided as much as possible when designing.
The Touch solution provided by Renesas not only incorporates a variety of noise suppression Circuits in the capacitive touch sensing unit (abbreviated: CTSU), but also provides a software filter for noise suppression. This chapter mainly introduces the hardware anti-interference function and software anti-noise technology of CTSU module.
Immunity of hardware CTSU module
In order to suppress the noise introduced by radiation and conduction, CTSU has built-in a variety of noise suppression Circuits to stabilize the measurement of electrostatic capacitance. The composition and function of these circuits are described below.
Phase shift of SCF clock
In order to use SCF to convert electrostatic capacitance into current, CTSU switches the ON/OFF state of the SCF switch according to a certain cycle, and realizes the cyclic operation of charging/discharging the external capacitor. At this time, if noise of the same period as the SCF switch is mixed into the electrode, and the peak/trough of the noise is always consistent with the charging/discharging period, the current will increase or decrease correspondingly due to the noise, which may cause the measurement to fail to be performed correctly. As a countermeasure against the same period noise, CTSU has a built-in SCF drive pulse phase shift circuit. By reversing the phase of the driving pulse, the peak/trough of the driving pulse and the noise are prevented from being in phase. The phase shift is determined by a polynomial counter. In one measurement, the number of phase shifts of the SCF pulse must be the same as the number of 180° phase shifts.
The influence of the same period noise and the suppression of the 180° phase shift on the same period noise are shown in Figure 6. When charging, if the SCF drive pulse and the peak of the noise are in phase, the current component generated by the noise will be superimposed on the charge and discharge waveform of the current. At this time, the charging current will increase due to noise, causing the measurement result to be greater than the actual capacity. If the capacitance generated by noise is greater than the increase in capacitance caused by finger contact, the interference due to noise will occur, and even if there is no touch action, the judgment result is erroneously judged to be ON. Therefore, it is necessary to perform a 180° phase shift on the SCF drive pulse according to certain rules, and balance the increase and decrease of the current caused by the noise by reversing the synchronization relationship between the drive pulse and the noise. The number and frequency of the polynomial calculator can be adjusted through the CTSU register.
In addition, the displacement countermeasures can not only suppress noise of the same frequency, but also effective for noise whose frequency is an odd multiple of the drive pulse frequency.
Fig. 6 The influence of the same period noise and the balance of the 180° phase shift on the same period noise
SCF drive pulse edge spread
When the noise frequency is an integer multiple of the SCF drive pulse frequency, the edge of the drive pulse will be synchronized with the noise, which will affect the measurement of electrostatic capacitance. For the noise as shown in Figure 7, a signal asynchronous with the drive pulse can be used to normalize the edge of the SCF drive pulse to expand the edge frequency. As mentioned earlier, inputting the modulated current into the ICO for spread spectrum to generate the pulses used for normalization can prevent the SCF drive pulse from being synchronized with the noise (refer to Figure 8).
Fig. 7 Examples of SCF drive pulses and frequency multiplication noise
Fig. 8 Normalization of SCF drive pulse by extended clock
The built-in anti-interference circuit of CTSU cannot eliminate low-frequency noise below several kHz. The low-frequency noise in the frequency domain of several kHz needs to be eliminated by software methods. The following examples illustrate software countermeasures to suppress low-frequency noise.
Drift correction processing
The results of touch detection will be affected by environmental changes such as temperature, humidity, and material aging. These frequencies are slow changes below a few kHz, which are difficult to handle by hardware. Therefore, it is necessary to suppress the interference of these low-frequency noises through software integration.
The working principle of drift correction is shown in Figure 9. As mentioned earlier, the reference value and the ON/OFF threshold value generated on the basis of it are calculated by software. The measured value and the generated threshold are compared one by one, and then the touch or non-touch (ON/OFF) is determined. The result of the integral calculation of the measured value is averaged as the reference value, which can smooth the fluctuation of the measured value caused by environmental changes. By changing the number of measurement values used in integration calculations, the adaptability to environmental changes can be adjusted.
In addition, when the judgment result is ON, the drift correction processing is suspended; when the subsequent judgment result is OFF, the drift correction processing is restarted. If the drift correction process is continued when it is judged to be ON, the long-term touch action will cause the reference value to gradually approach the measured value and eventually equal the measured value. At this time, there will be a misjudgment that the result is OFF. Therefore, when the judgment result is ON, the drift correction processing should be suspended to prevent the result from being misjudged.
Fig. 9 Drift correction processing
Random noise countermeasures
In order to suppress the interference of random noise on the measured value, a software filter that smoothes the measured value is added to the software. The following describes the software filter through examples.
(1) Smoothing filter
An example of a smoothing filter is shown in Figure 10. In this example, the average value of the current measurement value and the previous 3 measurement values (4 times in total) is used as the measurement value of this inspection. By adjusting the number of measured values used to calculate the average value, noise at different frequencies can be suppressed. For example, when the measurement period = 20 ms, in order to suppress the noise of 10 Hz (noise period = 100 ms), it is necessary to use 5 or more measurement values to calculate the average value. It should be noted that the more the number of measurement values used to calculate the average value, the slower the response speed of the touch key.
Fig. 10 Example of smoothing filter
(2) Upper limit filter
The upper limit filter first compares the current measured value with the previous measured value. If the difference between the two is greater than the upper limit of the difference set in advance, the sum of the previous measurement value and the upper limit of the difference is taken as the current measurement value. When explosive noise occurs in the system, the measured value will change drastically. Using the upper limit filter can achieve the effect of smoothing the measured value. By limiting the rapid increase and decrease of the measured value, the false judgment of touch/non-touch caused by noise is suppressed. Since the upper limit filter cuts the peak of the noise, it is more effective than the smoothing filter described above in terms of suppressing noise. However, it should also be noted that reducing the upper/lower limit of the difference during setting will increase the touch detection time, thereby reducing the response speed of the touch keys.
Countermeasures for chattering noise
Like mechanical contact type switches, sometimes it is necessary to eliminate chattering when using touch keys. The countermeasures to eliminate tremor are explained below.
(1) N-time consensus method
When judging the state change of the touch key ON→OFF, OFF→ON, if the judgment results of N consecutive times are consistent, that is, when the judgment results of N times are all ON or all are OFF, the judgment is ON or OFF. Increasing the number of consecutive matches N can strengthen the effect of suppressing tremor, but it will reduce the response speed of the touch keys.
(2) Majority consensus method
The number of ON or OFF times in a certain period of time is accumulated, and the more frequent times are regarded as the judgment result of this time. Compared with the above-mentioned N-time consensus method, the majority consensus method has a faster judgment speed, but the defibrillation ability is relatively low.
Using electrostatic capacitive touch detection technology can reduce the use of mechanical parts, reduce costs, and can be flexibly applied to various panels. Capacitive touch technology requires special attention to anti-interference treatment when using it. For different noise interference frequency bands, the combined use of hardware and software anti-interference measures can effectively improve the reliability of the electrostatic capacitive touch detection system.
The Links: PM100RRS060 TM121SV-02L07D