[go: up one dir, main page]

CN212180969U - Key detection circuit - Google Patents

Key detection circuit Download PDF

Info

Publication number
CN212180969U
CN212180969U CN202020190091.0U CN202020190091U CN212180969U CN 212180969 U CN212180969 U CN 212180969U CN 202020190091 U CN202020190091 U CN 202020190091U CN 212180969 U CN212180969 U CN 212180969U
Authority
CN
China
Prior art keywords
key switch
switch unit
key
detection circuit
resistors
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202020190091.0U
Other languages
Chinese (zh)
Inventor
王志懋
李亮
管恩慧
李咸珍
李雪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BOE Technology Group Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202020190091.0U priority Critical patent/CN212180969U/en
Application granted granted Critical
Publication of CN212180969U publication Critical patent/CN212180969U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

本实用新型提供一种按键检测电路,包括第一按键开关单元、至少一个第二按键开关单元和至少一个辅助检测电路;第一按键开关单元,包括串联的第一按键开关和第一电阻;第一按键开关单元的第一端经过第三电阻连接第一电压端,第一按键开关单元的第二端连接参考电压端;第二按键开关单元,包括串联的第二按键开关和第二电阻;第二按键开关单元的第一端经过第三电阻连接第一电压端,第二按键开关单元的第二端连接辅助检测电路;辅助检测电路,用于根据第二按键开关单元的第二端的电压信号,确定第二按键开关单元中的第二按键开关是否被按下;其中,第一按键开关单元的第一端和第二按键开关单元的第一端均连接按键检测电路的模数转换接口。

Figure 202020190091

The utility model provides a key detection circuit, comprising a first key switch unit, at least one second key switch unit and at least one auxiliary detection circuit; the first key switch unit includes a first key switch and a first resistor connected in series; The first terminal of a key switch unit is connected to the first voltage terminal through a third resistor, and the second terminal of the first key switch unit is connected to the reference voltage terminal; the second key switch unit includes a second key switch and a second resistor connected in series; The first end of the second key switch unit is connected to the first voltage end through the third resistor, and the second end of the second key switch unit is connected to the auxiliary detection circuit; the auxiliary detection circuit is used for according to the voltage of the second end of the second key switch unit signal to determine whether the second key switch in the second key switch unit is pressed; wherein, the first end of the first key switch unit and the first end of the second key switch unit are both connected to the analog-to-digital conversion interface of the key detection circuit .

Figure 202020190091

Description

按键检测电路key detection circuit

技术领域technical field

本实用新型涉及检测技术领域,尤其涉及一种按键检测电路。The utility model relates to the technical field of detection, in particular to a key detection circuit.

背景技术Background technique

常见的按键检测电路有矩阵扫描和电压检测两种。其中,矩阵扫描的方式所需I/O接口较多,不适合按键较多且I/O资源有限的场合;电压检测的方式是利用电阻分压的原理,不同按键按下后对应不同电压,实现单个模数转换接口(ADC)检测多个按键,但随着按键的增多,相邻按键之间的分压电压值必定差距变小,外界干扰极易造成检测电压波动,以致造成按键误检测。Common key detection circuits include matrix scanning and voltage detection. Among them, the matrix scanning method requires many I/O interfaces, which is not suitable for occasions with many buttons and limited I/O resources; the voltage detection method uses the principle of resistance division, and different buttons correspond to different voltages after being pressed. A single analog-to-digital conversion interface (ADC) is implemented to detect multiple buttons, but as the number of buttons increases, the difference between the voltage divider values between adjacent buttons must become smaller, and external interference can easily cause fluctuations in the detection voltage, resulting in false button detection. .

实用新型内容Utility model content

有鉴于此,本实用新型实施例的目的之一在于,提出一种按键检测电路,以解决上述的问题。In view of this, one of the purposes of the embodiments of the present invention is to provide a key detection circuit to solve the above problems.

基于上述目的,本实用新型实施例提供了按键检测电路,包括第一按键开关单元、至少一个第二按键开关单元和至少一个辅助检测电路;Based on the above purpose, an embodiment of the present invention provides a key detection circuit, including a first key switch unit, at least one second key switch unit, and at least one auxiliary detection circuit;

所述第一按键开关单元,包括串联的第一按键开关和第一电阻;所述第一按键开关单元的第一端经过第三电阻连接第一电压端,所述第一按键开关单元的第二端连接参考电压端;The first key switch unit includes a first key switch and a first resistor connected in series; the first end of the first key switch unit is connected to the first voltage terminal through the third resistor, and the first key switch unit of the first key switch unit is connected to the first voltage terminal. The two terminals are connected to the reference voltage terminal;

所述第二按键开关单元,包括串联的第二按键开关和第二电阻;所述第二按键开关单元的第一端经过第三电阻连接第一电压端,所述第二按键开关单元的第二端连接所述辅助检测电路;The second key switch unit includes a second key switch and a second resistor connected in series; the first end of the second key switch unit is connected to the first voltage terminal through the third resistor, and the first end of the second key switch unit is connected to the first voltage terminal. The two ends are connected to the auxiliary detection circuit;

所述辅助检测电路,用于根据所述第二按键开关单元的第二端的电压信号,确定所述第二按键开关单元中的第二按键开关是否被按下;The auxiliary detection circuit is configured to determine whether the second key switch in the second key switch unit is pressed according to the voltage signal of the second terminal of the second key switch unit;

其中,所述第一按键开关单元的第一端和所述第二按键开关单元的第一端均连接所述按键检测电路的模数转换接口。Wherein, the first end of the first key switch unit and the first end of the second key switch unit are both connected to the analog-to-digital conversion interface of the key detection circuit.

可选地,所述第一按键开关单元,包括若干第一按键开关和若干第一电阻;所述第一按键开关与所述第一电阻一一对应地串联,形成若干第一串联支路;若干所述第一串联支路并联设置,若干所述第一电阻的阻值各不相同。Optionally, the first key switch unit includes several first key switches and several first resistors; the first key switches and the first resistors are connected in series in one-to-one correspondence to form several first series branches; A plurality of the first series branches are arranged in parallel, and the resistance values of the plurality of the first resistors are different from each other.

可选地,所述第二按键开关单元,包括若干第二按键开关和若干第二电阻;所述第二按键开关与所述第二电阻一一对应地串联,形成若干第二串联支路;若干所述第二串联支路并联设置,若干所述第二电阻的阻值各不相同。Optionally, the second key switch unit includes several second key switches and several second resistors; the second key switches and the second resistors are connected in series in one-to-one correspondence to form several second series branches; A plurality of the second series branches are arranged in parallel, and the resistance values of the plurality of the second resistors are different from each other.

可选地,所述第一电阻的阻值与所述第二电阻的阻值相等。Optionally, the resistance value of the first resistor is equal to the resistance value of the second resistor.

可选地,所述第一按键开关单元,包括若干第一按键开关和若干第一电阻;所述第一按键开关与所述第一电阻一一对应地串联,形成若干第一串联支路;若干所述第一串联支路并联设置,若干所述第一电阻的阻值各不相同;Optionally, the first key switch unit includes several first key switches and several first resistors; the first key switches and the first resistors are connected in series in one-to-one correspondence to form several first series branches; A plurality of the first series branches are arranged in parallel, and the resistance values of the plurality of the first resistors are different;

所述第二按键开关单元,包括若干第二按键开关和若干第二电阻;所述第二按键开关与所述第二电阻一一对应地串联,形成若干第二串联支路;若干所述第二串联支路并联设置,若干所述第二电阻的阻值各不相同;The second key switch unit includes several second key switches and several second resistors; the second key switches and the second resistors are connected in series in one-to-one correspondence to form several second series branches; several of the first Two series branches are arranged in parallel, and the resistance values of the plurality of second resistors are different;

其中,若干所述第一电阻的阻值与若干所述第二电阻的阻值一一对应地相等。Wherein, the resistance values of the first resistors are equal to the resistance values of the second resistors in a one-to-one correspondence.

可选地,所述辅助检测电路包括第一控制单元和晶体管,所述第二按键开关单元的第二端连接所述晶体管的控制极,所述晶体管的第一极连接所述第一控制单元的I/O接口,所述晶体管的第二极连接参考电压端,所述晶体管的第一极经过第四电阻连接第二电压端。Optionally, the auxiliary detection circuit includes a first control unit and a transistor, the second end of the second key switch unit is connected to the control electrode of the transistor, and the first electrode of the transistor is connected to the first control unit The I/O interface of the transistor, the second pole of the transistor is connected to the reference voltage terminal, and the first pole of the transistor is connected to the second voltage terminal through a fourth resistor.

可选地,所述按键检测电路还包括第二控制单元,所述第二控制单元包括模数转换模块,所述模数转换接口与所述模数转换模块连接;Optionally, the button detection circuit further includes a second control unit, the second control unit includes an analog-to-digital conversion module, and the analog-to-digital conversion interface is connected to the analog-to-digital conversion module;

所述模数转换模块用于将所述模数转换接口的电压信号转换为数字信号,所述第二控制单元用于根据所述数字信号,结合所述辅助检测电路的检测结果,确定所述第一按键开关单元和所述第二按键开关单元中是否存在按键开关被按下或者确定所述第一按键开关单元和所述第二按键开关单元中被按下的按键开关。The analog-to-digital conversion module is used to convert the voltage signal of the analog-to-digital conversion interface into a digital signal, and the second control unit is used to determine the Whether a key switch is pressed in the first key switch unit and the second key switch unit is determined, or it is determined that the key switch in the first key switch unit and the second key switch unit is pressed.

可选地,所述第一控制单元和第二控制单元中的至少其一为MCU芯片或SOC芯片。Optionally, at least one of the first control unit and the second control unit is an MCU chip or an SOC chip.

可选地,所述第一控制单元和第二控制单元复用为一个控制芯片。Optionally, the first control unit and the second control unit are multiplexed into one control chip.

可选地,所述第二按键开关单元和所述辅助检测电路的数量均为多个;多个所述辅助检测电路中的第一控制单元复用为一个控制芯片。Optionally, the number of the second key switch unit and the auxiliary detection circuit is multiple; the first control units in the multiple auxiliary detection circuits are multiplexed into one control chip.

从上面所述可以看出,本实用新型实施例提供的按键检测电路,通过设计第一按键开关单元和第二按键开关单元,并使辅助检测电路检测所述第二按键开关单元中是否存在按键开关被按下,使得当所述按键检测电路的模数转换接口ADC检测到相应的电压信号时,结合辅助检测电路的检测结果,能够得到是第一按键开关单元还是第二按键开关单元中存在被按下的按键开关,从而确定具体的被按下的按键开关,进而完成按键检测。采用该结构的按键检测电路,可以利用辅助检测电路的检测结果,实现待检测按键分块分时检测,从而提高了检测电路的稳定性和检测精度。It can be seen from the above that in the key detection circuit provided by the embodiment of the present invention, the first key switch unit and the second key switch unit are designed, and the auxiliary detection circuit detects whether there is a key in the second key switch unit. The switch is pressed, so that when the analog-to-digital conversion interface ADC of the button detection circuit detects a corresponding voltage signal, combined with the detection result of the auxiliary detection circuit, it can be obtained whether the first button switch unit or the second button switch unit exists. The pressed key switch, so as to determine the specific pressed key switch, and then complete the key detection. By adopting the button detection circuit of this structure, the detection result of the auxiliary detection circuit can be used to realize the block and time-sharing detection of the button to be detected, thereby improving the stability and detection accuracy of the detection circuit.

附图说明Description of drawings

为了更清楚地说明本实用新型实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本实用新型的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present utility model or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are just some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.

图1为本实用新型提供的一个实施例的电路结构示意图;1 is a schematic diagram of a circuit structure of an embodiment provided by the present invention;

图2为本实用新型提供的另一个实施例的电路结构示意图;2 is a schematic diagram of a circuit structure of another embodiment provided by the present invention;

图3为本实用新型提供的又一个实施例的电路结构示意图。FIG. 3 is a schematic diagram of a circuit structure of another embodiment provided by the present invention.

具体实施方式Detailed ways

为使本实用新型的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本实用新型进一步详细说明。In order to make the purpose, technical solutions and advantages of the present utility model more clearly understood, the present utility model will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

需要说明的是,除非另外定义,本实用新型实施例使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention shall have the usual meanings understood by those with ordinary skill in the art to which the present disclosure belongs. As used in this disclosure, "first," "second," and similar terms do not denote any order, quantity, or importance, but are merely used to distinguish the various components. "Comprises" or "comprising" and similar words mean that the elements or things appearing before the word encompass the elements or things recited after the word and their equivalents, but do not exclude other elements or things. Words like "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "Down", "Left", "Right", etc. are only used to represent the relative positional relationship, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

参考图1所示,所述按键检测电路,包括第一按键开关单元101、第二按键开关单元102和辅助检测电路103;Referring to FIG. 1 , the key detection circuit includes a first key switch unit 101 , a second key switch unit 102 and an auxiliary detection circuit 103 ;

所述第一按键开关单元101,包括串联的第一按键开关(K1a~K1e)和第一电阻(R1a~R1e);所述第一按键开关单元101的第一端经过第三电阻R3连接第一电压端VCC,所述第一按键开关单元101的第二端连接参考电压端GND;The first key switch unit 101 includes first key switches (K1a-K1e) and first resistors (R1a-R1e) connected in series; the first end of the first key switch unit 101 is connected to the first key switch unit 101 through a third resistor R3 a voltage terminal VCC, the second terminal of the first key switch unit 101 is connected to the reference voltage terminal GND;

所述第二按键开关单元102,包括串联的第二按键开关(K2a~K2e)和第二电阻(R2a~R2e);所述第二按键开关单元102的第一端经过第三电阻R3连接第一电压端VCC,所述第二按键开关单元102的第二端连接所述辅助检测电路103;The second key switch unit 102 includes second key switches (K2a-K2e) and second resistors (R2a-R2e) connected in series; the first end of the second key switch unit 102 is connected to the second key switch via the third resistor R3. a voltage terminal VCC, the second terminal of the second key switch unit 102 is connected to the auxiliary detection circuit 103;

所述辅助检测电路103,用于根据所述第二按键开关单元102的第二端的电压信号,确定所述第二按键开关单元102中的第二按键开关(K2a~K2e)是否被按下;The auxiliary detection circuit 103 is configured to determine whether the second key switches (K2a-K2e) in the second key switch unit 102 are pressed according to the voltage signal of the second terminal of the second key switch unit 102;

其中,所述第一按键开关单元101的第一端和所述第二按键开关单元102的第一端均连接所述按键检测电路的模数转换接口ADC。The first end of the first key switch unit 101 and the first end of the second key switch unit 102 are both connected to the analog-to-digital conversion interface ADC of the key detection circuit.

本实施例中,所述按键检测电路,通过设计第一按键开关单元和第二按键开关单元,并使辅助检测电路检测所述第二按键开关单元中是否存在按键开关被按下,使得当所述按键检测电路的模数转换接口ADC检测到相应的电压信号时,结合辅助检测电路的检测结果(第二按键开关是否被按下),能够得到是第一按键开关单元还是第二按键开关单元中存在被按下的按键开关,从而确定具体的被按下的按键开关,进而完成按键检测。采用该结构的案件检测电路,可以利用辅助检测电路的检测结果,实现待检测按键分块分时检测,从而提高了检测电路的稳定性和检测精度。In this embodiment, in the key detection circuit, the first key switch unit and the second key switch unit are designed, and the auxiliary detection circuit detects whether a key switch is pressed in the second key switch unit, so that when all the When the analog-to-digital conversion interface ADC of the key detection circuit detects the corresponding voltage signal, combined with the detection result of the auxiliary detection circuit (whether the second key switch is pressed), it can be obtained whether the first key switch unit or the second key switch unit is the first key switch unit or the second key switch unit. There is a pressed key switch in the device, so as to determine the specific pressed key switch, and then complete the key detection. With the case detection circuit of this structure, the detection results of the auxiliary detection circuit can be used to realize the block and time-division detection of the keys to be detected, thereby improving the stability and detection accuracy of the detection circuit.

可选地,所述第一电阻的阻值与所述第二电阻的阻值可以是相等的。因为已经通过辅助检测电路实现了第二按键开关单元是否存在按键开关被按下的检测,即使模数转换接口ADC检测到相应的电压信号的大小不变,也能知道该电压信号产生于第一按键开关单元还是第二按键开关单元。这样,在所述第一电阻的阻值与所述第二电阻的阻值相等的情况下,电路设计时可以采买同一型号的电阻,从而节省了成本。Optionally, the resistance value of the first resistor and the resistance value of the second resistor may be equal. Because the detection of whether there is a key switch in the second key switch unit has been realized through the auxiliary detection circuit, even if the analog-to-digital conversion interface ADC detects that the magnitude of the corresponding voltage signal remains unchanged, it can be known that the voltage signal is generated in the first key switch unit. The key switch unit is also a second key switch unit. In this way, when the resistance value of the first resistor is equal to the resistance value of the second resistor, resistors of the same type can be purchased during circuit design, thereby saving costs.

作为一个可选实施例,如图1所示,所述第一按键开关单元101,包括若干第一按键开关K1a~K1e和若干第一电阻R1a~R1e;所述第一按键开关与所述第一电阻一一对应地串联,形成若干第一串联支路,例如以图1为例,第一按键开关K1a与第一电阻R1a串联,第一按键开关K1b与第一电阻R1b串联,第一按键开关K1c与第一电阻R1c串联,第一按键开关K1d与第一电阻R1d串联,第一按键开关K1e与第一电阻R1e串联,进而形成5个支路;若干所述第一串联支路并联设置,若干所述第一电阻R1a~R1e的阻值各不相同。通过这样的结构设计,使得任一支路中的按键开关被按下时,由于电阻阻值的不同,相应支路的电压信号也会不同,进而得知是哪一条支路对应的按键开关被按下,从而完成按键检测。As an optional embodiment, as shown in FIG. 1, the first key switch unit 101 includes a plurality of first key switches K1a-K1e and a plurality of first resistors R1a-R1e; the first key switch and the first key switch A resistor is connected in series in a one-to-one correspondence to form several first series branches. For example, taking FIG. 1 as an example, the first key switch K1a is connected in series with the first resistor R1a, the first key switch K1b is connected in series with the first resistor R1b, and the first key switch K1a is connected in series with the first resistor R1b The switch K1c is connected in series with the first resistor R1c, the first key switch K1d is connected in series with the first resistor R1d, and the first key switch K1e is connected in series with the first resistor R1e, thereby forming five branches; a plurality of the first series branches are arranged in parallel , the resistance values of several of the first resistors R1a to R1e are different from each other. Through such a structural design, when the key switch in any branch is pressed, the voltage signal of the corresponding branch will be different due to the difference in resistance value, and then it is known which branch corresponding key switch is pressed. Press to complete key detection.

可选地,所述若干第一电阻的阻值可以依次递增,递增规律可以是等差数列或等比数列,在采用等比数列时,可以选择以量级为单位的递增方式,如1Ω、10Ω、100Ω、1000Ω、10000Ω,等等。Optionally, the resistance values of the several first resistors can be sequentially increased, and the increasing rule can be an arithmetic progression or an arithmetic progression. 10Ω, 100Ω, 1000Ω, 10000Ω, etc.

作为一个可选实施例,如图1所示,所述第二按键开关单元102,包括若干第二按键开关K2a~K2e和若干第二电阻R2a~R2e;所述第二按键开关与所述第二电阻一一对应地串联,形成若干第二串联支路,例如以图1为例,第二按键开关K2a与第二电阻R2a串联,第二按键开关K2b与第二电阻R2b串联,第二按键开关K2c与第二电阻R2c串联,第二按键开关K2d与第二电阻R2d串联,第二按键开关K2e与第二电阻R2e串联,进而形成5个支路;若干所述第二串联支路并联设置,若干所述第二电阻的阻值各不相同。通过这样的结构设计,使得任一支路中的按键开关被按下时,由于电阻阻值的不同,相应支路的电压信号也会不同,进而得知是哪一条支路对应的按键开关被按下,从而完成按键检测。As an optional embodiment, as shown in FIG. 1, the second key switch unit 102 includes a plurality of second key switches K2a-K2e and a plurality of second resistors R2a-R2e; the second key switch and the first key switch The two resistors are connected in series in one-to-one correspondence to form a number of second series branches. For example, taking FIG. 1 as an example, the second key switch K2a is connected in series with the second resistor R2a, the second key switch K2b is connected in series with the second resistor R2b, and the second key switch K2a is connected in series with the second resistor R2b. The switch K2c is connected in series with the second resistor R2c, the second key switch K2d is connected in series with the second resistor R2d, and the second key switch K2e is connected in series with the second resistor R2e, thereby forming five branches; a number of the second series branches are arranged in parallel , the resistance values of several of the second resistors are different. Through such a structural design, when the key switch in any branch is pressed, the voltage signal of the corresponding branch will be different due to the difference in resistance value, and then it is known which branch corresponding key switch is pressed. Press to complete key detection.

可选地,所述若干第二电阻的阻值可以依次递增,递增规律可以是等差数列或等比数列,在采用等比数列时,可以选择以量级为单位的递增方式,如1Ω、10Ω、100Ω、1000Ω、10000Ω,等等。Optionally, the resistance values of the plurality of second resistors can be sequentially increased, and the increasing rule can be an arithmetic progression or an arithmetic progression. 10Ω, 100Ω, 1000Ω, 10000Ω, etc.

作为一个可选实施例,如图1所示,所述第一按键开关单元101和所述第二按键开关单元102均包括若干按键开关和电阻;其中,若干所述第一电阻R1a~R1e的阻值与若干所述第二电阻R2a~R2e的阻值一一对应地相等。As an optional embodiment, as shown in FIG. 1 , the first key switch unit 101 and the second key switch unit 102 each include several key switches and resistors; wherein, the several first resistors R1a to R1e The resistance values are equal to the resistance values of the plurality of second resistors R2a-R2e in a one-to-one correspondence.

以图1为例,第一电阻R1a的阻值可以等于第二电阻R2a的阻值,第一电阻R1b的阻值可以等于第二电阻R2b的阻值,第一电阻R1c的阻值可以等于第二电阻R2c的阻值,第一电阻R1d的阻值可以等于第二电阻R2d的阻值,第一电阻R1e的阻值可以等于第二电阻R2e的阻值。Taking FIG. 1 as an example, the resistance value of the first resistor R1a may be equal to the resistance value of the second resistor R2a, the resistance value of the first resistor R1b may be equal to the resistance value of the second resistor R2b, and the resistance value of the first resistor R1c may be equal to the resistance value of the first resistor R1c. The resistance of the two resistors R2c, the resistance of the first resistor R1d may be equal to the resistance of the second resistor R2d, and the resistance of the first resistor R1e may be equal to the resistance of the second resistor R2e.

所述按键检测电路能够通过辅助检测电路实现第二按键开关单元是否存在按键开关被按下的检测,在该前提下,即使模数转换接口ADC检测到相应的电压信号的大小不变,也能知道该电压信号是产生于第一按键开关单元还是第二按键开关单元。这样,在若干所述第一电阻R1a~R1e的阻值与若干所述第二电阻R2a~R2e的阻值一一对应地相等的情况下,对于阻值相等的电阻,可以采买同一型号的电阻,从而节省了成本。The button detection circuit can realize the detection of whether there is a button switch in the second button switch unit through the auxiliary detection circuit. It is known whether the voltage signal is generated by the first key switch unit or the second key switch unit. In this way, in the case where the resistance values of the first resistors R1a-R1e and the resistance values of the second resistors R2a-R2e are equal to one-to-one correspondence, for the resistors with the same resistance value, the same type of resistor can be purchased , thereby saving costs.

所述按键检测电路,因为将按键开关分为了两部分(第一按键开关单元101和所述第二按键开关单元102),使其能在利用较少的接口的前提下,拉大按键检测电压的梯度(因为同一个开关单元中的按键开关数量较少),进而提高检测精度。在本实施例中,相邻两个按键间的电压间隔大小能提高一倍,以此提高检测电路的抗干扰能力,提高检测准确性。同时,电路设计上同一电阻值的电阻能够复用,相同数量按键的检测中,降低了电阻的采购成本。此外,在按键数量相同的情况下,本实施例的按键检测电路,相较于矩阵扫描方式或二进制编码方式的按键检测电路,能够大大节省I/O接口的数量。The key detection circuit, because the key switch is divided into two parts (the first key switch unit 101 and the second key switch unit 102), makes it possible to increase the key detection voltage under the premise of using fewer interfaces (because the number of key switches in the same switch unit is less), thereby improving the detection accuracy. In this embodiment, the voltage interval between two adjacent keys can be doubled, thereby improving the anti-interference ability of the detection circuit and improving the detection accuracy. At the same time, resistors with the same resistance value can be reused in the circuit design, and the purchase cost of the resistors is reduced in the detection of the same number of buttons. In addition, when the number of keys is the same, the key detection circuit of this embodiment can greatly save the number of I/O interfaces compared to the key detection circuit of the matrix scanning method or the binary encoding method.

作为一个可选实施例,如图1所示,所述辅助检测电路103包括第一控制单元和晶体管Q1,所述第二按键开关单元102的第二端连接所述晶体管Q1的控制极,所述晶体管Q1的第一极连接所述第一控制单元的I/O接口,所述晶体管Q1的第二极连接参考电压端GND,所述晶体管Q1的第一极经过第四电阻R4连接第二电压端VDD。这样,当第二按键开关单元102中的任一第二按键开关被按下时,所述晶体管Q1的控制极都会接入高电平信号,进而使晶体管Q1打开,使得所述第一控制单元的I/O接口接入参考电压端GND的信号(若参考电压端接地,则电压为0),从而第一控制单元能够确定第二按键开关单元102中存在被按下额第二按键开关。这种设计简单有效,且仅需占用第一控制单元的一个I/O接口。As an optional embodiment, as shown in FIG. 1 , the auxiliary detection circuit 103 includes a first control unit and a transistor Q1, and the second end of the second key switch unit 102 is connected to the control electrode of the transistor Q1, so The first pole of the transistor Q1 is connected to the I/O interface of the first control unit, the second pole of the transistor Q1 is connected to the reference voltage terminal GND, and the first pole of the transistor Q1 is connected to the second pole through the fourth resistor R4. Voltage terminal VDD. In this way, when any second key switch in the second key switch unit 102 is pressed, the control pole of the transistor Q1 will be connected to a high-level signal, so that the transistor Q1 is turned on, so that the first control unit The I/O interface is connected to the signal of the reference voltage terminal GND (if the reference voltage terminal is grounded, the voltage is 0), so that the first control unit can determine that there is a pressed second key switch in the second key switch unit 102 . This design is simple and effective, and only needs to occupy one I/O interface of the first control unit.

可选地,所述第一控制单元可以是MCU芯片(微处理器)或SOC芯片(系统级芯片或片上系统)。Optionally, the first control unit may be an MCU chip (microprocessor) or an SOC chip (system-on-chip or system-on-chip).

作为一个可选实施例,所述按键检测电路还包括第二控制单元,所述第二控制单元包括模数转换模块,所述模数转换接口与所述模数转换模块连接;As an optional embodiment, the key detection circuit further includes a second control unit, the second control unit includes an analog-to-digital conversion module, and the analog-to-digital conversion interface is connected to the analog-to-digital conversion module;

所述模数转换模块用于将所述模数转换接口的电压信号转换为数字信号,所述第二控制单元用于根据所述数字信号,结合所述辅助检测电路的检测结果,确定所述第一按键开关单元和所述第二按键开关单元中是否存在按键开关被按下或者确定所述第一按键开关单元和所述第二按键开关单元中被按下的按键开关。The analog-to-digital conversion module is used to convert the voltage signal of the analog-to-digital conversion interface into a digital signal, and the second control unit is used to determine the Whether a key switch is pressed in the first key switch unit and the second key switch unit is determined, or it is determined that the key switch in the first key switch unit and the second key switch unit is pressed.

例如,在一开始时,所有按键开关均未被按下时,所述第二控制单元检测到所述模数转换接口ADC存在一个电压信号(可作为基准电压)。当所述第二控制单元检测到所述模数转换接口ADC的电压信号改变时,若辅助检测电路检测确定第二按键开关单元中存在按键开关被按下(例如第一控制单元的I/O接口检测到低电平信号),则可根据所述模数转换接口ADC的改变后的电压信号(反馈电压),确定第二按键开关单元中被按下的按键开关。具体计算方式根据第三电阻R3和第二电阻之间的分压进行计算。当所述第二控制单元检测到所述模数转换接口ADC的电压信号改变时,若辅助检测电路检测确定第二按键开关单元中不存在按键开关被按下(例如第一控制单元的I/O接口检测到高电平信号),则说明是第一按键开关单元中存在按键开关被按下,则可根据所述模数转换接口ADC的改变后的电压信号,确定第一按键开关单元中被按下的按键开关。具体计算方式根据第三电阻R3和第一电阻之间的分压进行计算。当所述第二控制单元未检测到所述模数转换接口ADC的电压信号发生改变,则说明没有按键开关被按下。For example, at the beginning, when all the key switches are not pressed, the second control unit detects that there is a voltage signal (which can be used as a reference voltage) in the analog-to-digital conversion interface ADC. When the second control unit detects that the voltage signal of the analog-to-digital conversion interface ADC changes, if the auxiliary detection circuit detects and determines that a key switch is pressed in the second key switch unit (for example, the I/O of the first control unit If the interface detects a low-level signal), the pressed key switch in the second key switch unit can be determined according to the changed voltage signal (feedback voltage) of the analog-to-digital conversion interface ADC. The specific calculation method is calculated according to the divided voltage between the third resistor R3 and the second resistor. When the second control unit detects that the voltage signal of the analog-to-digital conversion interface ADC changes, if the auxiliary detection circuit detects and determines that no key switch is pressed in the second key switch unit (for example, the I/O of the first control unit O interface detects a high-level signal), it means that there is a key switch in the first key switch unit that is pressed, and then it can be determined according to the changed voltage signal of the analog-to-digital conversion interface ADC. Pressed key switch. The specific calculation method is calculated according to the divided voltage between the third resistor R3 and the first resistor. When the second control unit does not detect that the voltage signal of the analog-to-digital conversion interface ADC changes, it means that no key switch is pressed.

可选地,在判断方法上,可以是先判断I/O接口的电压,确定按下的按键开关所属的开关单元,其次根据模数转换接口ADC反馈的电压定位确切的按键开关。因此,ADC检测到的电压将由原先的10个电阻进行分压改变为由5个电阻进行分压,相邻按键间的电压值差值增大,受干扰影响程度降低。Optionally, in the judgment method, the voltage of the I/O interface can be judged first, the switch unit to which the pressed key switch belongs, and the exact key switch is located according to the voltage fed back by the analog-to-digital conversion interface ADC. Therefore, the voltage detected by the ADC will be divided from the original 10 resistors to 5 resistors, the voltage difference between adjacent buttons will increase, and the degree of influence by interference will decrease.

可选地,所述第二控制单元可以是MCU芯片或SOC芯片。Optionally, the second control unit may be an MCU chip or an SOC chip.

可选地,所述第一控制单元和第二控制单元复用为一个控制芯片。以图3为例,当控制单元本身具有ADC模块时,可以直接利用控制单元本身的模数转换接口,从而复用一个控制芯片,同时实现所述第一控制单元和第二控制单元的功能。Optionally, the first control unit and the second control unit are multiplexed into one control chip. Taking FIG. 3 as an example, when the control unit itself has an ADC module, the analog-to-digital conversion interface of the control unit itself can be directly used, thereby multiplexing a control chip and simultaneously realizing the functions of the first control unit and the second control unit.

作为一个可选实施例,参考图2或图3所示,所述第二按键开关单元102/102’和所述辅助检测电路的数量均为多个,从而实现更多按键的检测。As an optional embodiment, referring to FIG. 2 or FIG. 3 , the number of the second key switch unit 102/102' and the auxiliary detection circuit is multiple, so as to realize the detection of more keys.

可选地,如图2或图3所示,多个所述辅助检测电路中的第一控制单元复用为一个控制芯片,一个控制芯片中的I/O接口通常不止一个,通过复用控制芯片,能够节省成本、简化电路布线。Optionally, as shown in FIG. 2 or FIG. 3 , the first control units in the plurality of auxiliary detection circuits are multiplexed into one control chip, and there are usually more than one I/O interface in one control chip, which is controlled by multiplexing. The chip can save cost and simplify circuit wiring.

本实施例中,所述按键检测电路的可拓展性强,可根据控制芯片的空闲I/O接口数量灵活划分按键模块的数量,以及每模块中按键的数量。以此在有限I/O接口条件下,满足有不同按键检测数量需求的场景。In this embodiment, the key detection circuit has strong scalability, and can flexibly divide the number of key modules and the number of keys in each module according to the number of idle I/O interfaces of the control chip. In this way, under the condition of limited I/O interface, it can meet the needs of different button detection numbers.

所属领域的普通技术人员应当理解:以上所述仅为本实用新型的具体实施例而已,并不用于限制本实用新型,凡在本实用新型的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本实用新型的保护范围之内。It should be understood by those of ordinary skill in the art that: the above are only specific embodiments of the present utility model, and are not intended to limit the present utility model. All within the spirit and principle of the present utility model, any modifications made, equivalent to Replacement, improvement, etc., should be included within the protection scope of the present invention.

Claims (10)

1. A key detection circuit is characterized by comprising a first key switch unit, at least one second key switch unit and at least one auxiliary detection circuit;
the first key switch unit comprises a first key switch and a first resistor which are connected in series; the first end of the first key switch unit is connected with a first voltage end through a third resistor, and the second end of the first key switch unit is connected with a reference voltage end;
the second key switch unit comprises a second key switch and a second resistor which are connected in series; the first end of the second key switch unit is connected with a first voltage end through a third resistor, and the second end of the second key switch unit is connected with the auxiliary detection circuit;
the auxiliary detection circuit is used for determining whether a second key switch in the second key switch unit is pressed down or not according to the voltage signal of the second end of the second key switch unit;
the first end of the first key switch unit and the first end of the second key switch unit are both connected with the analog-to-digital conversion interface of the key detection circuit.
2. The key detection circuit of claim 1, wherein the first key switch unit comprises a plurality of first key switches and a plurality of first resistors; the first key switches and the first resistors are connected in series in a one-to-one correspondence mode to form a plurality of first series branches; the first series branches are arranged in parallel, and the resistance values of the first resistors are different.
3. The key detection circuit of claim 1, wherein the second key switch unit comprises a plurality of second key switches and a plurality of second resistors; the second key switches and the second resistors are connected in series in a one-to-one correspondence mode to form a plurality of second series branches; the plurality of second series branches are arranged in parallel, and the resistance values of the plurality of second resistors are different.
4. The key detection circuit of claim 1, wherein the first resistor has a resistance equal to the second resistor.
5. The key detection circuit of claim 1, wherein the first key switch unit comprises a plurality of first key switches and a plurality of first resistors; the first key switches and the first resistors are connected in series in a one-to-one correspondence mode to form a plurality of first series branches; the first series branches are arranged in parallel, and the resistance values of the first resistors are different;
the second key switch unit comprises a plurality of second key switches and a plurality of second resistors; the second key switches and the second resistors are connected in series in a one-to-one correspondence mode to form a plurality of second series branches; the plurality of second series branches are arranged in parallel, and the resistance values of the plurality of second resistors are different;
the resistance values of the first resistors are equal to the resistance values of the second resistors in a one-to-one correspondence manner.
6. The key detection circuit of claim 1, wherein the auxiliary detection circuit comprises a first control unit and a transistor, the second terminal of the second key switch unit is connected to the control electrode of the transistor, the first electrode of the transistor is connected to the I/O interface of the first control unit, the second electrode of the transistor is connected to the reference voltage terminal, and the first electrode of the transistor is connected to the second voltage terminal through a fourth resistor.
7. The key detection circuit of claim 6, further comprising a second control unit, wherein the second control unit comprises an analog-to-digital conversion module, and the analog-to-digital conversion interface is connected to the analog-to-digital conversion module;
the analog-to-digital conversion module is used for converting a voltage signal of the analog-to-digital conversion interface into a digital signal, and the second control unit is used for determining whether a key switch is pressed down in the first key switch unit and the second key switch unit or determining the pressed key switch in the first key switch unit and the second key switch unit according to the digital signal and by combining a detection result of the auxiliary detection circuit.
8. The key detection circuit of claim 7, wherein at least one of the first control unit and the second control unit is an MCU chip or an SOC chip.
9. The key detection circuit of claim 7, wherein the first control unit and the second control unit are multiplexed into one control chip.
10. The key detection circuit of claim 6, wherein the number of the second key switch unit and the auxiliary detection circuit is plural; and the first control units in the auxiliary detection circuits are multiplexed into one control chip.
CN202020190091.0U 2020-02-20 2020-02-20 Key detection circuit Active CN212180969U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202020190091.0U CN212180969U (en) 2020-02-20 2020-02-20 Key detection circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202020190091.0U CN212180969U (en) 2020-02-20 2020-02-20 Key detection circuit

Publications (1)

Publication Number Publication Date
CN212180969U true CN212180969U (en) 2020-12-18

Family

ID=73774213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202020190091.0U Active CN212180969U (en) 2020-02-20 2020-02-20 Key detection circuit

Country Status (1)

Country Link
CN (1) CN212180969U (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115692266A (en) * 2022-11-03 2023-02-03 中国电子科技集团公司第十三研究所 A material positioning detection device and method based on electrical signal superposition
CN115793869A (en) * 2022-10-27 2023-03-14 广芯微电子(广州)股份有限公司 Key state identification method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115793869A (en) * 2022-10-27 2023-03-14 广芯微电子(广州)股份有限公司 Key state identification method and device
CN115793869B (en) * 2022-10-27 2023-08-25 广芯微电子(广州)股份有限公司 Key state identification method and device
CN115692266A (en) * 2022-11-03 2023-02-03 中国电子科技集团公司第十三研究所 A material positioning detection device and method based on electrical signal superposition

Similar Documents

Publication Publication Date Title
US20080088589A1 (en) Scanning circuit and method for keyboard
CN212180969U (en) Key detection circuit
JP2800233B2 (en) AD converter
CN101860369B (en) Matrix keyboard and scanning method thereof
CN101951263B (en) Key scanning method and system
CN201039440Y (en) A cable control earphone for multi-key and single detection end
CN103298266A (en) Manufacturing method of flexible circuit board of keyboard
US20150006920A1 (en) Keyboard circuit
TW201340604A (en) Keypad module and detecting method for keypad matrix
US8253604B2 (en) Keyboard scanning circuit
EP2385631B1 (en) Switching circuitry and switching system
US9360949B2 (en) Human interface device
US8756354B2 (en) Keyboard supporting N-key rollover
CN102857231B (en) A kind of key press detecting circuit
CN105306070A (en) Scanning driving method for computer keyboard
CN202102379U (en) Novel keyboard structure with thin-film switch
US6737990B1 (en) Key input apparatus interface
CN102857232B (en) A kind of key press detecting circuit and detection method
CN201113981Y (en) Press key detection circuit
CN114578939A (en) Single-line awakening and key detection circuit
CN206292323U (en) Many key detection devices
TWI878085B (en) Keyboard device with anti-ghosting function
CN110955456A (en) Mainboard device and server
TWI437596B (en) Keyboard circuit
CN109284011A (en) A light-sensitive keyboard

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant