Design of touch keys based on WTC6216

With the continuous development of modern electronic technology, especially human-machine interface technology, touch buttons are more and more widely used in electronic products and handheld instruments. Compared with traditional mechanical buttons, touch buttons have obvious technical advantages. Not only the system hardware structure is simple, the production cost is low, but also it is not easy to wear and damage during use, which increases the service life of the buttons. In addition, touch buttons can also increase the flexibility of product design and improve product quality. This paper presents a design scheme of touch buttons based on WTC6216ASI integrated circuit, which has high practicality.

1 Working principle of capacitive touch buttons

Touch buttons can be divided into resistive touch buttons and capacitive touch buttons. There is a sensing capacitor between any two conductive objects. A button, a pad, and the ground can also form a sensing capacitor. The value of the sensing capacitor is a fixed and small value when the surrounding environment does not change. When a human finger is close to the touch button, the induction capacitor formed by the human finger and the ground in parallel with the induction capacitor formed by the ground and the ground will increase the total induction capacitance value. After detecting the change of the sensing capacitance value of a certain key, the touch key chip will output a confirmation signal that a certain key is pressed.

WTC6216ASI integrated circuit is a capacitive touch sensor chip designed for realizing human touch interface. It can support up to 16 independent touch buttons. The touch button designed with WTC6216ASI integrated circuit has low power consumption, few peripheral components, and simple hardware circuit structure. The corresponding output provided by it can be directly interfaced with the single chip microcomputer. The design of the WTC6216ASI integrated circuit covers EMI / EMC and high anti-noise circuits. It has strong anti-interference ability and can automatically overcome the interference caused by electrostatic discharge, electromagnetic interference or the accumulation of pollutants on the keyboard surface. At the same time, the circuit has the ability to adapt to ambient temperature and humidity, and can provide good accuracy and consistency of operation in various harsh environments, and stable performance. In addition, the WTC6216ASI integrated circuit also has the function of suppressing adjacent keys, which can prevent malfunctions caused by mutual interference between adjacent keys, and can be used on dense keyboards with a small key pitch (the key pitch is not less than 2 min) , Fully meet the technical requirements in the design of daily life electronic products and handheld instruments.

The WTC6216ASI uses a high-precision 16-bit digital capacitance converter (CDC) to detect the change in capacitance value on the pad (capacitance sensor) to recognize the touch action of the human finger. The digital capacitance converter inputs the detection data to the embedded RISC processor, and the RISC processor processes the detection data through a reliable and efficient algorithm. When the RISC processor judges that there is a valid touch on the sensor panel, it will issue a corresponding instruction within 100 ms to determine that a certain key is pressed, which is convenient for the system to control the operation according to the key. The instruction issued by WTC6216ASI contains two parts: the BCD code of the pressed button and the effective indication state of the button being pressed. Pins data3 ~ data0 are the BCD code of the output to determine the pressed button, pin out_flag is the effective indication state of the output button being pressed, where "1" indicates that no valid button is pressed; "0" indicates that a button is pressed . The timing output relationship between pin out_flag and pins data3 ~ data0 is shown in Figure 1.

2 Hardware design of touch buttons

The hardware circuit of the touch key is composed of three parts: the main control circuit, the key backlight circuit and the touch key detection circuit.

The main control circuit is selected in the system programmable STC89C52 microcontroller, which has 512 B of on-chip RAM data memory and 8 KB of on-chip FLASH program memory, which can fully meet the needs of system program operation and data storage. In addition, the single-chip microcomputer works in a wide voltage range, has strong anti-interference ability, and can work stably under the severe power supply environment.

The touch key detection circuit supports detection of 12 mutually independent touch keys. Since the WTC6216ASI chip supports up to 16 independent sensor channels, in order to ensure the normal and stable operation of the WTC6 216ASI, unused sensor channels cannot be suspended, they must be connected together and a 10 kΩ pull-up resistor and WTC6216ASI power connection. The sensitivity of the touch button is determined by the capacitance adjustment connected to the pin CSEL, and the capacitance value is generally determined by the thickness of the isolation medium on the keyboard. The thicker the isolation medium, the greater the capacitance value. Generally, the capacitance value is 0.047 ~ Between 0.08μF. At the same time, in order to obtain the most stable measurement effect, the capacitor on the pin CSEL is best to use a polyester capacitor with a small temperature coefficient and 5% accuracy, and the capacitor on the pin CSEL should be as close as possible to the WTC6216ASI chip when PCB wiring. The key backlight circuit is used to indicate the effective touch keys of the keyboard in the current working state of the system.

Because the sensor channel of the WTC6216ASI chip measures small changes in capacitance, it has high requirements for the stability of the power supply circuit. When designing the power supply circuit, the ripple and noise of the power supply should be small, and care should be taken to avoid strong interference from the power supply. When the touch button directly uses the 5 V power supply of the host, the power supply filter circuit should be added before the power supply used by the WTC6216ASI chip, as shown in Figure 3. This circuit has a good ability to suppress power supply noise, but it is easy to generate self-excitation when connected to a large load. Therefore, it is best not to connect other loads except the power supply for the WTC6216ASI chip.

3 Software design of touch buttons

According to the hardware circuit schematic diagram of the above touch buttons, the touch buttons only support 12 mutually independent buttons. If the system requires more than 12 buttons, the software can be paged to expand the buttons. The number of keys. The most important thing in software design is to continuously scan the state of the pressed key output by the pin out_flag. Once it is determined that a valid key is pressed, the BCD code key value of the key is read immediately, and the corresponding conversion is converted according to the key page conversion flag. The key code of the page, the system then sends operation control instructions according to the key code, and turns on the backlight of the effective touch keys on the keyboard in the current state. Although the sensitivity of the touch button is determined by the capacitance adjustment connected to the pin CSEL, in order to obtain a more appropriate touch button feel, it is necessary to measure the sensitivity of the key press to determine whether the key press is more stable. Make more delicate adjustments. The program flow chart of software processing touch keys is shown in Figure 4.

4 PCB board design

The sensor channel of the WTC6216ASI chip measures small changes in capacitance, so it has certain requirements for PCB board design. The conductor of the single induction disk of the keyboard can be made into any shape on the PCB board, but in order to avoid the tip discharge effect of the conductor as far as possible, the arc-shaped edge should be adopted as much as possible, generally designed as a circle with a diameter of 10 mm. At the same time, the connection between the induction disk and the WTC6216ASI chip should be as short and thin as possible (0.1 ~ 0.3 mm), do not cross other signal lines, especially high-frequency, strong interference signal lines, at least keep between the signal lines The distance above 0.5 mm. The shape and area of ​​each sensor disk of the keyboard should be the same, and the distance to the WTC6216ASI chip is basically the same to ensure the consistency of touch sensitivity. In addition, the distance between the induction plates should be as far away as possible to reduce the interference between them, and they can also be separated by covering ground, and a layer of ground is also covered on the back of the induction plate to reduce electromagnetic interference.

5 Conclusion

The use of touch buttons in electronic products and handheld instruments is becoming more and more widespread in people's daily lives. This article is based on the WTC6216ASI chip to design a touch key with backlight. Its hardware circuit is simple, it uses fewer peripheral components, low production cost, strong anti-interference ability, stable working performance, and has a high competitive advantage in the market. At the same time, it has beautiful appearance, low failure rate and long service life compared with traditional mechanical buttons. It has high practicability for the upgrading of mature electronic products and handheld instruments and the development of new electronic products.

Dc Power Supply

Dc Power,Dc Supply,Dc Power Supply,Programmable Power Supply

Yangzhou IdealTek Electronics Co., Ltd. , https://www.idealtekpower.com