Key detection method
By using interval-arranged scanning lines and output lines in the keyboard circuit, and using the driving voltage signals of different frequencies and the one-way conduction characteristics of diodes, the key detection accuracy in the prior art is solved, and the key detection is not high and susceptible to external environment. The problem is to achieve higher detection accuracy and reliability.
Patent Information
- Application Number
- CN202411439915.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-15
AI Technical Summary
Existing matrix keyboard circuit designs have problems of low accuracy and susceptibility to external environment when detecting keys, especially in extreme cases where keys may not be recognized.
The matrix circuit is formed by scanning lines and output lines arranged at intervals. The voltage signals of the output lines are sampled through driving voltage signals of different frequencies, the triggered key switch is judged, and the one-way conduction characteristics of diodes and resistors are used to prevent false detection.
Improves the accuracy and reliability of key detection, reduces delays, and reduces the impact on the external environment, ensuring that keys can be accurately identified in extreme cases.
Smart Images

Figure CN119247123A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of key detection, and in particular to a key detection method. Background Art
[0002] With the development of technology, electronic devices are becoming more and more diversified. In order to achieve human-computer interaction, electronic devices are usually provided with buttons. For example, computers are often equipped with keyboards for typing, gaming and other operations.
[0003] In order to receive key information, it is necessary to be able to accurately detect which key is pressed. As far as the applicant knows, the most commonly used key detection circuit design is a circuit design using a matrix keyboard, which includes multiple scan lines and multiple output lines. The scan lines and the output lines are coupled through the key switches. The scan lines and the output lines are respectively connected to the IO interface of the chip. Since the scan lines and the output lines can be connected to the switches of multiple keys, high levels are input to different scan lines, and the levels of the output lines are detected to determine which key or keys are pressed, thereby realizing the detection of more key states using fewer IO interfaces.
[0004] However, this circuit design still has some disadvantages, such as the need to input high level to the scan lines one by one. Only by pressing the switch corresponding to the scan line that is connected to the high level can the key be detected to be pressed, while the switch corresponding to the scan line that is not connected to the high level cannot be detected even if it is pressed. At present, the time interval between two high level inputs of the same scan line is shortened by shortening the time for each scan line to be connected to the high level, so as to ensure that the operation of the keyboard can be reliably identified. However, the shorter the time for the scan line to be connected to the high level, the shorter the sampling time for the corresponding output line is, and there may be inaccurate detection. Furthermore, judging the key operation by detecting the voltage size may be affected by the external environment (such as static electricity), resulting in false detection. In addition, due to the objective existence of the time interval when the scan line is not powered, in extreme cases, the key may still not be recognized.
[0005] The above contents are only used to help understand the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The object of the present invention is to provide a key detection method to solve at least one technical problem pointed out in the background technology.
[0007] To achieve the above-mentioned purpose, in a first aspect, the present invention provides a key detection method, which is performed by a key detection circuit, wherein the key detection circuit comprises a plurality of scan lines arranged at intervals and a plurality of output lines arranged at intervals, wherein the plurality of output lines and the plurality of scan lines are staggered to form a matrix circuit, wherein the scan lines have a first voltage terminal and a second voltage terminal, wherein the output lines have a voltage output terminal and a plurality of switch circuits respectively connected to the plurality of scan lines, wherein the switch circuit comprises a key switch;
[0008] The key detection method comprises the following steps:
[0009] S21. A driving voltage signal is input to the first voltage end of all the scanning lines in a preset manner, and the frequency components of the driving voltage signals input to different scanning lines are different, and the voltage signals of the voltage output ends of all the output lines are continuously received;
[0010] S22. Sampling the received voltage signal of the voltage output terminal to obtain frequency component information of the voltage signal of different voltage output terminals;
[0011] S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
[0012] Furthermore, in the step S21, the difference in center frequencies of the driving voltage signals input to the first voltage terminals of the scanning lines is not less than 1% of the highest sampling rate of the detection line.
[0013] Furthermore, in the step S21, applying a driving voltage signal to the first voltage terminals of all the scanning lines in a preset manner comprises the following steps:
[0014] A driving voltage signal is continuously applied to the first voltage end of all the scanning lines; or, a driving voltage signal is applied to the scanning lines according to a preset power-on cycle of each scanning line, wherein the power-on cycle includes a power-on time and a non-power-on time, and within a certain time, all the scanning lines or at least two of the scanning lines are simultaneously applied with a driving voltage signal.
[0015] Furthermore, the step S23 includes the following steps:
[0016] S231. Identify the scanning line into which the driving voltage signal of the corresponding frequency component is input according to the frequency component information of the voltage signal at the voltage output end of the output line;
[0017] S232. Identify a key switch connected between an output line and a scan line having the same voltage frequency component, and the key switch is the triggered key switch.
[0018] Further, the second voltage terminal is a ground voltage terminal, the scanning line comprises a main line and a plurality of parallel branch lines connected to the main line, the main line comprises the first voltage terminal, the branch lines comprise the second voltage terminal, and each branch line is correspondingly provided with one of the switch circuits;
[0019] A diode and a first resistor are sequentially arranged in series between the connection position of the branch line and the main line and the second voltage end, the diode allows current to flow unidirectionally toward the first resistor, and the diode is a common diode or a light-emitting diode for keyboard backlighting; the switch circuit is connected to the portion of the branch line between the diode and the first resistor; or,
[0020] A first resistor is arranged between the connection position between the branch line and the main line and the second voltage end, and the switch circuit is connected to the part of the branch line located between the first resistor and the connection position between the branch line and the main line, and includes a diode connected in series with the key switch, and the diode allows current to be unidirectionally conducted toward the voltage output end, and the diode is a common diode or a light emitting diode.
[0021] Furthermore, the scanning line has a main line and a plurality of parallel branches connected to the main line, the main line has the first voltage end, the branch line has the second voltage end, each branch line is correspondingly provided with a switching circuit, the switching circuit is connected to the second voltage end of the branch line, and the switching circuit includes a diode connected in series with the push switch.
[0022] In a second aspect, the present invention provides a key detection method, which is performed by a key detection circuit, wherein the key detection circuit comprises a plurality of scan lines arranged at intervals and a plurality of output lines arranged at intervals, wherein the plurality of output lines and the plurality of scan lines are staggered to form a matrix circuit, wherein the scan lines have a first voltage terminal and a second voltage terminal, wherein the key detection circuit comprises a light-emitting diode for keyboard backlight, wherein the output lines have a voltage output terminal and a plurality of switch circuits respectively connected to the plurality of scan lines, wherein the switch circuit comprises a key switch;
[0023] The key detection method comprises the following steps:
[0024] S1. Driving the light emitting diode to emit light as needed within the first time period t10;
[0025] S2. Perform key detection in the second time period t11;
[0026] S3. Repeat steps S1 and S2 in sequence;
[0027] In step S2, key detection includes the following steps:
[0028] S21. A driving voltage signal is input to the first voltage end of all the scanning lines in a preset manner, and the frequency components of the driving voltage signals input to different scanning lines are different, and the voltage signals of the voltage output ends of all the output lines are continuously received;
[0029] S22. Sampling the received voltage signal of the voltage output terminal to obtain frequency component information of the voltage signal of different voltage output terminals;
[0030] S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
[0031] Furthermore, in the step S21, the difference in center frequencies of the driving voltage signals input to the first voltage terminals of the scanning lines is not less than 1% of the highest sampling rate of the detection line.
[0032] Furthermore, in the step S21, applying a driving voltage signal to the first voltage terminals of all the scanning lines in a preset manner comprises the following steps:
[0033] A driving voltage signal is continuously applied to the first voltage end of all the scanning lines; or a driving voltage signal is applied to the scanning lines according to a preset power-on cycle of each scanning line, wherein the power-on cycle includes a power-on time and a non-power-on time, and within a certain time, all the scanning lines or at least two of the scanning lines are simultaneously applied with the driving voltage signal.
[0034] Furthermore, the step S23 includes the following steps:
[0035] S231. Identify the scanning line into which the driving voltage signal of the corresponding frequency component is input according to the frequency component information of the voltage signal at the voltage output end of the output line;
[0036] S232. Identify a key switch connected between an output line and a scan line having the same voltage frequency component, and the key switch is the triggered key switch.
[0037] Furthermore, the first time period t10 and the second time period t11 constitute a light-emitting cycle T2. In the step S1, the light-emitting diode is controlled to produce a lighting effect within the first time period t10, or a high level is continuously input to the first voltage ends of all the scanning lines to drive all the light-emitting diodes to continuously emit light. The first time period t10 is greater than or equal to the second time period t11.
[0038] Furthermore, the first time period t10 and the second time period t11 form a light-emitting cycle T2, and the time length of the light-emitting cycle T2 is less than or equal to 41.6 ms.
[0039] Further, the second voltage terminal is a ground voltage terminal, the scanning line comprises a main line and a plurality of parallel branch lines connected to the main line, the main line comprises the first voltage terminal, the branch lines comprise the second voltage terminal, and each branch line is correspondingly provided with one of the switch circuits;
[0040] The branch line is also provided with a first resistor connected in series with the light-emitting diode. The light-emitting diode and the first resistor are sequentially arranged between the connection position of the branch line and the main line and the second voltage end. The light-emitting diode allows current to be unidirectionally conducted toward the first resistor. The switching circuit is connected to the portion of the scanning line located between the diode and the first resistor.
[0041] Compared with the prior art, the present invention has the following beneficial effects: the key detection method of the present invention comprises the following steps: passing driving voltages of different frequency components through the first voltage ends of all the scanning lines, receiving voltage signals from the voltage output ends of all the output lines; sampling the received voltage signals from the voltage output ends, and obtaining the frequency component information of the voltage signals from the different voltage output ends. The position of the pressed key is determined based on the frequency component information of the voltage signal. Since the scanning lines can simultaneously pass driving voltage signals during key detection, and the output lines can be continuously sampled and detected, the detection time is effectively guaranteed, which is beneficial to improving the accuracy of detection and reducing the delay of key detection. In addition, compared with the detection of voltage magnitude, the detection of voltage frequency components is not easily affected by the external environment (such as static electricity), and the detection result is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a circuit diagram of a key detection circuit according to an embodiment of the present invention.
[0043] Figure 2 It is a circuit diagram of a key detection circuit according to an embodiment of the present invention.
[0044] Figure 3 It is a circuit diagram of a key detection circuit according to an embodiment of the present invention.
[0045] Figure 4 It is a timing diagram of energizing the scan lines according to an embodiment of the present invention.
[0046] Figure 5 It is a timing diagram of the power-on period of each scanning line in an embodiment of the present invention.
[0047] Figure 6 It is a timing diagram of the power-on period of each scanning line in an embodiment of the present invention.
[0048] Figure 71 is a circuit diagram of a control circuit of an embodiment of the present invention, in which a common diode is provided on the scanning line.
[0049] Figure 8 1 is a circuit diagram of a control circuit of an embodiment of the present invention, in which a light emitting diode is provided on the scanning line.
[0050] Fig. 9 yes Figure 8 The circuit shown is a schematic diagram of preventing false detection.
[0051] Fig.10 1 is a circuit diagram of a key detection circuit in an embodiment of the present invention. In the diagram, a second resistor is provided in the switch circuit.
[0052] Fig.11 It is a timing diagram of a light-emitting cycle of an embodiment of the present invention.
[0053] Fig.12 It is a circuit diagram of a control circuit in one embodiment of the present invention.
[0054] Fig.13 It is a structural schematic diagram of a key input device in an embodiment of the present invention.
[0055] Fig.14 It is a structural schematic diagram of a key input device in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some structures related to the present application are shown in the accompanying drawings, rather than all structures. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0057] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0059] Example 1
[0060] This embodiment proposes a key detection method, which is used for key detection and can determine which key of a device is pressed.
[0061] The key detection method is performed by a key detection circuit, such as Figure 1 As shown, Figure 1 The key detection circuit of an embodiment is shown, which includes a plurality of scan lines 10 and a plurality of output lines 11. The plurality of scan lines 10 are arranged at intervals, and the plurality of output lines 11 are also arranged at intervals. The scan lines 10 and the output lines 11 are arranged in an interlaced manner to form a matrix circuit. Figure 1 As shown, Figure 1 The number of scan lines 10 and output lines 11 shown is 3. For the convenience of description, the three scan lines 10 from top to bottom are respectively referred to as the first scan line 10a, the second scan line 10b and the third scan line 10c, and the three output lines 11 from left to right are respectively referred to as the first output line 11a, the second output line 11b and the third output line 11c.
[0062] It should be noted that, herein, "plurality" or "multiple" or similar expressions indicate that the number is at least two, that is, "plurality" means two or more, therefore, in other embodiments, the number of the scan lines 10 and the output lines 11 may be two or more than three. It should be further noted that, although in the illustrated embodiment, the number of the scan lines 10 and the output lines 11 are the same, this is not necessarily the case, and the numbers of the two may be different, for example, one of them is two and the other is three, and so on.
[0063] The output line 11 has a voltage output terminal 110 and a plurality of switch circuits 12 respectively connected to the plurality of scan lines 10. The switch circuit 12 includes a key switch. Figure 1 SW1 to SW9 marked in the figure are push switches, which correspond to the position of the key (usually located below the key). When the key is pressed, the key moves downward to trigger the key switch to close, making the switch circuit 12 conductive. Conversely, when the key switch is released, the key is reset, making the key switch disconnected.
[0064] The scanning line 10 has a first voltage terminal 100 and a second voltage terminal 101. The number of the second voltage terminals 101 can be multiple, for example Figure 1 In the illustrated embodiment, the scanning line 10 includes a main line 102 and a plurality of branch lines 103 connected to the main line 102, the plurality of branch lines 103 are arranged in parallel, each branch line 103 is provided with a second voltage terminal 101, and a plurality of switch circuits 12 of the output line 11 are respectively connected to the plurality of branch lines 103 of the scanning lines 10, and each branch line 103 is provided with a corresponding switch circuit 12. The first voltage terminal 100 is used to pass a driving voltage signal. In some embodiments, reference Figure 1 A first resistor is provided between the connection position of the branch line 103 and the main line 102 and the second voltage terminal 101. R1 to R9 marked in the figure are the first resistors. In this embodiment, the second voltage terminal 101 is grounded and is a ground voltage terminal. The switch circuit 12 is connected to the portion of the branch line 103 located between the connection position of the branch line 103 and the main line 102 and the first resistor. Optionally, refer to Figure 2 , the switch circuit 12 also includes a diode connected in series with the key switch, and D1 to D9 marked in the figure are diodes. Figure 3 , the switch circuit 12 further includes a diode connected in series with the key switch, but in this embodiment, the second voltage terminal 101 is directly connected to the switch circuit 12, rather than being a ground voltage terminal. Figure 7 and Figure 8 A diode and a first resistor are connected in series between the connection position of the branch line 103 and the main line 102 and the second voltage terminal 101. The diode allows the current to flow unidirectionally toward the first resistor. The switch circuit 12 is connected to the part of the branch line 103 located between the diode and the first resistor.
[0065] It can be understood that when the key switch (such as SW1) is pressed and the first voltage terminal 100 of the scan line 10 (such as the first scan line 10a) connected thereto is applied with a high level, the voltage output terminal 110 of the output line 11 (such as the first output line 11a) connected to the key switch will detect a voltage, which is also reflected as a high level, and the characteristics of the detected voltage (such as size and frequency, etc.) are related to the characteristics of the voltage applied by the first voltage terminal 100, thereby determining which key is pressed.
[0066] In this embodiment, the key detection method includes the following steps:
[0067] S21. References Figure 4 , a driving voltage signal is input to the first voltage end 100 of all the scanning lines 10 in a preset manner, and the frequency components of the driving voltage signals input to different scanning lines 10 are different, and the voltage signals of the voltage output ends 110 of all the output lines 11 are continuously received;
[0068] S22. Sampling the received voltage signal of the voltage output terminal 110 to obtain frequency component information of the voltage signal of different voltage output terminals 110;
[0069] S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
[0070] The driving voltage signal can be, for example, a sinusoidal signal or a square wave signal or other orthogonal signal with a certain frequency. Since only when the key switch on the switch circuit 12 connected to the output line 11 and the scanning line 10 is pressed, the voltage output terminal 110 of the output line 11 can detect the voltage signal containing the corresponding frequency component, therefore, it is possible to determine which key is pressed by the frequency component of the voltage signal at the voltage output terminal 110. In addition, since the triggered key switch is determined by detecting the frequency component of the voltage signal, multiple (at least two or even all) scanning lines 10 can be simultaneously fed with the driving voltage signal without sequentially feeding the driving voltage signals. When the same output line 11 detects voltage signals containing multiple different frequency components, it indicates that multiple key switches connected to different scanning lines 10 are pressed.
[0071] Specifically, step S23 may include the following steps:
[0072] S231. According to the frequency component information of the voltage signal at the voltage output terminal 110 of the output line 11, the scanning line 10 into which the driving voltage signal of the corresponding frequency component is input is identified;
[0073] S232. Identify the key switch connected between the output line 11 and the scan line 10 having the same voltage frequency component, and the key switch is the triggered key switch. It can be understood that the position information corresponding to each key switch and the scan line 10 and the output line 11 has been recorded and stored in advance. Therefore, when the scan line 10 and the output line 11 having the same voltage frequency component are known, the position information of the key switch can be obtained, and the triggered key switch can be identified. The position information of the key switch corresponds to the position of the key.
[0074] For example, the driving voltage signals containing the frequency components of 1KHz, 2KHz and 3KHz are respectively passed to the first scanning line 10a, the second scanning line 10b and the third scanning line 10c. When the voltage output terminal 110 of the first output line 11a detects the voltage signal containing the frequency component of 1KHz, the key switch SW1 connecting the first output line 11a and the first scanning line 10a can be found (indicating that the key switch SW1 is pressed), and the position information corresponding to the key switch is obtained to determine the pressed key. When the voltage output terminal 110 of the first output line 11a detects the voltage signal containing the frequency components of 1KHz, 2KHz and 3KHz, the key switches connected between the first output line 11a and the first scanning line 10a, the second scanning line 10b and the third scanning line 10c can be identified as SW1, SW4 and SW7, indicating that the key switches SW1, SW4 and SW7 are all pressed, and the position information corresponding to the key switches SW1, SW4 and SW7 can be obtained to determine the pressed key. The key conditions of other output lines 11 can be deduced in the same way.
[0075] It is understandable that the above-mentioned key detection method can simultaneously pass the driving voltage signal to multiple scan lines 10 and continuously sample and detect the output line 11, without passing the driving voltage signal to the scan lines 10 in sequence. Therefore, compared with the method of passing the high level to the scan lines 10 in sequence for detection, the time for each scan line 10 to pass the driving voltage signal can be increased, thereby effectively ensuring the detection time, which is conducive to improving the accuracy of the detection. In addition, the frequency of the voltage is less susceptible to the influence of the external environment (such as static electricity) than the voltage, which further improves the accuracy of the detection.
[0076] It can be understood that there are multiple ways to apply the driving voltage to the first voltage end 100 of the scan line 10 in a preset manner. In some embodiments, the preset method is to continuously apply the driving voltage signal to the first voltage end 100 of all the scan lines 10. In this embodiment, since the driving voltage signal can be continuously applied and the output line 11 can be continuously detected, the accuracy of key detection can be greatly improved, timeliness can be guaranteed, and delay can be reduced. It will not occur that the key operation is not detected due to the time interval for applying the driving voltage signal, which is more reliable. In other embodiments, the preset method is to apply the driving voltage to the scan line 10 according to the preset power-on cycle of each of the scan lines. The power-on cycles of each scan line 10 can be the same or different, and the power-on cycle includes power-on time and non-power-on time. It can be understood that the voltage applied during the power-on cycle is a driving voltage signal with a certain frequency component, and the power-on time included in the power-on cycle corresponding to each scan line 10 can be the same or different. Refer to Figure 5 and Figure 6, the power-on periods of the first scanning line 10a, the second scanning line 10b and the third scanning line 10c are T3, T4 and T5 respectively, Figure 5 In the illustrated embodiment, the durations of the power-on periods T3, T4 and T5 are different, and the power-on time t 通 and the power-off time t 断 Half each. Figure 6 In the embodiment shown, the duration of the power-on periods T3, T4 and T5 is the same, and the power-on time t 通 is much longer than the off-power time t 断 In this way, the scanning line 10 is powered on for a longer time, which is more conducive to improving the accuracy of key detection and reducing the delay of key detection. Further optionally, when the driving voltage is applied to the scanning line 10 according to the preset power-on cycle of each scanning line, within a certain period of time, all the scanning lines 10 or at least two scanning lines 10 are simultaneously supplied with the driving voltage signal.
[0077] Optionally, in step S21, the difference in center frequency of the driving voltage signal input to the first voltage terminal 100 of each scanning line 10 is not less than one percent of the maximum sampling rate of the detection line, so that the frequency components of the voltage signal have a large difference, which facilitates accurate identification of the frequency component information of the voltage output terminal 110 and prevents confusion caused by the driving voltage frequencies being too close.
[0078] Optionally, in step S21, the voltage output terminal 110 of the output line 11 is detected after a preset time period after the drive voltage signal is applied to the scan line 10, so that the voltage of the voltage output terminal 110 is more stable and the detection result is more accurate. Optionally, the length of the preset time period is greater than or equal to 30 microseconds, and can be further selected to be greater than or equal to 50 microseconds, so as to ensure the accuracy of the detection result and avoid false detection caused by level jitter.
[0079] Optionally, in step S22, frequency component information of voltage signals at different voltage output terminals 110 is obtained by performing Fourier expansion on the sampled voltage signal.
[0080] To further improve the reliability of key detection, you can Figure 2 , Figure 3 , Figure 7 and Figure 8 As shown in FIG. 1 , a diode that conducts unidirectionally toward the voltage output terminal 110 of the output line 11 is connected in series in the circuit, and the diode prevents the current from flowing back toward the first voltage terminal 100 of the scanning line 10. Figure 7 and Figure 8For example, the branch line 103 of the scan line 10 is further provided with a diode, which is connected in series with the first resistor and is sequentially arranged between the connection position of the branch line 103 and the main line 102 and the second voltage terminal 101 . Figure 7 and Figure 8 D1 to D9 are diodes. The diode allows the current to be unidirectionally conducted toward the second voltage terminal 101, that is, the current introduced into the first voltage terminal 100 flows into the anode of the diode, then flows out from the cathode of the diode and flows through the first resistor. It can be understood that due to the unidirectional conduction characteristic of the diode, the current cannot flow from the cathode to the anode.
[0081] Since the diode is connected in series in the scanning line 10, the unidirectional conduction characteristic of the diode can be used to achieve the effect of anti-ghosting. For example, when the key switches SW1, SW2 and SW4 are pressed at the same time, the voltage output end of the first output line 11a can detect the voltage frequency of the first scanning line 10a and the second scanning line 10b, and the second output line 11b can detect the voltage frequency of the first scanning line 10a. Due to the unidirectional conduction effect of the light-emitting diode D1, the current of the second scanning line 10b cannot be transmitted from the first scanning line 10a to the second scanning line 10b. Fig. 9 The dashed line shown flows into the second output line 11b ( Fig. 9 The dotted line in the figure shows the path of the current flowing into the second scan line 10b), so that the voltage output terminal 110 of the second output line 11b detects the voltage with the same frequency component as the voltage of the second scan line 10b, so as not to misjudge that the key switch SW5 is pressed. It can be understood that when the light emitting diode is not provided, the current may flow along Fig. 9 The dotted line shown flows, so that the first output line 11a and the second output line 11b both detect the voltage frequency components of the first scan line 10a and the second scan line 10b. At this time, the key switch SW5 that is not pressed will be mistakenly judged as being pressed. Therefore, the key detection circuit with a diode can prevent false detection.
[0082] A diode can be a normal diode or a light-emitting diode. A normal diode refers to a diode that does not have a light-emitting function. Figure 7 The diode shown is a normal diode. Figure 8The diode shown is a light emitting diode. In some embodiments, the light emitting diode can illuminate the key, thereby acting as a keyboard backlight. Optionally, the light emitting diode is arranged corresponding to the key switch, for example, located below the key. In some embodiments, the key is at least partially transparent, for example, the part displaying the letter can be set to be transparent, so that the light emitting diode can illuminate the corresponding letter. In some embodiments, the key can be fully transparent to present a crystal clear feeling and improve the aesthetics. In some embodiments, the key is opaque, and its inner wall is provided with a reflective surface (for example, coated with a reflective coating), which can reflect the light of the light emitting diode, so that the bottom of the key is illuminated, creating a sense of light around the key.
[0083] It is understandable that by serially inserting a light-emitting diode into the key detection circuit, the key can be illuminated while having an anti-ghosting effect, thereby simplifying the circuit structure and helping to reduce costs. At the same time, the simplified circuit structure is conducive to reducing the number of layers of the circuit board of the key output device having the circuit, thereby helping to reduce the thickness of the key input device and achieve a thinner and lighter electronic device.
[0084] When the diode is a light emitting diode, Figure 2 and Figure 3 In the illustrated embodiment, when the key switch is pressed and the corresponding scan line 10 is passed to a high level, the corresponding light emitting diode will pass current to be turned on, that is, the light emitting diode corresponding to the key will emit light only when the key is pressed. Figure 8 In the illustrated embodiment, regardless of whether the key switch is pressed or not, as long as the corresponding scan line 10 is supplied with a driving voltage signal, the light-emitting diode can emit light under the control of the driving voltage signal, which is beneficial to achieving a constantly on backlight effect or generating a lighting effect.
[0085] It is understandable that, within a period of time, the shorter the actual light emitting time of the light emitting diode is, the lower the light brightness actually observed by the human eye will be, thus affecting the backlight effect. Optionally, within a power-on cycle, the power-on time is greater than one-Mth of the power-on cycle, where M is the total number of scan lines 10 of the key detection circuit. On the one hand, the power-on time of the scan line 10 can be increased to ensure the accuracy of the detection. On the other hand, for the embodiment in which the light emitting diode can emit light as long as the scan line 10 is passed to a high level regardless of whether the key switch is pressed (for example Figure 8 and Fig.10The corresponding embodiment) can increase the light-emitting time of the light-emitting diode and increase the brightness perceived by the naked eye. Further optionally, in one power-on cycle, the power-on time is greater than half of the power-on cycle to further improve the effect. Further optionally, the driving voltage signal is continuously applied to the first voltage end 100 of all the scanning lines 10 to maximize the power-on time of the scanning line 10, improve the accuracy of the detection result, reduce the delay, and enable, for example, Figure 8 and Fig.10 The light emitting diode in the corresponding embodiment emits light continuously.
[0086] The key detection circuit includes a chip, and the first voltage terminal 100 and the voltage output terminal 110 are both connected to the IO interface of the chip. The chip can input driving voltage signals to multiple scanning lines according to control signals, and detect the voltage signal of the voltage output terminal 110 of the output line 11.
[0087] In some embodiments, the resistance of the first resistor is 100-1000 ohms, and the voltage input to the first voltage terminal 100 is about 5V. By setting the resistance of the first resistor to 100-1000 ohms, the current flowing through the light-emitting diode can be 1-10mA, which meets the current required for most light-emitting diodes used in keyboards to emit light. In other embodiments, the voltage input to the first voltage terminal 100 is about 3.3V. At this time, the resistance of the first resistor can be selected to be 30-500 ohms so that the light-emitting diode can emit light reliably.
[0088] The resistance value of the first resistor can be adjusted according to the current and voltage parameters actually required for the normal operation of the light emitting diode, so that the light emitting diode can emit light reliably.
[0089] In some embodiments, Fig.10 As shown, the switch circuit 12 also includes a second resistor connected in series with the key switch. Fig.10 R10 to R18 are the second resistors, and the resistance of the second resistor is greater than 0.2 times of the first resistor, that is, the ratio of the resistance of the second resistor to the resistance of the first resistor is greater than 0.2, so as to ensure the reliability of the light emitting diode during the key pressing process. Figure 8 In the embodiment shown, when two or more key switches on the same output line 11 are pressed simultaneously, the first resistors corresponding to the pressed key switches will be connected in parallel, and the resistance after the parallel connection is smaller than the resistance of the single first resistor, so that the resistance for voltage division with the light-emitting diode becomes smaller, and the current and voltage acting on the light-emitting diode will become larger. For example, referring to Figure 8When a high level is input to the first voltage terminal 100 of the first scan line 10a, SW1 and SW4 are pressed at the same time. When the resistance values of the first resistors R1 and R4 are the same, the resistance value of the two first resistors connected in parallel will be only half of the original value. Therefore, the current flowing through the light-emitting diode will increase, and the voltage acting on the light-emitting diode will also increase. The more key switches are pressed at the same time, the smaller the resistance value of the voltage divided by the light-emitting diode will be. In this way, the light-emitting diode may be burned out due to excessive current flowing through the light-emitting diode, or the brightness may be too high, shortening the service life.
[0090] This problem can be solved by providing a second resistor in series with the key switch in the switch circuit 12. Fig.10 In the illustrated embodiment, when multiple keys of the same output line 10 are pressed simultaneously, due to the presence of the second resistor, the resistance of the resistor that is finally divided with the light emitting diode will decrease relatively smaller, thereby ensuring the stability of the current flowing through the light emitting diode when the key is pressed, reducing the increase in the current, which is conducive to the reliable light emission of the light emitting diode, and the light emission effect is more consistent and stable, and it is also conducive to extending its service life. For example, when the first voltage terminal 100 of the first scanning line 10a inputs a high level and the key switches SW1 and SW4 are pressed simultaneously, the first resistor R1 is connected in parallel with the resistors R10, R13, and R4. Since the resistance of the resistors R10 and R13 is greater than 0.2 times the resistance of the resistors R1 and R4, the resistance after parallel connection will be greater than the resistance after only R1 and R4 are connected in parallel, reducing the increase in the current flowing through the light emitting diode.
[0091] In order to further ensure the stability of the light emitting diode, the resistance of the second resistor can be greater than or equal to 1 times, 2 times, 3 times, 4 times, 5 times or more times the resistance of the first resistor. Optionally, the resistance of the second resistor is greater than or equal to 2 times the resistance of the first resistor, so that after pressing the switch, the total current impact is less than 33%, the change amplitude of the current flowing through the light emitting diode is smaller, and no obvious optical and electrical effects are caused on the light emitting diode, thereby effectively ensuring the stability of the light emitting diode and the reliability of use.
[0092] Optionally, the resistance of the second resistor does not exceed 10 times the resistance of the first resistor. Because the detection input of the output line is generally in a high-resistance state, when the resistance of the detection end is too large, it will affect the accuracy of the detection value. Setting the resistance of the second resistor to be 10 times less than the resistance of the first resistor is beneficial to improving the accuracy of the detection value.
[0093] Optionally, the first resistor and the second resistor may be a common resistor, a carbon ink resistor, a silver paste printed resistor, or other resistors that can be used for thin film circuits.
[0094] The color of the light emitted by the light emitting diode is not limited, for example, it can be white, red, blue or green. When the high level is continuously passed to the scan line 10, the light emitting diode will continue to emit light, achieving a constantly bright backlight effect. Optionally, the color of the light emitted by all the light emitting diodes is the same, or the light colors of at least two light emitting diodes are different. The colors of the light emitting diodes at different positions can be set as needed.
[0095] It can be understood that in this embodiment, the key detection can be performed according to steps S21 to S23 throughout the entire working period of the key detection circuit, without setting the first time period t10 in embodiment 2.
[0096] Example 2
[0097] This embodiment provides a key detection method, which uses the key detection circuit with a light emitting diode in embodiment 1 ( Figure 8 and Fig.10 The key detection method in Embodiment 1 is referred to as the first key detection method, and the key detection method in Embodiment 2 is referred to as the second key detection method.
[0098] refer to Fig.11 In this embodiment, the key detection method includes the following steps:
[0099] S1. Drive the light emitting diode to emit light as required within the first time period t10.
[0100] S2. Perform key detection in the second time period t11.
[0101] S3. Repeat steps S1 and S2 in sequence.
[0102] The key detection method described in step S2 may refer to the key detection method in embodiment 1, that is, the key detection includes the following steps:
[0103] S21. A driving voltage signal is input to the first voltage terminal 100 of all scan lines 10 in a preset manner, and the frequency components of the driving voltage signals input to different scan lines 10 are different, and the voltage signal of the voltage output terminal 110 of all output lines 11 is continuously received;
[0104] S22. Sampling the received voltage signal of the voltage output terminal 110 to obtain frequency component information of the voltage signal of different voltage output terminals 110;
[0105] S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
[0106] Similarly, in step S21, the difference in center frequency of the driving voltage signal input to the first voltage end 100 of each scanning line 10 can be selected to be no less than one percent of the maximum sampling rate of the detection line, so that the frequency components of the voltage signal have a large difference, which is convenient for accurately identifying the frequency component information of the voltage output end 110 and preventing confusion caused by the frequency components of the driving voltage signal being too close.
[0107] Similarly, step S23 may include the following steps:
[0108] S231. According to the frequency component information of the voltage signal at the voltage output terminal 110 of the output line 11, the scanning line 10 into which the driving voltage signal of the corresponding frequency component is input is identified;
[0109] S232. Identify the key switch connected between the output line 11 and the scan line 10 having the same voltage frequency component, and the key switch is the triggered key switch.
[0110] In the second key detection method, all light emitting diodes first emit light as needed in the first time period t10, for example, they can be always on, or form a breathing or flashing light effect, and then the key detection is performed in the second time period t11, which increases the light emission mode and improves the aesthetics. At the same time, in the second time period t11, the driving voltage signal can be passed to all the scanning lines 10, and all the output lines 11 can be detected. Therefore, the detection time of the voltage of the output line 11 when the key detection is performed can be guaranteed, and the reliability of the detection result in the second time period t11 is improved.
[0111] In the first time period t10, a high level may be input to the first voltage terminals 100 of all the scan lines 10 according to the control signal to drive all the light emitting diodes to emit light according to the control signal, for example, to continuously emit light or produce a light effect.
[0112] In some embodiments, within the first time period t10, a high level is continuously input to the first voltage terminal 100 of all the scan lines 10 to drive all the light-emitting diodes to emit light. It can be understood that, in this embodiment, the light-emitting diodes continue to emit light within the first preset time period t10 to maximize the brightness of the light observed by the naked eye.
[0113] In other embodiments, in the first time period t10, the light-emitting diode is controlled to form a changing light effect by controlling the power-on mode of the scan line 10, for example, a high level is input to the first voltage terminal 100 of all the scan lines 10 according to the control signal, and the time and sequence of the high level input can be set as needed, for example, a high level is input to each scan line 10 for a preset time according to a preset sequence, so that each light-emitting diode emits light as needed, for example, it can emit light in sequence, emit light at intervals, etc., to produce a variety of light effects, and each light-emitting diode is controlled to emit light as needed, for example, the light-emitting diode is controlled by PWM to produce light effects such as flashing or flowing water. Optionally, the first time period t10 is greater than or equal to the second time period t11, so that the time of the second time period t11 is not too long. It can be understood that when the key detection is performed in the second time period t11, the light-emitting diode will continue to be powered on and emit light. Setting the first time period t10 to be greater than or equal to the second time period t11 can make the time of the second time period t11 not too long, thereby improving the continuity of the light effect change. Further optionally, the time ratio of the first time period t10 to the light cycle T2 is not less than 80%, so as to further reduce the time length of the second time period t11, reduce the recognition of the light emission of the second time period t11 by the human eye, and better ensure the continuity of the lighting effect change. Further optionally, the time ratio of the first time period t10 to the light cycle T2 is not less than 90%. Further optionally, the time ratio of the first time period t10 to the light cycle T2 is not greater than 99.9%, so that the second time period t11 has enough time for detection.
[0114] Optionally, the duration of the light emitting period T2 is no greater than 41.6 ms to ensure that under normal operation, it can be detected that the key is pressed no matter when the key is pressed by a human hand.
[0115] It is understood that the keyboard has a light-emitting unit that can illuminate the keys to achieve backlighting. The light-emitting unit is located below the keys and emits light toward the side where the keys are located. Generally, each key is provided with a corresponding light-emitting unit. The backlight color can be monochrome or colorful. When the backlight color is monochrome, for example, it can be white, red, green, blue or other colors. At this time, the light-emitting unit can include only one light-emitting diode, which is connected in series. Figure 8 and Fig.10 In the circuit shown, light emission is realized. When the backlight color is colorful, richer color effects can be achieved, for example, the color can change gradually, making the backlight effect more cool. At this time, the light-emitting unit can include at least two light-emitting diodes that emit light of different colors. The light-emitting diodes of different colors can emit one color alone, or they can be mixed to emit new colors, thereby making the colors richer.
[0116] Example 3
[0117] This embodiment introduces a key detection circuit with multi-color lighting effect.
[0118] The key detection circuit with multi-color luminous effect has a structure basically consistent with the key detection circuit described above, except that the light-emitting unit of the key detection circuit with multi-color luminous effect includes at least two light-emitting diodes with different luminous colors, one of which is connected in series with the first resistor, and allows the current to be unidirectionally conducted toward the first resistor, and emits light under the drive of the signal passed into the scan line 10, and the other light-emitting diodes are controlled by other control circuits to emit light, and can cooperate with the light-emitting diode connected in series with the first resistor to produce various luminous effects. For the convenience of description, the light-emitting diodes of the light-emitting unit other than the light-emitting diode connected in series with the first resistor are referred to as other light-emitting diodes.
[0119] In this way, the light of different colors of the light emitting diode connected in series with the first resistor and other light emitting diodes can be combined to produce colorful colors, forming a more diverse lighting effect. Optionally, the light emitting unit includes three light emitting diodes, and the three light emitting diodes emit red, green and blue light (the three primary colors of light) respectively, so that basically any color recognizable by the human eye can be combined.
[0120] In some embodiments, the color of the light emitted by the light emitting diode connected in series with the first resistor is red. It is understandable that, since key detection is required, the light emitting diode connected in series with the first resistor must be passed into a high level for a certain period of time, which causes the light emitting diode to emit light during key detection, even if the light emitting diode does not need to emit light at this time under the preset light control mode. Since the human eye is less sensitive to red light than other colors (blue and green), therefore, setting the color of the light emitted by the light emitting diode connected in series with the first resistor to red can reduce the light of the light emitting diode connected in series with the first resistor during key detection from attracting the attention of the human eye, thereby not affecting the keyboard to emit light in a predetermined light emitting mode.
[0121] The key input device further includes a control circuit 3 for controlling the light emission of other light emitting diodes. Each of the other light emitting diodes is arranged in a control circuit so that each light emitting diode can be independently controlled to emit light. Fig.12 As shown, the control circuit 3 includes a third resistor (R19 in the figure), a third voltage terminal 30 for inputting a driving voltage signal and a fourth voltage terminal 31 for grounding. The light-emitting diode (D10 in the figure) and the third resistor are connected in series between the third voltage terminal 30 and the fourth voltage terminal 31 in sequence. Obviously, the positive pole of the light-emitting diode is close to the third voltage terminal 30, so that the light-emitting diode can emit light under the voltage drive of the third voltage terminal 30.
[0122] The first voltage terminal 100, the third voltage terminal 30 and the voltage output terminal 110 are all connected to the IO interface of the chip. The chip inputs a driving voltage signal to the plurality of scanning lines 10 and detects the voltage signal of the voltage output terminal 110 of the output line 11. The chip simultaneously inputs a driving voltage signal to the third voltage terminal 30 according to the control instruction to control the light-emitting diode in the control circuit to emit light according to the control signal. It is understandable that the number of chips is not limited to one. For example, when the number of IO interfaces of the chip is insufficient, more chips can be used. In addition, the key detection circuit and the control circuit 3 can share a chip, or they can be provided with independent chips respectively.
[0123] The specific structure of the key detection circuit can be referred to the above description and will not be repeated here.
[0124] Since the light-emitting unit includes at least two light-emitting diodes, in the above-mentioned step S1, a driving voltage signal is input to the first voltage end 100 of the scanning line 10 and the third voltage end 30 of the control circuit 3 according to the control signal within the first time period t10, so as to control all the light-emitting diodes to emit light according to the control signal. The control signal can be issued by a processor of the electronic device, which can be a built-in light-emitting control program of the system, or a corresponding control signal generated according to a control instruction issued by a user. After the chip receives the corresponding control signal, a high level is input to the scanning line 10 and the third voltage end 30 according to the control signal, so that each light-emitting diode emits light at the required time.
[0125] In the second time period t11, in some embodiments, other light-emitting diodes are controlled to emit light (drive voltage signals are input) according to the control signal to improve the continuity and brightness of the light-emitting display effect, covering the light emitted by the light-emitting diodes connected in series with the first resistor. In other embodiments, other light-emitting diodes can also be controlled not to emit light (drive voltage signals are not input). Since the second time period t11 is relatively short, it has less impact on the light-emitting display effect and is more energy-efficient.
[0126] Example 4
[0127] This embodiment provides a key input device, which performs key detection by the key detection method described above, or includes the key detection circuit described above. The key input device may be, for example, a keyboard.
[0128] The key input device includes a key circuit board, such as Fig.13As shown, the key circuit board includes a first circuit board 40 and a second circuit board 41 which are spaced apart from each other, and a spacer layer 42 connected between the first circuit board 40 and the second circuit board 41. The first circuit board 40 is located above the second circuit board 41, and is provided with an output line 11 and a second resistor (if any). The second circuit board 41 is provided with a scanning line 10, a light-emitting diode 46 and a first resistor (not shown). Conductive lines (such as silver paste lines) can be arranged on the first circuit board 40 and the second circuit board 41 to form the scanning line 10 and the output line 11.
[0129] The key switch is connected between the first circuit board 40 and the second circuit board 41. Fig.13 As shown, the key switch includes a first contact 430 located on the first circuit board 40 and electrically connected to the output line 11, and a second contact 431 located on the second circuit board 41 and electrically connected to the scan line 10. The two contacts are arranged with a relative spacing, and the spacing layer 42 is provided with a cavity 420 for exposing the first contact 430 and the second contact 431. A reset member 44 and a key 45 are correspondingly arranged above the key switch. The reset member 44 can be made of elastic materials such as rubber or silicone. When the key 45 is pressed, the key 45 presses the reset member 44 and the key switch, so that the first contact 430 and the second contact 431 are in contact, and the scan line 10 and the output line 11 are connected. When the key 45 is released, the key 45 is reset under the elastic force of the reset member 44, and the scan line 10 and the output line 11 are disconnected.
[0130] The light emitting diode 46 is arranged on the second circuit board 41, and a avoidance hole 400 for exposing the light emitting diode 46 is opened on the spacer layer 42 and the first circuit board 40. The light emitting diode 46 is arranged in the avoidance hole 400, and its light can be emitted toward the key 45. In some embodiments, a light-transmitting area 450 made of transparent material is provided on the key 45. The light-transmitting area 450 can be consistent with the letters / graphics marked on the key 45, so that the light of the light emitting diode 46 can illuminate the letters / graphics, which is more beautiful. The key 45 can also be set to be fully transparent. In this case, the part of the key 45 other than the part marked with letters / graphics forms the light-transmitting area 450 (that is, the light-transmitting area 450 includes the case where the key 45 is partially transparent or fully transparent). In other embodiments, refer to Fig.14 A reflective layer 451 is provided on the inner surface of the key 45. The reflective layer 451 has a reflective surface that reflects the light of the light-emitting diode 46. The area around the key 45 is illuminated by the reflected light to improve the aesthetics. In other embodiments, if the inner surface of the key 45 itself has a good reflective effect, the reflective layer 451 may not be provided, and the inner surface of the key 45 can be directly used as the reflective surface.
[0131] It is understandable that when the light-emitting unit includes a plurality of light-emitting diodes, the other diodes and the corresponding control circuit and the third resistor can be arranged on the second circuit board 41 , and of course can also be arranged on the first circuit board 40 .
[0132] Optionally, the first circuit board 40 and the second circuit board 41 are both thin film circuits.
[0133] In the present invention, only two layers of circuit boards are needed to realize the functions of anti-ghosting key detection and backlight display, which simplifies the structure of the circuit board, makes the circuit design of the key input device simpler, and the overall thickness of the circuit board can be made smaller. In this way, the key input device can also be made smaller. For products such as notebooks that have high requirements for lightness and thinness, the thickness of the notebook can be effectively reduced, thereby improving the competitiveness of the product.
[0134] Example 5
[0135] This embodiment provides an electronic device, which includes the key detection circuit or the key input device described above. The electronic device may be, for example, a mobile phone with keys, a laptop computer, a desktop computer, a game console or other devices with keys.
[0136] Example 6
[0137] This embodiment proposes a processor-readable storage medium, which is used to store processor-executable instructions. When the processor-executable instructions are loaded and executed by the processor, the key detection method described above can be implemented. It is understandable that the key input device and / or electronic device may include the processor-readable storage medium. The processor may be, for example, a computer, an embedded system, or a single chip.
[0138] It should be noted that, in the absence of conflict, the various embodiments in this document can be combined with each other to obtain more implementation plans.
[0139] The above are only specific embodiments of the present invention, and any other improvements made based on the concept of the present invention are considered to be within the protection scope of the present invention.
Claims
1. A key detection method, characterized in that: The key detection method is performed by a key detection circuit, the key detection circuit comprising a plurality of scan lines (10) arranged at intervals and a plurality of output lines (11) arranged at intervals, the plurality of output lines (11) and the plurality of scan lines (10) being arranged in a staggered manner to form a matrix circuit, the scan lines (10) having a first voltage end (100) and a second voltage end (101), the output lines (11) having a voltage output end (110) and a plurality of switch circuits (12) respectively connected to the plurality of scan lines (10), the switch circuits (12) comprising key switches; The key detection method comprises the following steps: S21. According to a preset method, a driving voltage signal is input to the first voltage end (100) of all the scanning lines (10), and the frequency components of the driving voltage signals input to different scanning lines (10) are different, and the voltage signals of the voltage output ends (110) of all the output lines (11) are continuously received; S22. Sampling the voltage signal received from the voltage output terminal (110) to obtain frequency component information of the voltage signal of different voltage output terminals (110); S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
2. The key detection method according to claim 1, characterized in that: In the step S21, the difference in the center frequency of the driving voltage signal input to the first voltage end (100) of each scanning line (10) is not less than 1% of the maximum sampling rate of the detection line.
3. The key detection method according to claim 1, characterized in that: In the step S21, applying a driving voltage signal to the first voltage ends (100) of all the scanning lines (10) in a preset manner comprises the following steps: A driving voltage signal is continuously supplied to the first voltage ends (100) of all the scanning lines (10); or, a driving voltage signal is supplied to the scanning lines (10) according to a preset power-on cycle of each scanning line (10), wherein the power-on cycle includes a power-on time and a non-power-on time, and within a certain time, all the scanning lines (10) or at least two of the scanning lines (10) are supplied with the driving voltage signal at the same time.
4. The key detection method according to claim 1, characterized in that: The step S23 comprises the following steps: S231. Identify the scanning line (10) into which the driving voltage signal of the corresponding frequency component is input according to the frequency component information of the voltage signal at the voltage output terminal (110) of the output line (11); S232. Identify the key switch connected between the output line (11) and the scanning line (10) having the same voltage frequency component, and the key switch is the triggered key switch.
5. The key detection method according to any one of claims 1 to 4, characterized in that: The second voltage terminal (101) is a ground voltage terminal, the scanning line (10) comprises a main line (102) and a plurality of branch lines (103) connected in parallel to the main line (102), the main line (102) comprises the first voltage terminal (100), the branch lines (103) comprise the second voltage terminal (101), and each branch line (103) is provided with a corresponding switch circuit (12); A diode and a first resistor are sequentially arranged in series between the connection position of the branch line (103) and the main line (102) and the second voltage terminal (101), the diode allows current to flow unidirectionally toward the first resistor, and the diode is a common diode or a light-emitting diode used to realize keyboard backlight; the switch circuit (12) is connected to the portion of the branch line (103) located between the diode and the first resistor; or, A first resistor is provided between the connection position of the branch line (103) and the main line (102) and the second voltage terminal (101); the switch circuit (12) is connected to the portion of the branch line (103) located between the first resistor and the connection position of the branch line (103) and the main line (102); the switch circuit (12) comprises a diode connected in series with the key switch, the diode allows current to be conducted unidirectionally toward the voltage output terminal (110); the diode is a common diode or a light emitting diode.
6. The key detection method according to any one of claims 1 to 4, characterized in that: The scanning line (10) comprises a main line (102) and a plurality of branch lines (103) connected in parallel to the main line (102); the main line (102) comprises the first voltage end (100); the branch lines (103) comprise the second voltage end (101); each branch line (103) is provided with a corresponding switch circuit (12); the switch circuit (12) is connected to the second voltage end (101) of the branch line (103); and the switch circuit (12) comprises a diode connected in series with the key switch.
7. A key detection method, characterized in that: The key detection method is performed by a key detection circuit, the key detection circuit comprising a plurality of scan lines (10) arranged at intervals and a plurality of output lines (11) arranged at intervals, the plurality of output lines (11) and the plurality of scan lines (10) being arranged in a staggered manner to form a matrix circuit, the scan lines (10) having a first voltage terminal (100) and a second voltage terminal (101), the key detection circuit comprising a light emitting diode for keyboard backlight, the output lines (11) having a voltage output terminal (110) and a plurality of switch circuits (12) respectively connected to the plurality of scan lines (10), the switch circuit (12) comprising a key switch; The key detection method comprises the following steps: S1. Driving the light emitting diode to emit light as needed within the first time period t10; S2. Perform key detection in the second time period t11; S3. Repeat steps S1 and S2 in sequence; In step S2, key detection includes the following steps: S21. According to a preset method, a driving voltage signal is input to the first voltage end (100) of all the scanning lines (10), and the frequency components of the driving voltage signals input to different scanning lines (10) are different, and the voltage signals of the voltage output ends (110) of all the output lines (11) are continuously received; S22. Sampling the voltage signal received from the voltage output terminal (110) to obtain frequency component information of the voltage signal of different voltage output terminals (110); S23. Determine the triggered key switch according to the frequency component information of the voltage signal.
8. The key detection method according to claim 7, characterized in that: In the step S21, the difference in the center frequency of the driving voltage signal input to the first voltage end (100) of each scanning line (10) is not less than 1% of the maximum sampling rate of the detection line.
9. The key detection method according to claim 7, characterized in that: In the step S21, applying a driving voltage signal to the first voltage ends (100) of all the scanning lines (10) in a preset manner comprises the following steps: A driving voltage signal is continuously supplied to the first voltage ends (100) of all the scanning lines (10); or, a driving voltage signal is supplied to the scanning lines (10) according to a preset power-on cycle of each scanning line (10), wherein the power-on cycle includes a power-on time and a non-power-on time, and within a certain time, all the scanning lines (10) or at least two of the scanning lines (10) are supplied with the driving voltage signal at the same time.
10. The key detection method according to claim 7, characterized in that: The step S23 comprises the following steps: S231. Identify the scanning line (10) into which the driving voltage signal of the corresponding frequency component is input according to the frequency component information of the voltage signal at the voltage output terminal (110) of the output line (11); S232. Identify the key switch connected between the output line (11) and the scanning line (10) having the same voltage frequency component, and the key switch is the triggered key switch.
11. The key detection method according to any one of claims 7 to 10, characterized in that: The first time period t10 and the second time period t11 constitute a light-emitting cycle T2. In the step S1, the light-emitting diode is controlled to produce a light effect within the first time period t10, or a high level is continuously input to the first voltage terminals (100) of all the scanning lines (10) to drive all the light-emitting diodes to continuously emit light. The first time period t10 is greater than or equal to the second time period t11.
12. The key detection method according to claim 11, characterized in that: The first time period t10 and the second time period t11 form a light-emitting cycle T2, and the time length of the light-emitting cycle T2 is less than or equal to 41.6 ms.
13. The key detection method according to any one of claims 7 to 10, characterized in that: The second voltage terminal (101) is a ground voltage terminal, the scanning line (10) comprises a main line (102) and a plurality of branch lines (103) connected in parallel to the main line (102), the main line (102) comprises the first voltage terminal (100), the branch lines (103) comprise the second voltage terminal (101), and each branch line (103) is provided with a corresponding switch circuit (12); The branch line (103) is further provided with a first resistor connected in series with the light emitting diode. The light emitting diode and the first resistor are arranged in sequence between the connection position of the branch line (103) and the main line (102) and the second voltage terminal (101). The light emitting diode allows current to flow unidirectionally toward the first resistor. The switch circuit (12) is connected to the portion of the scanning line (10) located between the diode and the first resistor.
Citation Information
Patent Citations
Keyboard scanning device as well as key matrix circuit and scanning method thereof
CN102142846A
Scanning device and scanning method of touch signal
CN103268162A
Matrix circuit and scan method
CN103560796A
Touch sensing method, touch sensing controller and touch sensing apparatus having same
CN107003772A
Operation recognition device and method and intelligent terminal with device
CN108132728A
