A type of electronic switch that can be turned on by lightly pressing the switch button when in use. Its internal structure is realized by the force of the metal spring. Light touch switch is widely used in home appliances due to its small size and light weight, such as: audio-visual products,. Digital products, remote control, communication products, home appliances, security products, toys, computer products, etc.
1、 The main specifications of touch switch are: environmental protection and high temperature resistant patch type plug-in side plug-in large / medium / small tortoise type touch switch 2 * 4 touch switch 3 * 3 touch switch 3.7 * 3.7 * 0.35 product touch switch 4 * 4 * 1.5 / 1.6/17mm touch switch 3 * 6 * 4.3/5.0mm automobile touch switch 4 * 6 * 2.6 touch switch 4.5 * 4.5 * 3.8 / 5 / 0 / 6 / 7 / 8 / 9 patch type touch switch plug-in touch switch side three touch switch Series waterproof touch switch 8 * 8 series waterproof touch switch 10 * 10 series waterproof touch switch 12 * 12 series waterproof touch switch.
2、 Recognition of key signals
The recognition of key signal is to judge whether the key is pressed, as shown in the figure below, an independent keyboard composed of four keys. One end of the key is grounded, pb0, PB1, PB2 and PB3 are the I / O pins of the single-chip microcomputer. When a key is pressed, it reflects that the level state of the I / O pin of the single-chip microcomputer is low, and when it is not pressed, it is high. By detecting the state of I / O pin, we can judge whether the key is pressed.
As the key is a mechanical switch, the key will vibrate when the key is pressed or released, which will interfere with the recognition of the key. There are two ways to remove the jitter of keys: hardware and software. Generally, software is used to remove jitter. The implementation method is to judge that after the key is pressed, add a delay of 10ms. After the key is stable, check the key again. The key is still in the pressed state, and confirm that there is indeed a key pressed.
3、 Key matrix (tap switch circuit)
When a system needs more keys, it uses the above independent keys to occupy a large number of I / O ports, and the I / O port of single chip microcomputer is a limited resource. Matrix keyboard is usually used when there are many keys. As shown in the figure below, 16 key matrices of 4 rows and 4 columns are used.