WO2012040973A1 - 按键检测方法及装置 - Google Patents

按键检测方法及装置 Download PDF

Info

Publication number
WO2012040973A1
WO2012040973A1 PCT/CN2010/079309 CN2010079309W WO2012040973A1 WO 2012040973 A1 WO2012040973 A1 WO 2012040973A1 CN 2010079309 W CN2010079309 W CN 2010079309W WO 2012040973 A1 WO2012040973 A1 WO 2012040973A1
Authority
WO
WIPO (PCT)
Prior art keywords
frequency
button
signal
khz
range
Prior art date
Application number
PCT/CN2010/079309
Other languages
English (en)
French (fr)
Inventor
龙涛
刘正东
龙江
Original Assignee
江苏惠通集团有限责任公司
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 江苏惠通集团有限责任公司 filed Critical 江苏惠通集团有限责任公司
Priority to EP10857736.2A priority Critical patent/EP2680018B1/en
Publication of WO2012040973A1 publication Critical patent/WO2012040973A1/zh

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/003Phantom keys detection and prevention
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/96Touch switches
    • H03K17/962Capacitive touch switches
    • H03K17/9622Capacitive touch switches using a plurality of detectors, e.g. keyboard
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K2217/00Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
    • H03K2217/94Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated
    • H03K2217/96Touch switches
    • H03K2217/9607Capacitive touch switches
    • H03K2217/960705Safety of capacitive touch and proximity switches, e.g. increasing reliability, fail-safe

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a button detection method and apparatus.
  • buttons have been widely used in various electronic products, and the success rate of button detection directly affects the use of electronic products.
  • Key detection usually refers to detecting the operation of a button and determining whether the button is pressed.
  • the existing button detection method includes the following basic steps: detecting a button to acquire a button signal; sampling the button signal at a fixed frequency, and outputting the number of times the button valid signal is detected within a predetermined time range reaches or exceeds a predetermined number of times control signal.
  • the false trigger rate or missed detection rate of the button will be increased, thereby reducing the success rate of button detection.
  • the problem to be solved by the present invention is that the conventional button detection is susceptible to interference from the external environment, resulting in a low success rate of button detection.
  • an embodiment of the present invention provides a button detection method, including the following steps: detecting a button, acquiring a button signal; and frequency-sampling the button signal within a predetermined time range Outputting a control signal when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times, wherein the variable frequency sampling means that the sampling frequency is incremented from the first frequency to the second frequency, and then decreases from the second frequency to the first frequency, and The incrementing and decrementing processes are repeated, and the sampling frequency resides at each frequency for a predetermined time.
  • the increasing or decreasing value of the sampling frequency is 1 frequency unit.
  • the button is a capacitive touch button.
  • the button is a contact button or an air button.
  • the detecting button comprises: detecting a charge change amount of the capacitor; acquiring a button signal, wherein the button signal is a digital signal corresponding to a charge change amount of the capacitor.
  • the sampling to the button valid signal comprises: sampling the button signal; if the value represented by the button signal is greater than a threshold value, the sampled button signal is a button valid signal.
  • the predetermined time range is 3 ms, the predetermined number of times is 80, the first frequency is 80 KHz, the second frequency is 120 KHz, and the predetermined time is 5 s; the sampling frequency is incremented. Or the decrement value is 1 ⁇ .
  • the touch detection method further includes: receiving an external signal; generating a trigger signal for triggering the button detection when a frequency of the external signal is within a frequency range of the first frequency to the second frequency.
  • the receiving the external signal includes: hopping to receive an external signal, where the frequency hopping receiving refers to receiving only an external signal having the same frequency and a frequency hopping frequency, wherein the frequency hopping frequency is incremented from the third frequency. Up to the fourth frequency, decrementing from the fourth frequency to the third frequency, and repeating the incrementing and decrementing process, the increasing frequency hopping frequency being different from the decreasing frequency hopping frequency, wherein the third frequency is smaller than the first frequency Frequency, the fourth frequency being greater than the second frequency.
  • the increasing or decreasing value of the frequency hopping frequency is 2 frequency units.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range
  • the second frequency range includes the first frequency to the second frequency Frequency range
  • the dwell time of each frequency of the frequency hopping frequency in the first frequency range and the third frequency range is less than the frequency of each frequency of the frequency hopping frequency in the second frequency range Leave time.
  • the third frequency is 20 KHz
  • the fourth frequency is 500 KHz.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range, where the first frequency range is 20 kHz to 80 kHz, and the second frequency The range is from 80 kHz to 300 kHz, and the third frequency range is from 300 to 500 kHz.
  • the hopping frequency of each frequency in the first frequency range and the third frequency range is 0.1 ms.
  • the dwell time of each frequency of the frequency in the second frequency range is 0.2 ms.
  • an embodiment of the present invention further provides a button detecting apparatus, including: a button detecting unit, configured to detect a button, obtain a button signal; an effective signal detecting unit, configured to frequency-sample the button signal, and output a control signal when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times within a predetermined time range
  • the variable frequency sampling means that the sampling frequency is incremented from the first frequency to the second frequency, and then decremented from the second frequency to the first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency is at each frequency. Residing for a predetermined time.
  • the increasing or decreasing value of the sampling frequency is 1 frequency unit.
  • the button is a capacitive touch button.
  • the button is a contact button or an air button.
  • the button detecting unit includes: a capacitor detecting unit, configured to detect a charge variation of the capacitor, and acquire a button signal, where the button signal is a digital signal corresponding to a charge variation of the capacitor.
  • the button signal being a button valid signal means that the value represented by the button signal is greater than a threshold of a change amount.
  • the predetermined time range is 3 ms, the predetermined number of times is 80, the first frequency is 80 KHz, the second frequency is 120 KHz, and the predetermined time is 5 s; the sampling frequency is incremented. Or the decrement value is 1 ⁇ .
  • the button detecting device further includes: a receiving unit, configured to receive an external signal; and an external signal detecting unit, configured to: when a frequency of the external signal is within a frequency range of the first frequency to the second frequency A trigger signal for triggering the button detection is generated, and the button detecting unit detects the button after receiving the trigger signal to acquire a button signal.
  • a receiving unit configured to receive an external signal
  • an external signal detecting unit configured to: when a frequency of the external signal is within a frequency range of the first frequency to the second frequency A trigger signal for triggering the button detection is generated, and the button detecting unit detects the button after receiving the trigger signal to acquire a button signal.
  • the receiving unit includes: an antenna, configured to receive an external environment signal; and frequency hopping receiving The unit is configured to receive an external signal by frequency hopping, where the frequency hopping reception refers to receiving only an external environmental signal having the same frequency and a frequency hopping frequency as an external signal, wherein the frequency hopping frequency is increased from the third frequency to the fourth frequency.
  • the frequency is further decremented from the fourth frequency to the third frequency, and the incrementing and decrementing processes are repeated, the increasing frequency hopping frequency is different from the decreasing frequency hopping frequency, and the third frequency is smaller than the first frequency,
  • the fourth frequency is greater than the second frequency.
  • the increasing or decreasing value of the frequency hopping frequency is 2 frequency units.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range
  • the second frequency range includes the first frequency to the second frequency Frequency range
  • the dwell time of each frequency of the frequency hopping frequency in the first frequency range and the third frequency range is less than the frequency of each frequency of the frequency hopping frequency in the second frequency range Leave time.
  • the third frequency is 20 KHz
  • the fourth frequency is 500 KHz.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range, where the first frequency range is 20 kHz to 80 kHz, and the second frequency The range is from 80 kHz to 300 kHz, and the third frequency range is from 300 to 500 kHz.
  • the hopping frequency of each frequency in the first frequency range and the third frequency range is 0.1 ms.
  • the dwell time of each frequency of the frequency in the second frequency range is 0.2 ms.
  • the increasing the frequency hopping frequency from the third frequency to the fourth frequency means: the frequency hopping frequency is increased from 20 kHz to 21 kHz, and then increasing to 499 ⁇ at 2 kHz each time, and then increasing from 499 kHz to 500 kHz; Deducing the frequency hopping frequency from the fourth frequency to the third frequency means that the frequency hopping frequency is decremented from 500 kHz to 20 kHz at 2 KHz each time.
  • the above technical solution adopts a variable frequency sampling button signal, and detects whether the sampled key signal is a key valid signal, compared to the existing fixed frequency sampling button signal, during the button detection process, the change
  • the sampling frequency is not easily tracked by the changed external signal, thus reducing the probability that the sampled signal is interfered by the external signal.
  • the received external signal is triggered within a predetermined frequency range (the first frequency to the second frequency), and the external signal is received by the frequency hopping reception, that is, only one type is received within a certain time range.
  • the external signal of the frequency combined with the frequency conversion sampling, further reduces the probability that the sampling signal coincides with the frequency of the external signal, and the possibility of the key detection being disturbed is greatly reduced.
  • the positive frequency hopping reception and the reverse frequency hopping reception are performed in a predetermined frequency range (the third frequency to the fourth frequency), and the repetition is performed, wherein the frequency hopping frequency of the positive frequency hopping reception and the frequency hopping frequency of the reverse frequency hopping frequency Differently, the frequency hopping frequency will stay at each frequency, so it will not be missed, thus improving the detection success rate.
  • FIG. 1 is a schematic flow chart of a button detecting method according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of the step S12 shown in FIG. 1.
  • FIG. 3 is a schematic flow chart of a button detecting method according to another embodiment of the present invention.
  • FIG. 4 is a schematic structural view of a button detecting device according to an embodiment of the present invention;
  • FIG. 6 is a schematic structural diagram of an anti-interference capacitive touch button detecting system;
  • FIG. 7 is a detailed structural diagram of an anti-interference capacitive touch button detecting system.
  • the inventor has found that in the existing button detection technology, since the button signal is sampled at a fixed frequency, the signal of the changing external environment is easier to track the frequency of the sampled signal, thereby interfering with the sampled signal, resulting in the inability to detect a valid key signal. , or mistake the interference signal for a valid button signal. Therefore, the inventors have proposed a method of frequency-sampling the button signal to reduce the probability that the sampled signal is affected by the external interference signal.
  • the embodiments of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the following embodiments are described by taking a button as a capacitive touch button. In other embodiments, the button is not limited.
  • the capacitive touch button may be, for example, a resistive button, a switch button or the like.
  • FIG. 1 is a schematic flowchart diagram of a button detecting method according to an embodiment of the present invention, where the button detecting method includes:
  • Step S11 detecting a button, and acquiring a button signal.
  • Step S12 frequency-sampling the button signal, and outputting a control signal when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times within a predetermined time range, wherein the variable frequency sampling means that the sampling frequency is increased from the first frequency to the first The two frequencies are further decremented from the second frequency to the first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency resides at each frequency for a first predetermined time.
  • step S11 is executed to detect a button to acquire a button signal.
  • the button is a capacitive touch button, such as an air button or a contact button.
  • the button has a pair of ground parasitic capacitances.
  • step S11 specifically includes: detecting a charge change amount of a capacitor (such as a parasitic capacitance); acquiring a button signal, wherein the button signal is a digital signal corresponding to a charge change amount of the capacitor, and is used to determine in a subsequent step. Whether the button is pressed.
  • the digital signal corresponding to the amount of charge change of the capacitor means that the value represented by the digital signal may be the amount of charge change of the capacitor, or may be proportional to the amount of charge change of the capacitor.
  • step S12 the button signal is frequency-sampled, and the control signal is output when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times within a predetermined time range. That is, it is judged whether the number of times the button valid signal is sampled in the predetermined time range reaches or exceeds a predetermined number of times, and if so, the control signal is output, indicating that the button is likely to be pressed; otherwise, it is determined that there is external signal interference.
  • the variable frequency sampling means that the sampling frequency is incremented from the first frequency to the second frequency, and then decremented from the second frequency to the first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency is reserved at each frequency. time.
  • the sampling to the button valid signal comprises: sampling the button signal; if the value represented by the button signal is greater than a threshold value, the sampled button signal is a button valid signal. Step S12 of the embodiment is as shown in FIG.
  • Step S121 sampling the button signal, that is, sampling the digital signal corresponding to the charge change amount of the capacitor acquired in step S11, and the sampling frequency is incremented from the first frequency to The second frequency is then decremented from the second frequency to the first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency resides at each frequency for a predetermined time.
  • the sampling frequency is cyclically changed in the range of the first frequency to the second frequency (including the first frequency and the second frequency), and the increasing value of the sampling frequency (from the first frequency to the second frequency, Each time the frequency increases or decreases (the amount of frequency reduction from the second frequency to the first frequency) is 1 frequency unit, that is, the increase in the difference or the decrease in the difference.
  • the sampling frequency is first increased from the first frequency to the second frequency, and each time one frequency unit is added (ie, the unit of the first frequency and the second frequency, such as a unit of kilohertz (KHz), then each time increases ⁇ ) And maintaining a predetermined time at each frequency, that is, increasing the sampling frequency by one frequency unit every predetermined time; then, the sampling frequency is further decremented from the second frequency to the first frequency, one frequency unit is reduced each time, and Maintaining a predetermined time at each frequency, that is, the sampling frequency is decreased by 1 frequency unit every predetermined time; then the sampling frequency is further increased from the first frequency to the second frequency, and then decremented from the second frequency to the first frequency, repeatedly.
  • KHz kilohertz
  • the first frequency and the second frequency are a lower frequency limit and a lower frequency limit of a signal generated after the button is operated (pressed), which is usually an empirical value determined according to actual conditions.
  • a signal having a frequency of 80 kHz to 120 kHz is usually generated, so the first frequency is set to 80 kHz, the second frequency is set to 120 kHz, and the sampling frequency is incremented.
  • the value or decrement is 1 ⁇ .
  • the predetermined time is determined according to the predetermined time range and a predetermined number of times (which may be an empirical value), that is, the predetermined time may determine that a button signal greater than a predetermined number of times is sampled within a predetermined time range, wherein the predetermined time range is 3 ms, The predetermined number of times is 80, and the predetermined time may be 5 s.
  • the sampling frequency starts from 80KHz, increases to 81KHz after 5 s, and increases to 5 s.
  • Step S122 determining whether the sampled button signal is a button valid signal, and if yes, executing step S123, if otherwise, executing step S124.
  • the button signal being a button valid signal means that the value represented by the sampled button signal (ie, the digital signal) is greater than the threshold of the change amount.
  • step S123 the count value is incremented by 1, and step S124 is performed.
  • the initial value of the count value is 0.
  • the count value is incremented by one, and the count value is a count of the number of times the button valid signal is sampled.
  • step S124 it is determined whether the predetermined time range is reached or exceeded. If yes, step S125 is performed, otherwise step S122 is performed. If the sampled button signal is not a button valid signal or if the sampled button signal is a button valid signal and the count value is incremented by 1, it is determined whether the difference between the current time and the time when the step S12 is started is greater than or equal to a predetermined time.
  • step S125 determining whether the count value is greater than or equal to the predetermined number of times, if yes, executing step S126, if otherwise, executing step S127. If the difference between the current time and the time when the step S12 starts to be executed is greater than or equal to the predetermined time range, it is judged whether the count value is greater than or equal to the predetermined number of times, and if yes, step S126 is performed, otherwise step S127 is performed.
  • Step S126 outputting a control signal. If the count value is greater than or equal to the predetermined number of times within the predetermined time range, a control signal is output indicating that the button is pressed or is likely to be pressed. In step S127, it is determined that there is external signal interference. If the count value is less than the predetermined number of times within the predetermined time range, it means that the button is not pressed, and the outside world may have an interference signal to interfere with the button detection.
  • step S121 and steps S122 to S125 can be performed in parallel.
  • the determination result of the control signal and/or whether the number of times the button valid signal is sampled in the predetermined time range reaches or exceeds a predetermined number of times may be used as a case for further determining the operation of the button, for example, the step may be repeated within 3 seconds.
  • S 11 and S 12 if there is always a control signal generated, it means that the button may be pressed continuously.
  • FIG. 3 is a schematic flowchart of a method for detecting a button according to another embodiment of the present invention.
  • the method may further include: receiving an external signal; When the frequency of the signal is within the frequency range of the first frequency to the second frequency, a trigger signal for triggering the button detection is generated, that is, after the trigger signal is generated, the button detection of step S11 is initiated.
  • the button detection method shown in FIG. 3 includes:
  • Step S21 receiving an external signal
  • Step S22 generating a trigger signal for triggering the button detection when a frequency of the external signal is within a frequency range of the first frequency to the second frequency;
  • Step S11 detecting a button, acquiring a button signal, that is, after the trigger signal is generated, starting to detect the button;
  • Step S12 frequency-sampling the button signal, and outputting a control signal when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times within a predetermined time range, wherein the variable frequency sampling means that the sampling frequency is increased from the first frequency to the first.
  • the two frequencies are further decremented from the second frequency to the first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency resides at each frequency for a first predetermined time.
  • step S21 is performed to receive an external signal.
  • the external signal includes an external button operation
  • the external signal can be received by the antenna, and the frequency range of the antenna receivable signal is determined by the characteristics of the antenna.
  • the antenna can receive the signal with a frequency range of 20 kHz to 500 kHz.
  • the receiving the external signal includes: hopping to receive an external signal, where the frequency hopping receiving refers to receiving only an external signal having the same frequency and frequency hopping frequency, wherein the frequency hopping frequency is incremented from the third frequency to The fourth frequency is further decremented from the fourth frequency to the third frequency, and the incrementing and decrementing processes are repeated, the increasing frequency hopping frequency is different from the decreasing frequency hopping frequency, and the third frequency is smaller than the first frequency The fourth frequency is greater than the second frequency.
  • the third frequency is the lower limit of the frequency range of the antenna receivable signal, for example, 20 KHz; and the fourth frequency is the upper limit of the frequency range of the antenna receivable signal, for example, 500 KHz.
  • the frequency hopping reception may not be used, and the antenna is always in the receiving state.
  • the increasing value of the frequency hopping frequency (the amount of increase of each frequency when the third frequency is increased to the fourth frequency) or the decreasing value (from the fourth frequency to the third frequency, each frequency)
  • the amount of reduction is 2 frequency units, that is, the increment is equal or the difference is equal.
  • the frequency hopping frequency is increased from 20KHz to 500KHz, and the odd frequency hopping frequency is increased, including: the frequency hopping frequency is increased from 20KHz to 21KHz, and then increased to 499KHz every time 2KHz, and then increased from 499KHz to 500KHz; the frequency hopping
  • the frequency is decremented from 500KHz to 20KHz for even-numbered equal-hopping, including: The frequency hopping frequency is decremented from 500KHz to 20KHz at 2KHz each time.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range
  • the second frequency range includes the frequency of the first frequency to the second frequency Range, each frequency of the frequency hopping frequency in the first frequency range and the third frequency range
  • the dwell time is less than the dwell time of each frequency of the frequency hopping frequency within the second frequency range.
  • the third frequency is 20 kHz and the fourth frequency is 500 kHz.
  • the first frequency range is 20 kHz to 80 kHz
  • the second frequency range is 80 kHz to 300 kHz
  • the third frequency range is 300 to 500 kHz.
  • a dwell time of each frequency of the frequency hopping frequency in the first frequency range and the third frequency range ie, a frequency hopping frequency is a hold hold time of the frequency
  • the frequency hopping frequency is in the first
  • the dwell time of each frequency in the two frequency ranges is 0.2 ms.
  • a dwell time of each frequency of the frequency hopping frequency in the first frequency range, the second frequency range, and the third frequency range (ie, a frequency range of the third frequency to the fourth frequency) It can also be the same.
  • each of the first frequency range and the third frequency range is shortened by shortening the frequency hopping frequency.
  • a dwell time of the frequency ie, less than a dwell time of each frequency of the frequency hopping frequency in the second frequency range
  • the frequency hopping rate within it can save detection time and improve system resource utilization.
  • step S22 is executed to generate a trigger signal for triggering the button detection when the frequency of the external signal is in the frequency range of the first frequency to the second frequency.
  • the first frequency and the second frequency are a lower frequency limit and a lower frequency limit of a signal generated after the button is operated (eg, pressed).
  • the first frequency of the embodiment is 80 KHz
  • the second frequency is 120 KHz.
  • the frequency of the received external signal is the first frequency or the second frequency or the frequency between the first frequency and the second frequency, that is, when there is a possibility that the button is operated, Continue the subsequent button detection steps.
  • the button detecting device of one embodiment of the present invention includes a button detecting unit 41 and an effective signal detecting unit 42.
  • the button detecting unit 41 is configured to detect a button and acquire a button signal.
  • the button is a capacitive touch button
  • the button detecting unit is a capacitance detecting unit, configured to detect a charge change amount of the capacitor, and obtain a button signal, wherein the button signal is a charge change amount corresponding to the capacitor.
  • Digital signal is implemented by an analog-to-digital converter ADC, which detects the amount of charge change of the capacitor and converts the analog quantity of the charge change into a digital quantity.
  • the effective signal detecting unit 42 is configured to frequency-sample the button signal, and output a control signal when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times within a predetermined time range, wherein the variable frequency sampling refers to the sampling frequency
  • the first frequency is incremented to a second frequency, and then decremented from the second frequency to a first frequency, and the incrementing and decrementing processes are repeated, and the sampling frequency resides at each frequency for a predetermined time.
  • the incremental value or the decreasing value of the sampling frequency may be one frequency unit.
  • the button signal is a button valid signal, which means that the value represented by the button signal is greater than the threshold of the change amount.
  • the effective signal detecting unit is implemented by a microcontroller MCU.
  • the key detecting device of another embodiment of the present invention includes a receiving unit 51, an external signal detecting unit 52, a button detecting unit 41, and an effective signal detecting unit 42.
  • the receiving unit 51 is configured to receive an external signal.
  • the receiving unit includes an antenna 511 and a frequency hopping receiving unit 512, and the antenna 511 is configured to receive an ambient signal of the outside world; the frequency hopping receiving unit 512 is configured to receive an external signal by frequency hopping, and the frequency hopping Receiving means that only the external environmental signal having the same frequency and frequency hopping frequency is received as an external signal and sent to the external signal detecting unit 52.
  • the frequency hopping frequency is increased from the third frequency to the fourth frequency, and then decreased from the fourth frequency to the third frequency, And repeating the incrementing and decrementing process, the increasing frequency hopping frequency is different from the decreasing frequency hopping frequency, the third frequency is smaller than the first frequency, and the fourth frequency is greater than the second frequency.
  • the receiving unit may also be an antenna, that is, the external environment signal is directly received as an external signal, and sent to the external signal detecting unit 52.
  • the increasing or decreasing value of the frequency hopping frequency is 2 frequency units.
  • the frequency range of the third frequency to the fourth frequency includes a continuous first frequency range, a second frequency range, and a third frequency range
  • the second frequency range includes a frequency range of the first frequency to the second frequency
  • the dwell time of each frequency of the frequency hopping frequency in the first frequency range and the third frequency range is less than the dwell time of each frequency of the frequency hopping frequency in the second frequency range.
  • the external signal detecting unit 52 is configured to generate a trigger signal for triggering the button detection when the frequency of the external signal is within a frequency range of the first frequency to the second frequency.
  • the external signal detecting unit 52 is connected to the button detecting unit 41, and transmits the trigger signal to the button detecting unit 41.
  • the button detecting unit 41 is configured to detect a button after receiving the trigger signal sent by the external signal detecting unit 52, and acquire a button signal.
  • the effective signal detecting unit 42 is the same as the first embodiment, and details are not described herein again.
  • the above button detection method can be applied to a button detection system to eliminate interference of environmental noise and improve the detection accuracy of the button action.
  • the button can be a contact button, especially a capacitive touch button, or other buttons, such as an air button, wherein the contact button refers to a button that the human body directly contacts the metal plate in the button, the air The button refers to a button that the human body does not directly contact the metal plate in the button.
  • FIG. 5 is a schematic structural diagram of an anti-jamming capacitive touch button detecting system, including: a capacitive touch button 21; an environment detecting unit 31 configured to detect a background environment signal and shield the first frequency (80KHz in this embodiment) a signal outside the range of the second frequency (120 kHz in this embodiment), after detecting the signal in the first frequency to the second frequency range, generating a trigger signal; the button detecting unit 32 is triggered by the trigger signal Detecting the capacitive touch button to obtain a button signal; the control unit 40 is triggered by the trigger signal to sample the button signal, and the number of times the button valid signal is sampled in the first time window reaches or exceeds a predetermined time When the number of times, the control signal is output.
  • the capacitive touch button 21 is disposed on the detecting board 20, and the detecting board 20 can be a printed circuit board (PCB).
  • the detecting board 20 is further provided with at least one balance point 22, which is a metal material for adjusting the frequency receiving and response range of the detecting board 20, which will be described in detail below.
  • the button detecting unit 32 is configured to detect the amount of change in the charge of the capacitive touch button 21, that is, the difference between the current amount of charge on the capacitive touch button 21 and the amount of charge of the capacitive touch button in the initial equilibrium state, and then The amount of change in charge is converted into a corresponding digital signal, that is to say the digital signal represents the amount of change in charge.
  • the control unit 40 can be implemented by a microcontroller (MCU, Micro Controller Unit).
  • MCU Microcontroller
  • 7 is a detailed structural diagram of FIG. 6, wherein the environment detecting unit 31 includes: a system interference detecting module 311, configured to detect a system noise signal in a frequency range of the power supply; and a low frequency interference detecting module 312, configured to detect a low frequency noise signal ranging from three frequencies to a fourth frequency range, The third frequency is smaller than the first frequency, and the fourth frequency is greater than the second frequency.
  • the detection control module 314 is configured to control the system interference detection module 311, and low frequency interference detection Module 312 and high frequency interference detection module 313 are cycled in sequence.
  • the system interference detection module 311 is mainly used to detect noise generated by the power supply and other noises within the power supply frequency range.
  • the power supply used is generated after the lighting power source is transformed, and the detection range of the corresponding system noise signal is 50 Hz to 75 Hz.
  • the low frequency interference detecting module 312 is mainly used for detecting a low frequency noise signal, and the frequency range is from the third frequency to the fourth frequency, and is specifically 20 kHz to 500 kHz in this embodiment.
  • the detecting board 20 is used as the antenna of the low-frequency interference detecting module 312, and the shape and size of the detecting board 20 are adjusted, and even one or The balance point 22 of the plurality of metal materials adjusts the capacitive reactance and the inductive reactance of the entire detecting board 20 so that the frequency response and the receiving range of the signal can include the frequency range of the third frequency to the fourth frequency, that is, Capable of receiving low frequency frequencies from 20KHz to 500KHz.
  • the capacitive reactance of the detecting plate 20 is about 0.5 pF, and the inductive reactance is from O.lmH to 0.8 mH. Since the button 21 and the detecting board 20 are integrally used as the antenna of the low-frequency interference detecting module 312, and no special low-frequency antenna is required, the integration degree of the system is improved, and the volume of the final product is reduced.
  • the high frequency interference detecting module 313 is configured to detect a high frequency noise signal having a frequency range of a fifth frequency to a sixth frequency, specifically 900 MHz to 3 GHz. Its signal is received through a separate antenna 312a achieve.
  • the anti-interference capacitive touch key detecting system of the present embodiment and the detecting method in the working process thereof will be described in detail below with reference to FIG.
  • the anti-jamming capacitive touch button detecting system first initializes after the power-on is turned on, and the initializing includes initializing the detecting chip 30, that is, initializing the environment detecting unit 31 and the button detecting unit 32; and further comprising the pair control unit
  • the initialization of 40, etc., the initialization process is about 20ms.
  • the environment detecting unit 31 starts detecting the background environment signal, and shields the signal from the first frequency to the second frequency range, and generates a signal when the first frequency to the second frequency range is detected.
  • Trigger signal In this embodiment, the following is specifically: when a signal in the range of 80 kHz to 120 kHz is detected, a trigger signal is generated, and a background environment signal in other frequency ranges is masked. It should be understood that the detection of signals in the range of 80 kHz to 120 kHz refers to the presence of a signal having an amplitude greater than a certain amplitude threshold from 80 kHz to 120 kHz.
  • the detection process of the background environmental signal is also the step S11 in Fig. 3. The process of detecting the background environmental noise will be described in detail below.
  • the system interference detection module In this embodiment, the following is specifically: when a signal in the range of 80 kHz to 120 kHz is detected, a trigger signal is generated, and a background environment signal in other frequency ranges is m
  • the control Unit 40 detects a system noise signal in a frequency range of the power supply, specifically a system noise in a range of 50 Hz to 75 Hz, and detects a signal within the range, and does not trigger the button detection unit 32 to perform button detection, and the control Unit 40 also does not make a button determination.
  • the amplitude of the system noise signal is lower than the first preset amplitude (100 mV in this embodiment), such as 50 mV, the amplitude of the system noise signal is transmitted to the control unit 40, The control unit 40 adds it to the reference signal of the system, and the system noise is determined during the subsequent determination of the valid signal of the button.
  • the amplitude of the acoustic signal is deducted to avoid the influence of power supply ripple interference on the judgment result. If the amplitude of the system noise signal is higher than the second predetermined amplitude (500 mV in this embodiment), such as 800 mV. Then, the amplitude of the system noise signal is transmitted to the control unit 40, and the control unit 40 performs limiting processing on the button, that is, in the process of determining the subsequent button valid signal, it is considered that the system noise is excessive beyond the amplitude, and is not a button. action.
  • the second predetermined amplitude 500 mV in this embodiment
  • the detection control module 314 controls the low frequency interference detection module 312 to detect the low frequency noise signal in the third frequency to the fourth frequency range, specifically 20 KHz. Low frequency noise signal detection up to 500KHz.
  • the receiving of the low frequency noise signal is implemented by the detection board 20.
  • the specific detection process is implemented by frequency hopping detection, where the frequency hopping detection refers to receiving only a signal whose frequency is equal to the frequency hopping frequency, wherein the frequency hopping frequency is increased from the third frequency (20 kHz) to the fourth frequency (500 kHz).
  • the increasing frequency hopping frequency is different from the decreasing frequency hopping frequency, wherein the frequency hopping frequency has an increasing value and a decreasing value of 2
  • the unit of frequency that is, the increment or decrement of the difference.
  • the detection control module 314 controls the high frequency interference detecting module 313 to the high frequency in the range of the fifth frequency (900 MHz) to the sixth frequency (3 GHz).
  • the noise signal is detected. If there is a high frequency noise signal in the frequency band, it is shielded, that is, the button detecting unit 32 and the control unit 40 are not triggered, thereby The misjudgment of the button action caused by the high frequency noise signal is avoided.
  • the detection control module 314 controls the system interference detection module 311, the low frequency interference detection module 312, and the high frequency interference detection module 313 to sequentially cycle, and repeatedly perform the system noise signal, the low frequency noise signal, and the high frequency noise signal. Test.
  • the low frequency interference detecting module 312 detects the first frequency (80KHz) to the second frequency
  • a trigger signal is generated, and the button detecting unit 32 and the control unit 40 are triggered to start working, wherein the button detecting unit 32 detects the capacitive touch button to acquire a button signal; the control unit 40 pairs The button signal is sampled, and when the number of times the button valid signal is sampled in the first time window (3 ms) reaches or exceeds a predetermined number of times, the control signal is output.
  • the sampling frequency is cyclically changed in the range of the first frequency to the second frequency, and the incrementing value or the decreasing value of the sampling frequency is one frequency unit, that is, the increasing of the difference or the decreasing of the equal difference.
  • the sampling frequency is first increased from the first frequency to the second frequency, each time increasing by one frequency unit, and maintaining a predetermined time at each frequency, that is, the sampling frequency is increased by one frequency unit every predetermined time; then, The sampling frequency is further decremented from the second frequency to the first frequency, each time decreasing by 1 frequency unit, and maintaining a predetermined time at each frequency, that is, the sampling frequency is decreased by 1 frequency unit every predetermined time; then the sampling frequency It is then incremented from the first frequency to the second frequency, and then decremented from the second frequency to the first frequency, and thus repeated.
  • the environment detecting unit 31 is still continuously detecting the background environment noise. If the number of times the button valid signal is sampled in the first time window is less than the predetermined number of times, that is, when no button action is detected in the first time window, no control signal is output, The environment detecting unit 31 enters a sleep state and stops detecting the background environment signal. If the number of times the button valid signal is sampled in the first time window is greater than or equal to the predetermined number of times, that is, in the first time window, when the button action is detected, and the corresponding control signal is output, the first The duration of the second time window is greater than the first time window. The duration of the second time window in this embodiment is 3 s.
  • the button signal is continuously sampled in the second time window, and in any of the first time windows in the second time window, the control signal is output when the number of times the button valid signal is sampled reaches or exceeds a predetermined number of times. That is, in the second time window, the detection of the button signal is still performed in units of the first time window, and if the number of valid signals of the button is greater than or equal to the predetermined number of times in a certain first time window in the second time window (80) Then, the control signal is output again.
  • the environment detecting unit 31 enters a sleep state, and stops Detection of background environmental signals. Entering the sleep state helps to reduce the power consumption of the entire system.
  • the button action is often continuous, such as the user's continuous button to adjust the volume, switch channels, etc., therefore, after confirming the button action in the first time window, open a second time window with a longer duration to capture tight With the subsequent button actions, the detection accuracy of the continuous button action can be effectively improved.
  • the anti-jamming capacitive touch button detection system further includes a watchdog module, after the preset sleep time (specifically 128 ms in this embodiment) of the environment monitoring unit 31 entering the sleep state
  • the environment detecting unit 31 is awakened to continue detecting the system noise signal, the low frequency noise signal, and the high frequency noise signal.
  • the duration of the button press of the person is much longer than 128 ms. Therefore, the time when the environment monitoring unit 31 enters the sleep state does not occur. The keystrokes are missed, which ensures the detection accuracy while reducing power consumption.
  • the control unit 40 further acquires a background environment signal from the environment detecting unit 31, and scans the system noise signal, the low frequency noise signal, and the high with the environment detecting unit 31 within a preset monitoring time.
  • the frequency noise signal is one round each time. If the time is 500 times (the time corresponding to the 500 detection rounds is the preset monitoring time, of course, the number can be adjusted according to the actual application), a certain frequency point The signal is always present, and the change threshold is compensated according to the signal amplitude of the frequency. For example, a metal component is placed in the vicinity of the capacitive touch button 21 for a long time, causing a disturbance of a fixed frequency of 30 kHz.
  • the control unit 40 adjusts the threshold of the change amount according to the signal amplitude of the frequency point. If the external interference of 30KHz causes the amount of charge of the capacitive touch button to decrease in the balanced state, when the button signal is detected, The change threshold is adjusted such that the adjusted change threshold is adapted to it. Therefore, through the above adjustment, the anti-jamming capacitive touch button detection system is adaptive to the environment, and after the fixed interference disappears, the threshold value is changed back to the initial value, thereby realizing the memory and recovery of the environment. Function, guarantee the accuracy of detection.
  • the above technical solution uses the variable frequency sampling button signal, and detects whether the sampled button signal is a button valid signal, compared to the existing fixed frequency sampling button signal, during the button detection process, the varying sampling frequency It is not easy to be tracked by the changed external signal, thus reducing the probability that the sampled signal is interfered by the external signal.
  • the received external signal is triggered within a predetermined frequency range (the first frequency to the second frequency), and the external signal is received by the frequency hopping reception, that is, within a certain time range.
  • the external signal receiving only one frequency, combined with the frequency conversion sampling further reduces the probability that the sampling signal coincides with the frequency of the external signal, and the possibility of the button detection being disturbed is greatly reduced.
  • the positive frequency hopping reception and the reverse frequency hopping reception are performed in a predetermined frequency range (the third frequency to the fourth frequency), and the repetition is performed, wherein the frequency hopping frequency of the positive frequency hopping reception and the frequency hopping frequency of the reverse frequency hopping frequency Differently, the frequency hopping frequency will stay at each frequency, so it will not be missed, thus improving the detection success rate.

Description

^检测方法及装置
本申请要求于 2010 年 9 月 30 日提交中国专利局、 申请号为 201010515086.3、 发明名称为 "按键检测方法及装置"的中国专利申请的优先 权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及电子技术领域, 特别涉及按键检测方法及装置。
背景技术
目前,各种类型的按键已广泛应用于各种电子产品中,按键检测的成功率 直接影响了电子产品的使用。按键检测通常是指检测对按键进行的操作,确定 该按键是否被按下。 现有的按键检测方法包括下述基本步骤: 检测按键, 获取按键信号; 以固 定频率采样所述按键信号,在预定的时间范围内采样到按键有效信号的次数达 到或超过预定的次数时, 输出控制信号。 上述按键检测过程中, 如果有外界环境因素干扰, 如有手机、 其他电器等 产生的噪声干扰, 则会使按键的误触发率或漏检率升高, 由此降低按键检测的 成功率。
发明内容
本发明要解决的是现有的按键检测因容易受外界环境的干扰而导致按键 检测的成功率不高的问题。
为解决上述技术问题, 本发明实施方式提供一种按键检测方法, 包括下述 步骤: 检测按键, 获取按键信号; 变频采样所述按键信号, 在预定时间范围内 采样到按键有效信号的次数达到或超过预定次数时, 输出控制信号, 其中, 所 述变频采样是指采样频率从第一频率递增至第二频率,再从第二频率递减至第 一频率, 并重复所述递增和递减过程, 且所述采样频率在每个频率驻留预定时 间。
可选的, 所述采样频率的递增值或递减值为 1个频率单位。
可选的, 所述按键为电容式触摸按键。
可选的, 所述按键为接触式按键或空气式按键。
可选的, 所述检测按键, 获取按键信号包括: 检测电容的电荷变化量; 获 取按键信号, 所述按键信号为对应所述电容的电荷变化量的数字信号。
可选的, 所述采样到按键有效信号包括: 采样所述按键信号; 若所述按键 信号所表示的数值大于变化量阈值, 则所述采样到的按键信号为按键有效信 号。
可选的, 所述预定时间范围为 3ms, 所述预定次数为 80, 所述第一频率 为 80KHz, 所述第二频率为 120KHz, 所述预定时间为 5 s; 所述采样频率的 递增值或递减值为 1ΚΗζ。
可选的, 所述触摸检测方法还包括: 接收外界信号; 当所述外界信号的频 率在所述第一频率至第二频率的频率范围内时产生用于触发所述按键检测的 触发信号。
可选的, 所述接收外界信号包括: 跳频接收外界信号, 所述跳频接收是指 仅接收频率与跳频频率相同的外界信号, 其中, 所述跳频频率从第三频率递增 至第四频率, 再从第四频率递减至第三频率, 并重复所述递增和递减过程, 所 述递增的跳频频率与递减的跳频频率不同, 所述第三频率小于所述第一频率, 所述第四频率大于所述第二频率。 可选的, 所述跳频频率的递增值或递减值为 2个频率单位。 可选的, 所述第三频率至第四频率的频率范围包括连续的第一频率范围、 第二频率范围和第三频率范围,所述第二频率范围包括所述第一频率至第二频 率的频率范围, 所述跳频频率在所述第一频率范围、第三频率范围内的每个频 率的驻留时间小于所述跳频频率在所述第二频率范围内的每个频率的驻留时 间。
可选的, 所述第三频率为 20KHz, 所述第四频率为 500KHz。
可选的, 所述第三频率至第四频率的频率范围包括连续的第一频率范围、 第二频率范围和第三频率范围, 所述第一频率范围为 20KHz~80KHz, 所述第 二频率范围为 80KHz~300KHz, 所述第三频率范围为 300~500KHz; 所述跳频 频率在所述第一频率范围、 第三频率范围内的每个频率的驻留时间为 0.1ms, 所述跳频频率在所述第二频率范围内的每个频率的驻留时间为 0.2ms。
可选的, 所述跳频频率从第三频率递增至第四频率包括: 所述跳频频率从 20KHz增至 21 KHz , 然后以每次 2KHz递增至 499ΚΗζ , 接着从 499KHz增至 500KHz; 所述跳频频率从第四频率递减至第三频率包括: 所述跳频频率以每 次 2KHz从 500KHz递减至 20KHz。 为解决上述技术问题, 本发明实施方式还提供一种按键检测装置, 包括: 按键检测单元, 用于检测按键, 获取按键信号; 有效信号检测单元, 用于变频 采样所述按键信号,并在预定时间范围内采样到按键有效信号的次数达到或超 过预定次数时, 输出控制信号, 其中, 所述变频采样是指采样频率从第一频率 递增至第二频率,再从第二频率递减至第一频率,并重复所述递增和递减过程, 且所述采样频率在每个频率驻留预定时间。 可选的, 所述采样频率的递增值或递减值为 1个频率单位。
可选的, 所述按键为电容式触摸按键。
可选的, 所述按键为接触式按键或空气式按键。
可选的, 所述按键检测单元包括: 电容检测单元, 用于检测电容的电荷变 化量,获取按键信号,所述按键信号为对应所述电容的电荷变化量的数字信号。
可选的,所述按键信号为按键有效信号是指所述按键信号所表示的数值大 于变化量阈值。
可选的, 所述预定时间范围为 3ms, 所述预定次数为 80, 所述第一频率 为 80KHz, 所述第二频率为 120KHz, 所述预定时间为 5 s; 所述采样频率的 递增值或递减值为 1ΚΗζ。
可选的, 所述按键检测装置还包括: 接收单元, 用于接收外界信号; 外界 信号检测单元,用于当所述外界信号的频率在所述第一频率至第二频率的频率 范围内时产生用于触发所述按键检测的触发信号,所述按键检测单元在接收到 所述触发信号后检测按键, 获取按键信号。
可选的, 所述接收单元包括: 天线, 用于接收外界的环境信号; 跳频接收 单元, 用于跳频接收外界信号, 所述跳频接收是指仅将频率与跳频频率相同的 外界的环境信号作为外界信号接收, 其中, 所述跳频频率从第三频率递增至第 四频率, 再从第四频率递减至第三频率, 并重复所述递增和递减过程, 所述递 增的跳频频率与递减的跳频频率不同, 所述第三频率小于所述第一频率, 所述 第四频率大于所述第二频率。 可选的, 所述跳频频率的递增值或递减值为 2个频率单位。
可选的, 所述第三频率至第四频率的频率范围包括连续的第一频率范围、 第二频率范围和第三频率范围,所述第二频率范围包括所述第一频率至第二频 率的频率范围, 所述跳频频率在所述第一频率范围、第三频率范围内的每个频 率的驻留时间小于所述跳频频率在所述第二频率范围内的每个频率的驻留时 间。
可选的, 所述第三频率为 20KHz, 所述第四频率为 500KHz。
可选的, 所述第三频率至第四频率的频率范围包括连续的第一频率范围、 第二频率范围和第三频率范围, 所述第一频率范围为 20KHz~80KHz, 所述第 二频率范围为 80KHz~300KHz, 所述第三频率范围为 300~500KHz; 所述跳频 频率在所述第一频率范围、 第三频率范围内的每个频率的驻留时间为 0.1ms, 所述跳频频率在所述第二频率范围内的每个频率的驻留时间为 0.2ms。 可选的, 所述跳频频率从第三频率递增至第四频率是指: 所述跳频频率从 20KHz增至 21 KHz , 然后以每次 2KHz递增至 499ΚΗζ , 接着从 499KHz增至 500KHz; 所述跳频频率从第四频率递减至第三频率是指: 所述跳频频率以每 次 2KHz从 500KHz递减至 20KHz。 与现有技术相比, 上述技术方案采用变频采样按键信号, 并检测采样到的 按键信号是否为按键有效信号,相比于现有的采用固定频率采样按键信号, 在 按键检测过程中, 变化的采样频率不易被变化的外界信号所跟踪, 因而降低了 采样信号被外界信号干扰的概率。 进一步,在接收到的外界信号在预定的频率范围内(第一频率至第二频率 ) 才触发按键检测, 并且, 接收外界信号采用的是跳频接收, 即在一定时间范围 内仅接收一种频率的外界信号, 与变频采样相结合, 进一步降低了采样信号与 外界信号的频率重合的概率, 按键检测被干扰的可能性大大降低了。
另外, 在预定的频率范围内 (第三频率至第四频率)采用正跳频接收和反 跳频接收, 并重复进行, 其中, 正跳频接收的跳频频率与反跳频的跳频频率不 同, 跳频频率会在每个频率驻留, 因此不会漏检, 从而提高了检测成功率。
附图说明 图 1是本发明一个实施例的按键检测方法的流程示意图;
图 2是图 1所示步骤 S12的详细流程示意图; 图 3是本发明另一个实施例的按键检测方法的流程示意图; 图 4是本发明一个实施例的按键检测装置的结构示意图; 图 5是本发明另一个实施例的按键检测装置的结构示意图; 图 6是一种抗干扰电容触摸按键检测系统的结构示意图; 图 7是一种抗干扰电容触摸按键检测系统的详细结构示意图。
具体实施方式 发明人发现, 现有的按键检测技术中, 由于是以固定频率采样按键信号, 不断变化的外界环境的信号较易跟踪到采样信号的频率, 进而干扰采样信号, 导致无法检测到有效的按键信号, 或者将干扰信号误认为是有效的按键信号。 因此,发明人提出了变频采样按键信号的方式, 以降低采样信号被外界干扰信 号影响的概率。
下面结合附图和具体实施例对本发明实施方式进行详细说明,需要说明的 是,以下实施例是以按键为电容式触摸按键为例进行说明的,在其他实施例中, 所述按键并不限于所述的电容式触摸按键, 例如, 也可以是电阻式按键, 开关 式按键等。
图 1为本发明一个实施例的按键检测方法的流程示意图,所述按键检测方 法包括:
步骤 S11 , 检测按键, 获取按键信号。
步骤 S12 , 变频采样所述按键信号, 在预定时间范围内采样到按键有效信 号的次数达到或超过预定次数时, 输出控制信号, 其中, 所述变频采样是指采 样频率从第一频率递增至第二频率,再从第二频率递减至第一频率, 并重复所 述递增和递减过程, 且所述采样频率在每个频率驻留第一预定时间。 下面对各步骤进行详细说明。 首先, 执行步骤 S11 , 检测按键, 获取按键信号。 在本实施例中, 所述按 键为电容式触摸按键, 例如空气式按键、 接触式按键, 通常, 按键具有一对地 的寄生电容,当手指按下按键时,相当于在寄生电容上并联一对地的手指电容, 因此可以通过对电容的电荷量或电容值的检测, 确定该按键是否被按下。 本实施例中, 步骤 S11具体包括:检测电容(如寄生电容)的电荷变化量; 获取按键信号, 所述按键信号为对应所述电容的电荷变化量的数字信号, 用于 在后续步骤中确定该按键是否被按下。 其中,对应所述电容的电荷变化量的数 字信号是指该数字信号所表示的数值可以为所述电容的电荷变化量,或可以与 所述电容的电荷变化量成比例关系。由于电容的电荷变化量的检测技术为本领 域技术人员所熟知, 在此不再赘述。 接着执行步骤 S12, 变频采样所述按键信号, 在预定时间范围内采样到按 键有效信号的次数达到或超过预定次数时,输出控制信号。 即判断在预定时间 范围内是否采样到按键有效信号的次数达到或超过预定次数,若是则输出控制 信号, 表示该按键很有可能被按下; 若否则判定为有外界信号干扰。 所述变频 采样是指采样频率从第一频率递增至第二频率, 再从第二频率递减至第一频 率, 并重复所述递增和递减过程, 且所述采样频率在每个频率驻留预定时间。 所述采样到按键有效信号包括: 采样所述按键信号; 若所述按键信号所表 示的数值大于变化量阈值, 则所述采样到的按键信号为按键有效信号。 本实施例步骤 S12详细如图 2所示, 包括: 步骤 S121 , 采样所述按键信号, 即对步骤 S11获取的对应于电容的电荷 变化量的数字信号进行采样, 采样频率从第一频率递增至第二频率,再从第二 频率递减至第一频率, 并重复所述递增和递减过程,且所述采样频率在每个频 率驻留预定时间。 本实施例中, 采样频率在第一频率至第二频率的范围(包括第一频率和第 二频率)轮回变化, 所述采样频率的递增值(从第一频率递增至第二频率时, 每次频率的增加量)或递减值(从第二频率递减至第一频率时, 每次频率的减 小量)为 1个频率单位, 即为等差递增或等差递减。 具体地, 采样频率先从第 一频率递增至第二频率,每次增加 1个频率单位(即第一频率和第二频率的单 位, 如单位为千赫兹 (KHz ), 则每次增加 ΙΚΗζ ), 且在每个频率保持预定时 间, 也就是说每隔预定时间采样频率增加 1个频率单位; 然后, 采样频率再从 第二频率递减至第一频率,每次减小 1个频率单位,且在每个频率保持预定时 间,也就是说每隔预定时间采样频率减小 1个频率单位;接着采样频率再从第 一频率递增至第二频率, 再从第二频率递减至第一频率, 如此反复。 所述第一频率和第二频率为按键被操作(按下)后产生的信号的频率下限 和频率下限, 其通常为根据实际情况而定的经验值。 本实施例中, 以人的手指 按下电容式触摸按键为例, 通常产生频率为 80KHz至 120KHz的信号, 因此 第一频率设定为 80KHz, 第二频率设定为 120KHz, 所述采样频率递增值或递 减值为 1ΚΗζ。 所述预定时间根据所述预定时间范围和预定次数(可以为经验 值)而确定, 即预定时间可以确定在预定时间范围内采样到大于预定次数的按 键信号, 以所述预定时间范围为 3ms, 所述预定次数为 80为例, 所述预定时 间可以为 5 s。 采样频率从 80KHz开始, 5 s后增至 81KHz, 再过 5 s增至
82KHz, , 采样频率增至 120KHz, 这个递增过程的时间为 200μ8; 然后,
5 s后采样频率从 120ΚΗζ减至 119ΚΗζ, 再过 5 s减至 118ΚΗζ, , 采样 频率减至 80KHz, 这个递减过程的时间为 200μ8; —个轮回过程包括一个递增 过程和一个递减过程, 为 400μδ, 通常可以采样到 11次按键信号(数字信号 ), 3ms包括 7.5个轮回过程, 因此可以采样到大约 82~83次数字信号。 步骤 S122 , 判断所述采样到的按键信号是否为按键有效信号, 若是则执 行步骤 S123 , 若否则执行步骤 S124。 所述按键信号为按键有效信号是指所述 采样到的按键信号 (即数字信号)所表示的数值大于变化量阈值。
步骤 S123 , 计数值加 1 , 执行步骤 S124。 所述计数值的初始值为 0, 当所 述采样到的按键信号为按键有效信号时, 计数值加 1 , 计数值是对采样到按键 有效信号的次数进行计数。 步骤 S124, 判断是否达到或超过预定时间范围, 若是则执行步骤 S125 , 若否则执行步骤 S122。 若所述采样到的按键信号不是按键有效信号时或若所 述采样到的按键信号为按键有效信号且计数值加 1 后, 判断当前时间与步骤 S12 开始执行的时间之差是否大于或等于预定时间范围, 若是则执行步骤 S125 , 若否则执行步骤 S122。 步骤 S125 ,判断计数值是否大于或等于预定次数,若是则执行步骤 S126, 若否则执行步骤 S127。 若当前时间与步骤 S12开始执行的时间之差大于或等 于预定时间范围, 则判断计数值是否大于等于预定次数, 若是则执行步骤 S126, 若否则执行步骤 S127。
步骤 S126, 输出控制信号。 若在预定时间范围内计数值大于或等于预定 次数, 则输出控制信号, 说明该按键被按下或很有可能被按下。 步骤 S127, 判定有外界信号干扰。 若在预定时间范围内计数值小于预定 次数, 则说明该按键没有被按下, 外界可能有干扰信号干扰按键检测。
通常情况下, 上述步骤 S121和步骤 S122~S125可以并行进行。 所述控制信号和 /或是否在预定时间范围内采样到按键有效信号的次数达 到或超过预定次数的判断结果可以作为后续进一步判断对该按键进行操作的 情况, 例如, 可以在 3s内重复执行步骤 S 11和 S 12 , 若一直有控制信号产生, 则说明该按键可能被连续按下。
图 3为本发明另一个实施例的按键检测方法的流程示意图,本实施例与第 一个实施例的区别在于:在执行所述步骤 S11前,还可以包括:接收外界信号; 当所述外界信号的频率在所述第一频率至第二频率的频率范围内时产生用于 触发所述按键检测的触发信号,即触发信号产生后,启动步骤 S 11的按键检测。
图 3所示的按键检测方法包括:
步骤 S21 , 接收外界信号;
步骤 S22 , 当所述外界信号的频率在所述第一频率至第二频率的频率范围 内时产生用于触发所述按键检测的触发信号;
步骤 S11 , 检测按键, 获取按键信号, 即, 在触发信号产生后, 开始检测 按键;
步骤 S12 , 变频采样所述按键信号, 在预定时间范围内采样到按键有效信 号的次数达到或超过预定次数时, 输出控制信号, 其中, 所述变频采样是指采 样频率从第一频率递增至第二频率,再从第二频率递减至第一频率, 并重复所 述递增和递减过程, 且所述采样频率在每个频率驻留第一预定时间。 上述步骤 S 11和 S12与第一个实施例相同, 下面仅对步骤 S21和 S22进 行详细说明。
首先执行步骤 S21 , 接收外界信号。 所述外界信号包括外部按键操作所产 生的信号和外界的环境信号。所述外界信号可以通过天线接收, 天线可接收信 号的频率范围由天线的特性确定, 本实施例中, 天线可接收信号的频率范围为 20KHz~500KHz的氏频信号。 本实施例中, 所述接收外界信号包括: 跳频接收外界信号, 所述跳频接收 是指仅接收频率与跳频频率相同的外界信号, 其中, 所述跳频频率从第三频率 递增至第四频率,再从第四频率递减至第三频率,并重复所述递增和递减过程, 所述递增的跳频频率与递减的跳频频率不同, 所述第三频率小于所述第一频 率, 所述第四频率大于所述第二频率。 所述第三频率即为天线可接收信号的频 率范围的下限值, 例如为 20KHz; 所述第四频率即为天线可接收信号的频率 范围的上限值, 例如为 500KHz。 在其他实施例中, 也可以不采用跳频接收, 而使天线一直保持接收状态。
本实施例中, 所述跳频频率的递增值(从第三频率递增至第四频率时, 每 次频率的增加量)或递减值(从第四频率递减至第三频率时, 每次频率的减小 量) 为 2个频率单位, 即为等差递增或等差递减。
所述跳频频率从 20KHz递增至 500KHz为奇数等差跳频, 包括: 所述跳频 频率从 20KHz增至 21KHz,然后以每次 2KHz递增至 499KHz,接着从 499KHz 增至 500KHz;所述跳频频率从 500KHz递减至 20KHz为偶数等差跳频,包括: 所述跳频频率以每次 2KHz从 500KHz递减至 20KHz。 另外, 所述第三频率至第四频率的频率范围包括连续的第一频率范围、第 二频率范围和第三频率范围,所述第二频率范围包括所述第一频率至第二频率 的频率范围, 所述跳频频率在所述第一频率范围、第三频率范围内的每个频率 的驻留时间小于所述跳频频率在所述第二频率范围内的每个频率的驻留时间。 以第三频率为 20KHz、 第四频率为 500KHz 为例, 所述第一频率范围为 20KHz~80KHz, 所述第二频率范围为 80KHz~300KHz, 所述第三频率范围为 300~500KHz; 所述跳频频率在所述第一频率范围、 第三频率范围内的每个频 率的驻留时间 (即跳频频率为该频率的保持保持时间)为 0.1ms, 所述跳频频 率在所述第二频率范围内的每个频率的驻留时间为 0.2ms。
在其他实施例中, 所述跳频频率在所述第一频率范围、第二频率范围和第 三频率范围内(即第三频率至第四频率的频率范围)的每个频率的驻留时间也 可以是相同的。本实施例中, 由于第一频率范围或第三频率范围的外界信号通 常可被认为是干扰信号, 因此通过缩短所述跳频频率在所述第一频率范围、 第 三频率范围内的每个频率的驻留时间(即小于所述跳频频率在所述第二频率范 围内的每个频率的驻留时间), 以加快所述跳频频率在所述第一频率范围、 第 三频率范围内的跳频速率, 由此可以节省检测时间和提高系统资源的利用率。
接着执行步骤 S22, 当所述外界信号的频率在第一频率至第二频率的频率 范围时产生用于触发所述按键检测的触发信号。所述第一频率和第二频率为按 键被操作 (如被按下 )后产生的信号的频率下限和频率下限, 本实施例的第一 频率为 80KHz, 第二频率为 120KHz。 本实施例是在所述接收到的外界信号的 频率为所述第一频率或第二频率或第一频率和第二频率之间的频率时,即有可 能有按键被操作的情况下, 再继续后续的按键检测步骤。 具体地, 判断所述接 收的外界信号的频率是否在第一频率至第二频率的频率范围,若是则产生触发 信号, 若否则判定为外界的环境干扰。 对应上述按键检测方法, 本发明一个实施例的按键检测装置如图 4所示, 包括按键检测单元 41和有效信号检测单元 42。
所述按键检测单元 41 , 用于检测按键, 获取按键信号。 本实施例中, 所 述按键为电容式触摸按键, 所述按键检测单元为电容检测单元, 用于检测电容 的电荷变化量, 获取按键信号, 所述按键信号为对应所述电容的电荷变化量的 数字信号。 本实施例中, 所述电容检测单元由模数转换器 ADC实现, ADC检 测电容的电荷变化量, 并将电荷变化的模拟量转换为数字量。
有效信号检测单元 42 , 用于变频采样所述按键信号, 并在预定时间范围 内采样到按键有效信号的次数达到或超过预定次数时, 输出控制信号, 其中, 所述变频采样是指采样频率从第一频率递增至第二频率,再从第二频率递减至 第一频率, 并重复所述递增和递减过程,且所述采样频率在每个频率驻留预定 时间。所述采样频率的递增值或递减值可以为 1个频率单位。所述按键信号为 按键有效信号是指所述按键信号所表示的数值大于变化量阈值。 本实施例中, 所述有效信号检测单元由微控制器 MCU实现。
本发明另一个实施例的按键检测装置如图 5所示, 包括接收单元 51、 外 界信号检测单元 52、 按键检测单元 41和有效信号检测单元 42。 其中, 接收单元 51 , 用于接收外界信号。 本实施例中, 接收单元包括天线 511 和跳频接收单元 512 , 所述天线 511 , 用于接收外界的环境信号; 所述跳频接 收单元 512 , 用于跳频接收外界信号, 所述跳频接收是指仅将频率与跳频频率 相同的外界的环境信号作为外界信号接收, 并送至外界信号检测单元 52。 其 中 ,所述跳频频率从第三频率递增至第四频率 ,再从第四频率递减至第三频率 , 并重复所述递增和递减过程, 所述递增的跳频频率与递减的跳频频率不同, 所 述第三频率小于所述第一频率, 所述第四频率大于所述第二频率。在其他实施 例中, 接收单元也可以为天线, 即直接将外界的环境信号作为外界信号接收, 并送至外界信号检测单元 52。 所述跳频频率的递增值或递减值为 2个频率单位。所述第三频率至第四频 率的频率范围包括连续的第一频率范围、第二频率范围和第三频率范围, 所述 第二频率范围包括所述第一频率至第二频率的频率范围,所述跳频频率在所述 第一频率范围、第三频率范围内的每个频率的驻留时间小于所述跳频频率在所 述第二频率范围内的每个频率的驻留时间。 外界信号检测单元 52, 用于当所述外界信号的频率在第一频率至第二频 率的频率范围内时产生用于触发所述按键检测的触发信号。所述外界信号检测 单元 52与所述按键检测单元 41连接, 向所述按键检测单元 41发送所述触发 信号。 按键检测单元 41 , 用于在接收到所述外界信号检测单元 52发送的触发信 号后检测按键, 获取按键信号。 所述有效信号检测单元 42与第一个实施例相 同, 在此不再赘述。 上述按键检测方法可以应用于按键检测系统, 以排除环境噪声的干扰,提 高按键动作的检测精度。 所述按键可以为接触式按键, 尤其是电容触摸按键, 也可以为其它按键, 比如空气式按键, 所述接触式按键是指人体会与按键中的 金属极板直接接触的按键,所述空气式按键是指人体不会直接与按键中的金属 极板直接接触的按键。 如图 5示出了一种抗干扰电容触摸按键检测系统的结构示意图, 包括: 电 容触摸按键 21 ; 环境检测单元 31 ,用于检测背景环境信号,屏蔽第一频率(本 实施例中为 80KHz )至第二频率(本实施例中为 120KHz )范围外的信号, 在 检测到所述第一频率至第二频率范围内的信号后,产生触发信号; 按键检测单 元 32, 由所述触发信号触发, 对所述电容触摸按键进行检测, 获取按键信号; 控制单元 40, 由所述触发信号触发, 对所述按键信号进行采样, 在第一时间 窗口中采样到按键有效信号的次数达到或超过预定次数时, 输出控制信号。 其中, 电容触摸按键 21分布设置在侦测板 20上, 所述侦测板 20可以为 一块印刷电路板(PCB )。 所述侦测板 20上还设置有至少一个平衡点 22, 所 述平衡点 22为金属材料, 用于调节所述侦测板 20的频率接收和响应范围, 下 文将进行详细描述。
此外,所述环境检测单元 31和按键检测单元 32可以集成在同一检测芯片 30上。 所述按键检测单元 32用于检测电容触摸按键 21的电荷变化量, 也即 电容触摸按键 21上当前的电荷量与电容触摸按键在初始平衡状态下的电荷量 之间的差值, 之后, 将所述电荷变化量转化为相应的数字信号, 也就是说所述 数字信号表示出了所述电荷变化量。
所述控制单元 40可以通过一微控制器( MCU, Micro Controller Unit ) 实 现。 图 7为图 6的详细结构示意图, 其中, 所述环境检测单元 31包括: 系统 干扰检测模块 311 , 用于检测供电电源的频率范围内的系统噪声信号; 低频干 扰检测模块 312, 用于检测第三频率至第四频率范围内的低频噪声信号, 所述 第三频率小于所述第一频率, 所述第四频率大于所述第二频率,在检测到所述 第一频率至第二频率范围内的信号后,产生触发信号; 高频干扰检测模块 313 , 用于检测第五频率至第六频率范围内的高频噪声信号,所述第五频率大于所述 第四频率; 检测控制模块 314, 用于控制所述系统干扰检测模块 311、 低频干 扰检测模块 312和高频干扰检测模块 313依次循环工作。
其中, 所述系统干扰检测模块 311主要用于检测供电电源产生的噪声, 以 及供电电源频率范围内的其他噪声。本实施例中, 所使用的供电电源为照明电 源变压后产生, 相应的系统噪声信号的检测范围为 50Hz至 75Hz。 一般的, 可
所述低频干扰检测模块 312主要用于检测低频噪声信号,其频率范围为第 三频率至第四频率, 本实施例中具体为 20KHz至 500KHz。 为了匹配接收该频 段范围内的信号, 本实施例中将所属侦测板 20用作低频干扰检测模块 312的 天线, 通过调整所述侦测板 20的形状、 尺寸, 并在其上甚至一个或多个金属 材料的平衡点 22, 对整个侦测板 20的容抗和感抗进行调整, 使其的频响和信 号的接收范围能够包括所述第三频率至第四频率的频段范围, 即能够接收 20KHz至 500KHz的低频频率。 本实施例中, 所述侦测板 20的容抗为 0.5pF 左右, 感抗为 O.lmH至 0.8mH。 由于将所述按键 21 以及侦测板 20整体作为 低频干扰检测模块 312的天线, 而不需要配置专门的低频天线, 因而提高了系 统的集成度, 利于减小最终产品的体积。
所述高频干扰检测模块 313 用于检测频率范围为第五频率至第六频率的 高频噪声信号, 具体为 900MHz至 3GHz。 其信号的接收通过单独的天线 312a 实现。
下面结合图 7对本实施例的抗干扰电容触摸按键检测系统以及其工作过 程中的检测方法进行详细描述。 所述抗干扰电容触摸按键检测系统在上电开启后, 首先进行初始化, 所述 初始化包括对检测芯片 30进行初始化, 也即对环境检测单元 31、 按键检测单 元 32进行初始化; 还包括对控制单元 40的初始化等, 所述初始化过程约为 20ms左右。
在完成初始化之后,所述环境检测单元 31开始对背景环境信号进行检测, 将第一频率至第二频率范围外的信号屏蔽,在检测到第一频率至第二频率范围 内的信号时, 产生触发信号。 本实施例中具体为: 在检测到 80KHz至 120KHz 范围内的信号时,产生触发信号, 而将其他频率范围内的背景环境信号进行屏 蔽。 应该理解的是, 所述检测到 80KHz 至 120KHz 范围内的信号指的是在 80KHz至 120KHz存在一个幅度大于某一幅度阈值的信号。所述背景环境信号 的检测过程也即为图 3中的步骤 Sll。 下面对背景环境噪声的检测过程进行详细说明。 首先, 系统干扰检测模块
311对供电电源的频率范围内的系统噪声信号进行检测, 具体为 50Hz至 75Hz 范围内的系统噪声, 在此范围内检测到信号, 并不触发所述按键检测单元 32 进行按键检测, 所述控制单元 40也不进行按键判断。作为一个优选的实施例, 若所述系统噪声信号的幅度低于第一预设幅度(本实施例为 lOOmV ) 时, 如 为 50mV, 将该系统噪声信号的幅度传输至控制单元 40, 所述控制单元 40将 其加入系统的基准信号中,在后续的按键有效信号的判断过程中,将该系统噪 声信号的幅度扣除,避免了电源纹波干扰对判定结果的影响。若所述系统噪声 信号的幅度高于第二预设幅度 (本实施例中为 500mV ), 如 800mV。 则将该系 统噪声信号的幅度传输至所述控制单元 40, 所述控制单元 40对其进行限幅处 理, 即在后续的按键有效信号的判定过程中, 认为超过此幅度极为系统噪声, 并非按键动作。 在所述系统干扰检测模块 311完成系统噪声信号的检测之后,所述检测控 制模块 314控制所述低频干扰检测模块 312进行第三频率至第四频率范围内的 低频噪声信号的检测, 具体为 20KHz至 500KHz范围内的低频噪声信号检测。 所述低频噪声信号的接收通过所述侦测板 20实现。 具体检测过程通过跳频检 测实现, 所述跳频检测是指同一时刻仅接收频率等于跳频频率的信号, 其中, 所述跳频频率从第三频率(20KHz )递增至第四频率(500KHz ), 再从第四频 率(500KHz )递减至第三频率(20KHz ), 所述递增的跳频频率与所述递减的 跳频频率不同, 其中, 所述跳频频率的递增值和递减值为 2个频率单位, 即为 等差递增或递减。
若在 80KHz至 120KHz范围之外存在低频噪声信号, 则对其进行屏蔽, 也即并不去触发所述按键检测单元 32和控制单元 40, 从而避免了低频噪声信 号导致的按键动作的误判。
在所述低频干扰检测模块 312对低频噪声信号检测完成之后,所述检测控 制模块 314控制所述高频干扰检测模块 313对第五频率 (900MHz ) 至第六频 率(3GHz ) 范围内的高频噪声信号进行检测。 若该频段内存在高频噪声信号 则对其进行屏蔽, 也即并不去触发所述按键检测单元 32和控制单元 40, 从而 避免了高频噪声信号导致的按键动作的误判。
之后, 所述检测控制模块 314控制所述系统干扰检测模块 311、 低频干扰 检测模块 312和高频干扰检测模块 313依次循环工作,反复的对所述系统噪声 信号、 低频噪声信号和高频噪声信号进行检测。
若所述低频干扰检测模块 312检测到所述第一频率( 80KHz )至第二频率
( 120KHz )范围内有信号, 则产生触发信号, 触发所述按键检测单元 32和控 制单元 40开始工作, 其中, 按键检测单元 32对所述电容触摸按键进行检测, 获取按键信号;控制单元 40对所述按键信号进行采样,在第一时间窗口( 3ms ) 中采样到按键有效信号的次数达到或超过预定次数时, 输出控制信号。 本实施例中, 采样频率在第一频率至第二频率的范围轮回变化, 所述采样 频率的递增值或递减值为 1个频率单位, 即为等差递增或等差递减。 具体地, 采样频率先从第一频率递增至第二频率,每次增加 1个频率单位,且在每个频 率保持预定时间, 也就是说每隔预定时间采样频率增加 1个频率单位; 然后, 采样频率再从第二频率递减至第一频率,每次减小 1个频率单位,且在每个频 率保持预定时间,也就是说每隔预定时间采样频率减小 1个频率单位;接着采 样频率再从第一频率递增至第二频率,再从第二频率递减至第一频率,如此反 复。
需要说明的是, 所述控制单元 40在对按键信号采样的过程中, 所述环境 检测单元 31仍然在不断的对背景环境噪声进行检测。 若在所述第一时间窗口中采样到按键有效信号的次数小于所述预定次数 时, 即在第一时间窗口中, 都没有检测到按键动作时, 没有输出控制信号, 则 所述环境检测单元 31进入休眠(sleep )状态, 停止对背景环境信号的检测。 若在所述第一时间窗口中采样到按键有效信号的次数大于或等于所述预 定次数时, 即在第一时间窗口中, 有检测到按键动作, 并产生输出相应的控制 信号,则开启第二时间窗口,所述第二时间窗口的持续时间大于第一时间窗口, 本实施例中第二时间窗口的持续时间为 3s。 在第二时间窗口内继续对所述按 键信号进行采样,在所述第二时间窗口中的任一第一时间窗口中, 采样到按键 有效信号的次数达到或超过预定次数时,输出控制信号。即在第二时间窗口中, 仍然以第一时间窗口为单位进行按键信号的检测,若在第二时间窗口中的某一 第一时间窗口内, 按键有效信号的次数大于或等于预定次数(80次), 则再次 输出控制信号。若第二时间窗口中采样到按键有效信号的次数小于所述预定次 数时, 即整个第二时间窗口中都没有检测到真实有效的按键动作, 则所述环境 检测单元 31进入休眠状态, 停止对背景环境信号的检测。 进入休眠状态有利 于减小整个系统的功耗。 在实际的使用中, 按键动作往往是连续的, 如用户连 续的按键调整音量、 切换频道等, 因此, 在第一时间窗口确认按键动作后, 开 启持续时间更长的第二时间窗口以捕捉紧随其后的其他按键动作,能够有效的 提高对连续按键动作的检测精度。
本实施例中, 所述抗干扰电容触摸按键检测系统还包括看门狗 (Watch Dog )模块, 在所述环境监测单元 31 进入休眠状态的预设休眠时间 (本实施 例中具体为 128ms )后, 唤醒所述环境检测单元 31 , 使其继续对系统噪声信 号、 低频噪声信号、 高频噪声信号进行检测。 一般来说, 人的按键动作的持续 时间远大于 128ms, 因此, 所述环境监测单元 31进入休眠状态的时间并不会 错过按键动作, 从而在降低功耗的同时, 保证了检测精度。 作为一个优选的实施例,所述控制单元 40还从所述环境检测单元 31中获 取背景环境信号, 在预设监控时间内, 以所述环境检测单元 31扫描系统噪声 信号、 低频噪声信号、 高频噪声信号各一次为一轮回, 若在 500次轮回 (500 次检测轮回所对应的时间即为所述预设监控时间, 当然, 该数字可以根据实际 应用进行相应的调整)中, 某频点的信号始终存在, 则根据该频点的信号幅度 对所述变化量阈值进行补偿调整。 例如, 所述电容触摸按键 21附近长时间放 置了一金属部件, 造成了固定频率为 30KHz的干扰, 则在 500个轮回的背景 环境信号的检测中, 在 30KHz的频点上都存在干扰信号, 则控制单元 40将根 据该频点的信号幅度对所述变化量阈值进行补偿调整, 如 30KHz的外界干扰 导致电容触摸按键在平衡状态时的电荷量减少, 则对所述按键信号进行检测 时,对所述变化量阈值进行调整,使得调整后的变化量阈值与之相适应。因此, 通过上述调整, 实现了抗干扰电容触摸按键检测系统对环境的自适应,在所述 固定干扰消失后,再将所述变化量阈值调回初始值,从而实现了对环境的记忆 和恢复功能, 保证检测的精度。 综上所述, 上述技术方案采用变频采样按键信号, 并检测采样到的按键信 号是否为按键有效信号,相比于现有的采用固定频率采样按键信号,在按键检 测过程中, 变化的采样频率不易被变化的外界信号所跟踪, 因而降低了采样信 号被外界信号干扰的概率。 进一步,在接收到的外界信号在预定的频率范围内(第一频率至第二频率 ) 才触发按键检测, 并且, 接收外界信号采用的是跳频接收, 即在一定时间范围 内仅接收一种频率的外界信号, 与变频采样相结合, 进一步降低了采样信号与 外界信号的频率重合的概率, 按键检测被干扰的可能性大大降低了。
另外, 在预定的频率范围内 (第三频率至第四频率)采用正跳频接收和反 跳频接收, 并重复进行, 其中, 正跳频接收的跳频频率与反跳频的跳频频率不 同, 跳频频率会在每个频率驻留, 因此不会漏检, 从而提高了检测成功率。 虽然本发明已以较佳实施例披露如上,但本发明并非限定于此。任何本领 域技术人员, 在不脱离本发明的精神和范围内, 均可作各种更动与修改, 因此 本发明的保护范围应当以权利要求所限定的范围为准。

Claims

权 利 要 求
1. 一种按键检测方法, 其特征在于, 包括下述步骤:
检测按键, 获取按键信号;
变频采样所述按键信号,在预定时间范围内采样到按键有效信号的次数达 到或超过预定次数时, 输出控制信号,
其中, 所述变频采样是指采样频率从第一频率递增至第二频率,再从第二 频率递减至第一频率, 并重复所述递增和递减过程,且所述采样频率在每个频 率驻留预定时间。
2. 如权利要求 1所述的按键检测方法, 其特征在于, 所述采样频率的递增值 或递减值为 1个频率单位。
3. 如权利要求 1所述的按键检测方法, 其特征在于, 所述按键为电容式触摸 按键。
4. 如权利要求 1所述的按键检测方法, 其特征在于, 所述按键为接触式按键 或空气式按键。
5. 如权利要求 3所述的按键检测方法, 其特征在于, 所述检测按键, 获取按 键信号包括: 检测电容的电荷变化量; 获取按键信号, 所述按键信号为对应所 述电容的电荷变化量的数字信号。
6. 如权利要求 5所述的按键检测方法, 其特征在于, 所述采样到按键有效信 号包括: 采样所述按键信号; 若所述按键信号所表示的数值大于变化量阈值, 则所述采样到的按键信号为按键有效信号。
7. 如权利要求 3所述的按键检测方法,其特征在于,所述预定时间范围为 3ms, 所述预定次数为 80, 所述第一频率为 80KHz, 所述第二频率为 120KHz, 所述 预定时间为 5 s; 所述采样频率的递增值或递减值为 1ΚΗζ。
8. 如权利要求 1或 3所述的按键检测方法, 其特征在于, 还包括:
接收外界信号;
当所述外界信号的频率在所述第一频率至第二频率的频率范围内时产生 用于触发所述按键检测的触发信号。
9. 如权利要求 8所述的按键检测方法, 其特征在于, 所述接收外界信号包括: 跳频接收外界信号, 所述跳频接收是指仅接收频率与跳频频率相同的外界信 号, 其中,
所述跳频频率从第三频率递增至第四频率, 再从第四频率递减至第三频 率,并重复所述递增和递减过程,所述递增的跳频频率与递减的跳频频率不同, 所述第三频率小于所述第一频率, 所述第四频率大于所述第二频率。
10.如权利要求 9所述的按键检测方法, 其特征在于, 所述跳频频率的递增值 或递减值为 2个频率单位。
11.如权利要求 9所述的按键检测方法, 其特征在于, 所述第三频率至第四频 率的频率范围包括连续的第一频率范围、第二频率范围和第三频率范围, 所述 第二频率范围包括所述第一频率至第二频率的频率范围,所述跳频频率在所述 第一频率范围、第三频率范围内的每个频率的驻留时间小于所述跳频频率在所 述第二频率范围内的每个频率的驻留时间。
12.如权利要求 9所述的按键检测方法,其特征在于,所述第三频率为 20KHz, 所述第四频率为 500KHz。
13.如权利要求 12所述的按键检测方法, 其特征在于, 所述第三频率至第四频 率的频率范围包括连续的第一频率范围、第二频率范围和第三频率范围, 所述 第一频率范围为 20KHz~80KHz, 所述第二频率范围为 80KHz~300KHz, 所述 第三频率范围为 300~500KHz; 所述跳频频率在所述第一频率范围、第三频率范围内的每个频率的驻留时 间为 0.1ms, 所述跳频频率在所述第二频率范围内的每个频率的驻留时间为 0.2ms。
14.如权利要求 12所述的按键检测方法, 其特征在于,
所述跳频频率从第三频率递增至第四频率包括:所述跳频频率从 20KHz增 至 21KHz, 然后以每次 2KHz递增至 499KHz, 接着从 499KHz增至 500KHz; 所述跳频频率从第四频率递减至第三频率包括:所述跳频频率以每次 2KHz 从 500KHz递减至 20KHz。
15.—种按键检测装置, 其特征在于, 包括:
按键检测单元, 用于检测按键, 获取按键信号;
有效信号检测单元, 用于变频采样所述按键信号, 并在预定时间范围内采 样到按键有效信号的次数达到或超过预定次数时, 输出控制信号, 其中,
所述变频采样是指采样频率从第一频率递增至第二频率,再从第二频率递 减至第一频率, 并重复所述递增和递减过程,且所述采样频率在每个频率驻留 预定时间。
16.如权利要求 15所述的按键检测装置, 其特征在于, 所述采样频率的递增值 或递减值为 1个频率单位。
17.如权利要求 15所述的按键检测装置, 其特征在于, 所述按键为电容式触摸 按键。
18.如权利要求 15所述的按键检测装置, 其特征在于, 所述按键为接触式按键 或空气式按键。
19.如权利要求 17所述的按键检测装置,其特征在于,所述按键检测单元包括: 电容检测单元, 用于检测电容的电荷变化量, 获取按键信号, 所述按键信号为 对应所述电容的电荷变化量的数字信号。
20.如权利要求 19所述的按键检测装置, 其特征在于, 所述按键信号为按键有 效信号是指所述按键信号所表示的数值大于变化量阈值。
21.如权利要求 15 所述的按键检测装置, 其特征在于, 所述预定时间范围为 3ms, 所述预定次数为 80, 所述第一频率为 80KHz, 所述第二频率为 120KHz, 所述预定时间为 5 s; 所述采样频率的递增值或递减值为 1ΚΗζ。
22.如权利要求 15或 17所述的按键检测装置, 其特征在于, 还包括:
接收单元, 用于接收外界信号;
外界信号检测单元,用于当所述外界信号的频率在所述第一频率至第二频 率的频率范围内时产生用于触发所述按键检测的触发信号,
所述按键检测单元在接收到所述触发信号后检测按键, 获取按键信号。
23.如权利要求 22所述的按键检测装置, 其特征在于, 所述接收单元包括: 天线, 用于接收外界的环境信号; 跳频接收单元, 用于跳频接收外界信号, 所述跳频接收是指仅将频率与跳 频频率相同的外界的环境信号作为外界信号接收, 其中, 所述跳频频率从第三频率递增至第四频率, 再从第四频率递减至第三频 率,并重复所述递增和递减过程,所述递增的跳频频率与递减的跳频频率不同, 所述第三频率小于所述第一频率, 所述第四频率大于所述第二频率。
24.如权利要求 23所述的按键检测装置, 其特征在于, 所述跳频频率的递增值 或递减值为 2个频率单位。
25.如权利要求 23所述的按键检测装置, 其特征在于, 所述第三频率至第四频 率的频率范围包括连续的第一频率范围、第二频率范围和第三频率范围, 所述 第二频率范围包括所述第一频率至第二频率的频率范围,所述跳频频率在所述 第一频率范围、第三频率范围内的每个频率的驻留时间小于所述跳频频率在所 述第二频率范围内的每个频率的驻留时间。
26.如权利要求 23所述的按键检测装置,其特征在于,所述第三频率为 20KHz, 所述第四频率为 500KHz。
27.如权利要求 26所述的按键检测装置, 其特征在于, 所述第三频率至第四频 率的频率范围包括连续的第一频率范围、第二频率范围和第三频率范围, 所述 第一频率范围为 20KHz~80KHz, 所述第二频率范围为 80KHz~300KHz, 所述 第三频率范围为 300~500KHz; 所述跳频频率在所述第一频率范围、第三频率范围内的每个频率的驻留时 间为 0.1ms, 所述跳频频率在所述第二频率范围内的每个频率的驻留时间为 0.2ms。
28.如权利要求 23所述的按键检测装置, 其特征在于,
所述跳频频率从第三频率递增至第四频率是指: 所述跳频频率从 20KHz 增至 21KHz,然后以每次 2KHz递增至 499KHz,接着从 499KHz增至 500KHz; 所述跳频频率从第四频率递减至第三频率是指:所述跳频频率以每次 2KHz从 500KHz递减至 20KHz。
PCT/CN2010/079309 2010-09-30 2010-12-01 按键检测方法及装置 WO2012040973A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP10857736.2A EP2680018B1 (en) 2010-09-30 2010-12-01 Method and apparatus for detecting key

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010515086A CN101968530B (zh) 2010-09-30 2010-09-30 按键检测方法及装置
CN201010515086.3 2010-09-30

Publications (1)

Publication Number Publication Date
WO2012040973A1 true WO2012040973A1 (zh) 2012-04-05

Family

ID=43547714

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/079309 WO2012040973A1 (zh) 2010-09-30 2010-12-01 按键检测方法及装置

Country Status (3)

Country Link
EP (1) EP2680018B1 (zh)
CN (1) CN101968530B (zh)
WO (1) WO2012040973A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103852719A (zh) * 2012-11-29 2014-06-11 海洋王(东莞)照明科技有限公司 按键开关通断计数电路
CN104215898A (zh) * 2013-05-30 2014-12-17 深圳市海洋王照明工程有限公司 一种船型开关寿命测试装置
CN109983701A (zh) * 2016-11-29 2019-07-05 法国大陆汽车公司 检测在机动车辆门把手附近的用户的手的靠近和/或接触的方法、相关联的电容性传感器和检测模块

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051320A (zh) * 2011-10-14 2013-04-17 十速兴业科技(深圳)有限公司 一种触控按键的电路布局及其探测方法
CN102508552B (zh) * 2011-10-31 2014-07-30 深圳市大富科技股份有限公司 一种消除按键抖动的方法、装置及键盘
CN102520345A (zh) * 2011-12-06 2012-06-27 惠州Tcl移动通信有限公司 一种记录按键使用次数的方法及装置
CN103389802B (zh) * 2013-07-29 2017-11-10 Tcl集团股份有限公司 基于电容式触摸按键的多芯片兼容方法、装置及电器设备
CN104202464A (zh) * 2014-08-28 2014-12-10 东南大学 基于电容感应的手机解锁系统
CN105227188B (zh) * 2015-09-29 2018-07-31 深圳市新国都支付技术有限公司 一种多按键检测电路
CN107294522B (zh) * 2017-07-05 2020-09-01 Oppo广东移动通信有限公司 基于触摸按键的响应方法、装置、存储介质及电子设备
CN109412572A (zh) * 2017-08-17 2019-03-01 深圳指芯智能科技有限公司 低功耗触摸感应唤醒系统及方法
CN107682101B (zh) * 2017-09-25 2021-09-21 北京小米移动软件有限公司 噪声检测方法、装置及电子设备
CN109274363B (zh) * 2018-11-13 2023-12-08 珠海巨晟科技股份有限公司 一种电容式触摸按键的判键系统
CN109428578B (zh) * 2018-11-30 2023-08-08 珠海巨晟科技股份有限公司 一种电容式触摸按键抗干扰检测装置及检测方法
EP4042568A1 (de) * 2019-10-08 2022-08-17 Diehl AKO Stiftung & Co. KG Verfahren zum einstellen einer abtastfrequenz eines kapazitiven berührungsschalters
CN110806523A (zh) * 2019-11-18 2020-02-18 珠海格力智能装备有限公司 按键性能的检测方法及装置
CN112162478B (zh) * 2020-10-06 2023-06-02 嘉兴美茵钛传动科技有限公司 一种智能切换控制权的控制方法及控制系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05175820A (ja) * 1991-12-24 1993-07-13 Matsushita Electric Works Ltd ノンタッチスイッチ装置
CN101079637A (zh) * 2007-05-24 2007-11-28 四川长虹电器股份有限公司 按键系统及其检测方法
CN101193195A (zh) * 2006-11-21 2008-06-04 青岛海信电器股份有限公司 按键检测处理方法
US20100096193A1 (en) * 2008-10-22 2010-04-22 Esat Yilmaz Capacitive touch sensors

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5565658A (en) * 1992-07-13 1996-10-15 Cirque Corporation Capacitance-based proximity with interference rejection apparatus and methods
SE508136C2 (sv) * 1996-12-19 1998-08-31 Ericsson Telefon Ab L M Anordning och förfarande för tangentbordsavläsning
US20060227115A1 (en) * 2005-03-31 2006-10-12 Tyco Electronic Corporation Method and apparatus for touch sensor with interference rejection
US7847614B2 (en) * 2007-05-30 2010-12-07 Kyocera Corporation Switch noise reduction device and method using counter
CN101667823B (zh) * 2009-09-09 2013-02-13 江苏惠通集团有限责任公司 感应背光按键电路
CN101799734B (zh) * 2010-03-29 2012-05-09 深圳龙多电子科技有限公司 电容式触摸屏按键检测方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05175820A (ja) * 1991-12-24 1993-07-13 Matsushita Electric Works Ltd ノンタッチスイッチ装置
CN101193195A (zh) * 2006-11-21 2008-06-04 青岛海信电器股份有限公司 按键检测处理方法
CN101079637A (zh) * 2007-05-24 2007-11-28 四川长虹电器股份有限公司 按键系统及其检测方法
US20100096193A1 (en) * 2008-10-22 2010-04-22 Esat Yilmaz Capacitive touch sensors

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103852719A (zh) * 2012-11-29 2014-06-11 海洋王(东莞)照明科技有限公司 按键开关通断计数电路
CN104215898A (zh) * 2013-05-30 2014-12-17 深圳市海洋王照明工程有限公司 一种船型开关寿命测试装置
CN109983701A (zh) * 2016-11-29 2019-07-05 法国大陆汽车公司 检测在机动车辆门把手附近的用户的手的靠近和/或接触的方法、相关联的电容性传感器和检测模块

Also Published As

Publication number Publication date
CN101968530B (zh) 2012-10-17
EP2680018A4 (en) 2017-01-25
CN101968530A (zh) 2011-02-09
EP2680018A1 (en) 2014-01-01
EP2680018B1 (en) 2019-10-23

Similar Documents

Publication Publication Date Title
WO2012040973A1 (zh) 按键检测方法及装置
WO2012040947A1 (zh) 抗干扰按键检测系统及方法
JP5460815B2 (ja) センサ
US10394349B2 (en) System and method for improved synchronization between devices
WO2015109562A1 (zh) 一种触摸屏的干扰抑制方法、装置及终端设备
JP6093350B2 (ja) 容量性接触センサのための評価方法および評価デバイス
KR20150131083A (ko) 센서 신호의 에너지 효율적 측정 시스템 및 방법
WO2016138966A1 (en) Method of controlling a mobile device
CN107122703B (zh) 生物信息传感装置、电子设备和共模干扰检测方法
CN101995550B (zh) 按键检测的触发方法及装置、按键检测方法
CN102053224B (zh) 按键检测方法及装置
CN110463041B (zh) 用于电容检测的电路、触摸检测装置和终端设备
KR20150010738A (ko) 센서 신호들의 에너지 효율 측정을 위한 방법 및 시스템
WO2017156768A1 (zh) 移动终端及其智能闹钟的实现方法、装置
CN111103999B (zh) 触控检测装置
US11733809B2 (en) Touch detection device
TWM448854U (zh) 自學習校正觸摸按鍵電路
CN210954971U (zh) 可穿戴设备
WO2013097382A1 (zh) 一种终端设备及调节音量的方法
EP3221775B1 (en) Active stylus with asymmetric switching states
CN101576671A (zh) 触摸键液晶显示器
JP2021009469A (ja) タッチセンサ、制御装置、およびコンピュータプログラム
CN111103998A (zh) 触控检测装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10857736

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2010857736

Country of ref document: EP

122 Ep: pct application non-entry in european phase

Ref document number: 10857736

Country of ref document: EP

Kind code of ref document: A1