CN113541668A - Touch sensing method, circuit and electronic equipment - Google Patents

Touch sensing method, circuit and electronic equipment Download PDF

Info

Publication number
CN113541668A
CN113541668A CN202010324113.2A CN202010324113A CN113541668A CN 113541668 A CN113541668 A CN 113541668A CN 202010324113 A CN202010324113 A CN 202010324113A CN 113541668 A CN113541668 A CN 113541668A
Authority
CN
China
Prior art keywords
voltage
touch
configuration
diode
pin
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.)
Pending
Application number
CN202010324113.2A
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.)
Shenzhen Appotronics Corp Ltd
Original Assignee
Appotronics Corp 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 Appotronics Corp Ltd filed Critical Appotronics Corp Ltd
Priority to CN202010324113.2A priority Critical patent/CN113541668A/en
Priority to PCT/CN2021/086413 priority patent/WO2021213194A1/en
Publication of CN113541668A publication Critical patent/CN113541668A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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

Abstract

The embodiment of the application provides a touch sensing method, a touch sensing circuit and electronic equipment, wherein the method is applied to a control unit, the control unit is connected with a touch key through a pin, and the method firstly switches the pin between a first configuration and a second configuration through time division multiplexing; under the first configuration, the parasitic capacitor of the touch key is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and then judging the induction state of the touch key according to the current voltage. The touch sensing method provided by the application needs to rely on lower hardware cost.

Description

Touch sensing method, circuit and electronic equipment
Technical Field
The present application relates to the field of touch sensing, and in particular, to a touch sensing method, a touch sensing circuit, and an electronic device.
Background
The touch key is widely applied to household intelligent appliances due to the advantages of small volume, good dustproof effect, attractive appearance and the like. Common touch keys include piezoelectric film keys, resistive touch keys, and capacitive touch keys. The capacitive touch key is usually a conductive electrode with a certain specific shape, when a finger contacts or approaches the electrode, the capacitance of the electrode changes due to the distributed capacitance of a human body, and the chip judges whether the key is pressed or not by detecting the change of the capacitance.
However, the conventional capacitive touch key detection requires a dedicated capacitance detection IC (Integrated Circuit) chip, and the principle of the capacitance detection IC chip is complex and the cost is high. Accordingly, there is a pressing need for improvement of the capacitive touch key by those skilled in the art.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide a touch sensing method, a touch sensing circuit and an electronic device to solve the above technical problems.
The embodiment of the application is realized by adopting the following technical scheme:
in a first aspect, an embodiment of the present application provides a touch sensing method, which is applied to a control unit, where the control unit is connected to a touch key through a pin, and the method includes: switching the pins between a first configuration and a second configuration by time division multiplexing; under the first configuration, a parasitic capacitor formed by the touch key and the grounding network is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, discharging the parasitic capacitor through the pin, and measuring the current voltage of the parasitic capacitor when the preset time is reached; and
and judging the induction state of the touch key according to the current voltage.
In some embodiments, determining the sensing state of the touch key according to the current voltage includes calculating a difference between the current voltage and a reference voltage, where the reference voltage is a reference measurement of the current voltage in the second configuration when the touch key is in an untouched state; and comparing the difference value with a preset threshold value, and judging the induction state of the touch key according to the comparison result.
In some embodiments, calculating the difference between the current voltage and the reference voltage further comprises filtering the current voltage; and calibrating the filtered present voltage.
In some embodiments, filtering the present voltage includes filtering the present voltage by any one or more of an averaging method, a median method, a recursive averaging method, a recursive median method, and a kalman filtering method.
In some embodiments, calibrating the filtered current voltage comprises filtering the reference voltage by any one or more of an averaging method, a median method, a recursive averaging method, a recursive median method, and a kalman filtering method; carrying out multiple measurement tests on the filtered reference voltage, and obtaining the average value and standard deviation of the multiple measurement tests; and normalizing the current voltage by the average value and the standard deviation of the reference voltage.
In some embodiments, after performing multiple measurement tests on the filtered reference voltage and obtaining an average value and a standard deviation of the multiple measurement tests, performing multiple touch tests on the touch key, and normalizing the voltage measurement value of each touch test by the average value and the standard deviation of the reference voltage; calculating the average value and the standard deviation of the plurality of normalized voltage measurement values; and determining a preset threshold value according to the average value and the standard deviation of the voltage measurement values.
In a second aspect, an embodiment of the present application further provides a touch sensing circuit, where the touch sensing circuit includes a touch key, and a ground network is disposed around the touch key, so that a parasitic capacitance is generated between the touch key and the ground network; the charging and discharging circuit is connected with the touch key; and a control circuit comprising a pin, the pin being connected to the charging and discharging circuit, the control circuit being configured to: switching the pins between a first configuration and a second configuration by time division multiplexing; under the first configuration, the charging and discharging circuit charges the parasitic capacitor of the touch key to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the charging and discharging circuit discharges the parasitic capacitor through the pins, and the current voltage of the parasitic capacitor is measured when the preset time is up; and judging the induction state of the touch key according to the current voltage.
In some embodiments, the ground network includes a bottom ground line and a top ground line, the top ground line being disposed around the touch key.
In some embodiments, the charging and discharging circuit includes a first diode, a second diode, a third diode, a fourth diode, a first resistor, a second resistor, and a first capacitor, wherein an anode of the first diode is connected to a cathode of the second diode, a cathode of the first diode is connected to one end of the first resistor, an anode of the second diode is connected to one end of the second resistor, and the other end of the first resistor is connected to the other end of the second resistor; the anode of the third diode is connected with the cathode of the fourth diode, the cathode of the third diode is connected between the second diode and the second resistor, and the anode of the fourth diode is connected between the first diode and the first resistor; the first capacitor is connected in parallel at two ends of the first resistor; the connection node of the first diode and the second diode is connected to the touch key, the connection node of the third diode and the fourth diode is connected to the control circuit, and the connection node of the first resistor and the second resistor is grounded.
In a third aspect, an embodiment of the present application further provides an electronic device, which includes a device main body and the touch sensing circuit as described above, provided in the device main body.
According to the touch sensing method, the touch sensing circuit and the electronic equipment, the touch sensing method is applied to the control unit, the control unit is connected with the touch keys through the pins, and the method firstly switches the pins between a first configuration and a second configuration through time division multiplexing; under the first configuration, the parasitic capacitor of the touch key is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and then judging the induction state of the touch key according to the current voltage. In the above process, the implementation of the method does not need to rely on a dedicated capacitance detection IC chip, but utilizes a time division multiplexing function in the control unit, so that compared with a conventional touch detection scheme that requires a dedicated capacitance detection IC chip, the touch sensing method provided by the present application requires lower hardware cost.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a flowchart of a touch sensing method provided in an embodiment of the present application.
FIG. 2 is a flow chart illustrating step S110 in FIG. 1
Fig. 3 is a flowchart illustrating another touch sensing method provided in the embodiment of the present application.
Fig. 4 shows a schematic flowchart of step S220 in fig. 3.
Fig. 5 shows a schematic view of a sliding window.
Fig. 6 shows a schematic flowchart of step S230 in fig. 3.
Fig. 7 shows a schematic flowchart of steps S260 to S280 provided in the embodiment of the present application.
Fig. 8 shows a schematic structural diagram of a touch sensing circuit provided in an embodiment of the present application.
FIG. 9 is a schematic diagram illustrating a ground network of a touch sensing circuit provided by an embodiment of the present application.
Fig. 10 is a schematic diagram of one of the circuit structures of the charge and discharge circuit in fig. 8.
Fig. 11 shows a schematic structural diagram of another touch sensing circuit provided in the embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
The keys on the market at present are classified into traditional mechanical keys and touch keys. Mechanical keys are gradually abandoned due to the defects of easy abrasion, complex installation, environmental influence and the like, and touch keys are gradually and widely applied to household intelligent appliances due to the advantages of small volume, good dustproof effect, attractive appearance and the like.
Common touch keys are classified into piezoelectric film type touch keys, resistive type touch keys, and capacitive type touch keys. The capacitive touch key is usually a conductive electrode with a certain specific shape, when a finger touches or approaches the electrode, the capacitance of the electrode changes due to the distributed capacitance of a human body, and the chip judges whether the key is pressed or not by detecting the change of the capacitance.
However, the conventional capacitive touch key detection requires a dedicated capacitance detection IC (Integrated Circuit) chip, and the principle of the capacitance detection IC chip is complex and the cost is high. Accordingly, there is a pressing need for improvement of the capacitive touch key by those skilled in the art.
In order to solve the above technical problem, the inventors have long studied and proposed a touch sensing method, a circuit, and an electronic device in the embodiments of the present application. The touch sensing method is applied to a control unit, the control unit is connected with a touch key through a pin, and the method firstly switches the pin between a first configuration and a second configuration through time division multiplexing; under the first configuration, a parasitic capacitor formed by the touch key and the grounding network is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and finally, judging the induction state of the touch key according to the current voltage. In the above process, the implementation of the method does not need to rely on a dedicated capacitance detection IC chip, but utilizes a time division multiplexing function in the control unit, so that compared with a conventional touch detection scheme that requires a dedicated capacitance detection IC chip, the touch sensing method provided by the present application requires lower hardware cost.
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, fig. 1 is a schematic flowchart illustrating a touch sensing method provided by an embodiment of the present application, where the method may be applied to a control unit, and the control unit is connected to a touch key through a pin. The control unit is a microprocessor with a time division multiplexing function on pins. In this embodiment of the application, the control Unit may be an MCU (micro controller Unit), and the MCU is connected to the touch key through an external pin. The touch sensing method may include the steps of:
s110: the pins are switched between the first configuration and the second configuration by time division multiplexing.
Time division multiplexing is an inherent function of a control unit, and the basic principle is that a multiplexer is controlled by a configuration register to connect an off-chip pin with different on-chip pins at different times, so that the off-chip pin has multiple functions, but only one of the functions can be used at the same time. In this embodiment, the time division multiplexing function of the control unit is utilized to switch the off-chip pin connected to the touch key between the first configuration and the second configuration, so that the off-chip pin has two functions, thereby saving the pin resource of the control unit.
Further, as shown in fig. 2, the step S110 may include the following steps S111 to S112.
Step S111: under the first configuration, a parasitic capacitor formed by the touch key and the grounding network is charged to a preset voltage through the pin, and the pin is converted into the second configuration when the parasitic capacitor is charged to the preset voltage.
In this embodiment, when the pins of the multiplexing control unit are in the first configuration, the off-chip pins connected to the touch keys are connected to GPIO (General-purpose input/output) pins inside the chip. A parasitic capacitor exists between the touch key and the ground, and the parasitic capacitor of the touch key is charged through the GPIO pin until the voltage of the parasitic capacitor is charged to a preset voltage. When the voltage of the parasitic capacitor reaches the preset voltage, the off-chip pin is converted into a second configuration, namely the off-chip pin is connected to another on-chip pin.
Step S112: under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is reached.
In this embodiment, when the pins of the multiplexing control unit are in the second configuration, the off-chip pins connected to the touch keys are connected to the ADC (Analog-to-Digital Converter) pins in the chip. And at the moment, the parasitic capacitor of the touch key is discharged through the ADC pin, timing is started, and when the preset time is up, the current voltage of the parasitic capacitor is measured through the ADC pin in the chip. In the embodiment of the present application, the current voltage represents a voltage to which the parasitic capacitor starts to discharge from a preset voltage and is discharged and dropped after a preset time. In this embodiment, the preset time may be flexibly designed according to specific working conditions and requirements, and a typical value thereof may be set between several tens of microseconds and several hundreds of microseconds.
It will be appreciated that after the current voltage measurement is completed, the pins will be multiplexed to the first configuration for a new round of charging of the parasitic capacitance. Specifically, the pins may be multiplexed into the first configuration after the voltage of the parasitic capacitance discharges to zero; the pins may also be multiplexed into the first configuration when the voltage of the parasitic capacitance is not discharged to zero. In this embodiment, the pins are multiplexed back and forth between the first configuration and the second configuration at a frequency that can be freely set.
S120: and judging the induction state of the touch key according to the current voltage.
Due to the fact that distributed capacitance exists in a human body, when a finger approaches or contacts the touch key, the parasitic capacitance of the touch key changes, the discharging speed of the parasitic capacitance changes, and then within the same preset time, the voltage released by the parasitic capacitance changes correspondingly, so that the voltage dropped after the voltage starts to discharge for a preset time from the preset voltage changes. Therefore, the current voltage of the parasitic capacitor is measured when the preset time is up, so that the change condition of the current voltage can be obtained, and the induction state of the touch key can be judged according to the change condition of the current voltage.
The touch sensing method realizes the detection of the touch capacitor by utilizing the time division multiplexing function of the control unit. The method does not need to rely on a traditional special chip for capacitance detection, has very wide applicability, and can greatly reduce the hardware cost of capacitance detection.
According to the touch sensing method provided by the embodiment of the application, the pins are switched between the first configuration and the second configuration through time division multiplexing; under the first configuration, the parasitic capacitor of the touch key is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and finally, judging the induction state of the touch key according to the current voltage. In the above process, the implementation of the method does not need to rely on a dedicated capacitance detection IC chip, but utilizes a time division multiplexing function in the control unit, so that compared with a conventional touch detection scheme that requires a dedicated capacitance detection IC chip, the touch sensing method provided by the present application requires lower hardware cost.
As shown in fig. 3, the present application further provides another touch sensing method 200, and the touch sensing method 200 may include the following steps S210 to S250.
Step S210: the pins are switched between the first configuration and the second configuration by time division multiplexing.
The principle of step S210 is the same as that of step 110, and is not described herein again. Step S210 may also include the following step S211 and step S212, and the principle of step S211 and step S212 is consistent with the principle of step S111 and step S112 described above.
Step S211: under the first configuration, a parasitic capacitor formed by the touch key and the grounding network is charged to a preset voltage through the pin, and the pin is converted into the second configuration when the parasitic capacitor is charged to the preset voltage.
Step S212: under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is reached.
In this embodiment, after the measurement value of the present voltage is obtained, the following steps may be continuously performed.
Step S220: the current voltage is filtered.
In this embodiment, by filtering the current voltage, system noise can be reduced, and measurement errors can be reduced. The filtering algorithm used in this embodiment may be any one of an average value method, a median method, a recursive median method, and a kalman filtering method. In fact, any filtering algorithm can be used as long as it can improve the signal-to-noise ratio of the system. In the following, the present embodiment explains the filtering of the current voltage by taking a recursive average method of m consecutive numbers as an example. Fig. 4 is a flow chart of the recursive average filtering method, as shown in fig. 4. It includes steps S221 to S222:
step S221: a sliding window is set, and an arithmetic average of a fixed number of measurement data within the sliding window is calculated to output one data.
As shown in fig. 5, fig. 5 is a schematic view of a sliding window. V1 Vn represents the voltage values measured by the ADC pins in sequence, the sliding window can cover m continuous measurement voltage values, and in the embodiment, the typical value of m can be 2-5. Further, an arithmetic mean value of m successive measured voltage values within the sliding window is taken as one output data. Assuming that m is 3, 3 measurement voltage values V1-V3 are continuously measured by the ADC pin, and at this time, an arithmetic mean value X1 of V1-V3 is calculated, and the arithmetic mean value X1 is equivalent to an output result of one measurement.
Step S222: and covering the sliding window with new measurement data in sequence, and calculating the arithmetic mean value of the measurement data in the sliding window in sequence so as to output a plurality of data in sequence.
As shown in fig. 5, X1 to Xn represent data that are sequentially output, where each output data is an arithmetic average of m consecutive measured voltage values during the sliding of the sliding window. Specifically, as new measurement voltage values are generated, the sliding window is sequentially slid forward to sequentially overlay new measurement data, and since the amount of data held by the sliding window is fixed, the new measurement data is added to the window while the old measurement data exits the window. For example, the sliding window covers the measurement voltage values V1-V3, and then data X1 is output; with the generation of a new measurement voltage value V4, the sliding window slides forwards, so that the measurement voltage value V4 is added into the window and the measurement voltage value V1 exits from the window, and at the moment, the sliding window covers the measurement voltage values V2-V4 and outputs data X2; as new measured voltage values are continuously generated, the sliding window sequentially slides and covers the new measured voltage values, and sequentially outputs data X1 to Xn. The filtering algorithm is used for filtering the measured value of the current voltage, so that the stability of the system and the measurement precision of the current voltage can be improved.
Step S230: the filtered present voltage is calibrated.
In this embodiment, the measurement accuracy can be further improved by calibrating the filtered current voltage. As shown in fig. 6, fig. 6 is a schematic flowchart of the calibration, which includes steps S231 to S233.
Step S231: the reference voltage is filtered.
The reference voltage is a reference measurement of a current voltage in the second configuration when the touch key is in an untouched state. When the touch key is in a non-touch state, measuring the voltage of the parasitic capacitor discharged for a preset time period in the second configuration of the touch key by the method in the steps S211 to S212, where the voltage is the reference voltage, and the reference voltage also represents the reference value of the current voltage in the non-touch state of the touch key. In the actual measurement phase, the reference voltage can be used as a reference to judge the touch state of the touch key.
In this embodiment, the filtering algorithm of this embodiment, that is, any one of an average value method, a median method, a recursive median method, and a kalman filtering method, may also be used to filter the reference voltage. And any filtering algorithm may be used as long as it can improve the system signal-to-noise ratio. In some embodiments, the filtering algorithm used for the current voltage in step S220 may be the same as the filtering algorithm used for the reference voltage to ensure the accuracy of the measurement data.
Step S232: and carrying out multiple measurement tests on the filtered reference voltage, and obtaining the average value and standard deviation of the multiple measurement tests.
In this embodiment, a plurality of measurement tests are performed on the reference voltage, N1 pieces of reference measurement data are obtained after the filtering, and the average value μ and the standard deviation σ of the N1 pieces of reference measurement data are calculated. The value of N1 can be flexibly selected according to the use scene and the measurement speed, and the typical value can be between 10 and 10000.
Step S233: and normalizing the current voltage by the average value and the standard deviation of the reference voltage.
In this embodiment, the average value μ and the standard deviation μ of the N1 pieces of reference measurement data may be used to normalize actual measurement data during subsequent actual measurement:
Figure BDA0002462534570000111
wherein, X is the measurement data of the current voltage during actual measurement.
Step S240: and calculating the difference value of the current voltage and the reference voltage.
As described above, the reference voltage represents a reference value of the current voltage in the untouched state of the touch key. The touch detection of the touch key is divided into two stages, namely a reference measurement stage, wherein a reference value is obtained in the reference measurement stage; and in the actual measurement stage, an actual value is obtained in the actual measurement stage, and whether the touch key is currently touched or not can be judged according to the variation between the actual value and the reference value.
In this embodiment, the current voltage is also an actual measurement value, and the difference between the current voltage and the reference voltage is also a variation between the actual value and the reference value, and whether the touch key is currently touched is determined according to the variation. Specifically, since a distributed capacitance exists in a human body, when a touch key is touched, the distributed capacitance of the human body is equivalent to being connected in parallel with a parasitic capacitance of the touch key, so that a measured value of the parasitic capacitance is increased. It should be noted that the distributed capacitance of the human body is usually 30pF to 50pF, and the parasitic capacitance of the touch key should be designed to be equivalent to the distributed capacitance. Because the charging and discharging speed of the capacitor is influenced by the size of the capacitor, when the measured value of the parasitic capacitor is increased, the discharging speed of the parasitic capacitor is reduced, the preset time is fixed and unchanged, then the voltage of the parasitic capacitor is higher than the voltage of the reference untouched state when the preset time is reached, and the measured voltage value is larger. Therefore, whether the touch key is touched or not can be judged according to the difference value of the current voltage and the reference voltage.
It is worth mentioning that the sizes of distributed capacitors connected in parallel at two ends of the parasitic capacitor in different human bodies or working conditions are different, so that the charging and discharging speeds of the parasitic capacitor under different working conditions are inconsistent, and adverse effects can be brought to system software control under general conditions. However, in this embodiment, since the parasitic capacitor is charged to a predetermined voltage in the charging stage and the voltage value after the predetermined discharging time is measured in the discharging stage, even though the charging and discharging speeds of the parasitic capacitor may be inconsistent under each operating condition, the measurement result is not affected, and the system software control required by the present application is not affected.
Step S250: and comparing the difference value with a preset threshold value, and judging the induction state of the touch key according to the comparison result.
In this embodiment, the difference is compared with the preset threshold, and if the difference is greater than the preset threshold, it indicates that the variation between the current actual measurement value and the reference measurement value exceeds the touch activation window, and the touch key is effectively touched. And the variation within the preset threshold is an error allowable range, and the error within the range may be caused by factors such as measurement, environment and the like.
As shown in fig. 7, in some embodiments, after step S233, the following steps S260 to S280 may be further included.
Step S260: and performing multiple touch tests on the touch key, and normalizing the voltage measurement of each touch test through the average value and the standard deviation of the reference voltage.
In this embodiment, after obtaining the average value μ and the standard deviation μ of the reference measurement data, the touch test may be continuously performed on the touch key, after the multiple touch tests, N2 pieces of test touch data may be obtained by measuring the voltage of the parasitic capacitance, and each piece of test touch data is normalized:
Figure BDA0002462534570000121
x1 is test touch data. The value of N2 can be flexibly selected according to the use scene and the measurement speed, and the typical value can be between 10 and 10000.
Step S270: and calculating the average value and the standard deviation of the plurality of normalized voltage measurement values.
In the present embodiment, the average value μ 'and the standard deviation σ' of the N2 pieces of test touch data after the normalization processing are calculated for a plurality of measurement values, that is, the above-described test touch data.
Step S280: and determining a preset threshold according to the average value and the standard deviation of the voltage measured values.
In this embodiment, the average value μ ' and the standard deviation σ ' of the N2 pieces of test touch data obtained by the touch test may reflect the stability of the actual measurement data in the actual measurement phase, and the smaller the standard deviation σ ', the higher the stability of the actual measurement data is, and the higher the stability of the measurement data is, the larger the value of the preset threshold may be set.
Further, the preset threshold may affect the sensitivity of the touch key and the probability of a false touch. The smaller the preset threshold value is, the higher the touch sensitivity is, and the greater the probability of false touch is; and the larger the preset threshold value is, the higher the stability of the touch is. Typical values of the preset threshold are between 2 and mu '-2 sigma', and the value range of the preset threshold can also be used for evaluating the stability of the equipment, namely, the larger the value of mu '-2 sigma' -2 is, the better the stability of the equipment is.
In the touch sensing method provided by the embodiment, the pins are switched between the first configuration and the second configuration through time division multiplexing; under the first configuration, a parasitic capacitor formed by the touch key and the grounding network is charged to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the parasitic capacitor is discharged through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and finally, judging the induction state of the touch key according to the current voltage. In the above process, the implementation of the method does not need to rely on a dedicated capacitance detection IC chip, but utilizes a time division multiplexing function in the control unit, so that compared with a conventional touch detection scheme that requires a dedicated capacitance detection IC chip, the touch sensing method provided by the present application requires lower hardware cost. And the measured voltage is filtered and calibrated, so that the accuracy of the measured data is higher.
As shown in fig. 8, the present application further provides a touch sensing circuit 300, where the touch sensing circuit 300 includes a touch button 310, a charging/discharging circuit 320, and a control circuit 330. A grounding network is arranged around the touch key 310, so that a parasitic capacitance is generated between the touch key and the grounding network. The control circuit 330 is connected to the touch button 310 through the charge/discharge circuit 320. The control circuit 330 includes a pin TK, the control circuit 330 is connected to the charge and discharge circuit 320 through the off-chip pin TK, and the control circuit 330 is configured to switch the pin TK between the first configuration and the second configuration through time division multiplexing; in the first configuration, the charging and discharging circuit 320 charges the parasitic capacitor C0 of the touch key 310 to a preset voltage through the pin TK, and when the parasitic capacitor C0 is charged to the preset voltage, the pin TK is converted into the second configuration; under the second configuration, the charging and discharging circuit 320 discharges the parasitic capacitor C0 through the pin TK, and measures the current voltage of the parasitic capacitor C0 when the preset time is reached; and determining the sensing state of the touch button 310 according to the current voltage.
The touch key 310 may be a conductive electrode of any shape, and a parasitic capacitance C0 exists between the conductive electrode and ground. The control circuit 130 is a Micro Controller Unit (MCU). The time division multiplexing is the original function of the MCU, and the basic principle is that a configuration register controls a multi-way switch so as to connect an off-chip pin with different on-chip pins at different moments, so that the off-chip pin has multiple functions, but only one of the functions can be used at the same moment. In this embodiment, the time division multiplexing function of the MCU is utilized to switch the TK connected to the touch button 310 between the first configuration and the second configuration, where the TK is an off-chip pin, so that the off-chip pin has two functions, thereby saving pin resources of the MCU.
When multiplexing to the first configuration, the control circuit 330 connects the pin TK to a GPIO (General-purpose input/output) pin within the chip. The parasitic capacitor C0 exists between the touch key 310 pair and the ground, and at this time, the GPIO pin charges the parasitic capacitor C0 of the touch key 310 through the charging and discharging circuit until the voltage of the parasitic capacitor C0 is charged to a preset voltage. When the voltage of the parasitic capacitor C0 reaches the predetermined voltage, the TK pin is switched to the second configuration, i.e. the TK pin is connected to another on-chip pin.
When multiplexed to the second configuration, the control circuit connects pin TK to an ADC (Analog-to-Digital Converter) pin within the chip. At this time, the ADC pin discharges the parasitic capacitor C0 of the touch button 310 through the charging and discharging circuit 320, and at the same time, the timing is started, and when the preset time is reached, the current voltage of the parasitic capacitor C0 is measured through the ADC pin in the chip. Due to the distributed capacitance of the human body, when a finger approaches or touches the touch key 310, the parasitic capacitance C0 of the touch key 310 changes, and further the discharging speed of the parasitic capacitance C0 changes, so that within the same preset time, the voltage discharged by the parasitic capacitance C0 changes correspondingly, and the voltage dropped after the preset voltage is discharged for a preset time changes. Therefore, the current voltage of the parasitic capacitor C0 can be measured when the preset time is reached, so as to obtain the change condition of the current voltage, and then the sensing state of the touch key 310 can be determined according to the change condition of the current voltage.
Specifically, a ground network may be disposed around the touch key 310, so that a parasitic capacitance C0 may be generated between the touch key 310 and the ground network. The TK pin of the control circuit 330 is connected to the charging and discharging circuit 320, so as to charge and discharge the parasitic capacitor C0 through the charging and discharging circuit 320.
It should be noted that in this embodiment, since the grounding network is disposed around the touch key 310, the parasitic capacitance C0 is generated between the touch key 310 and the grounding network, so that even if the charging and discharging speeds of the parasitic capacitance under each working condition are possibly inconsistent, the touch sensing circuit 300 does not affect the overall measurement result, and further, the influence on the system software control required by the present application is avoided.
As shown in fig. 9, the ground network of the touch sensing circuit 300 includes a bottom layer ground line 311 and a top layer ground line 312, wherein the bottom layer ground line 311 is laid on the back of the touch key, and the top layer ground line 312 is disposed around the touch key. With such an arrangement, a sufficient parasitic capacitance can be generated between the touch key and the ground line to meet the requirement of the touch sensing circuit 300, and the bottom ground line 311 and the top ground line 312 can shield an EMI (Electromagnetic Interference) to enhance the stability of the system.
As shown in fig. 10, fig. 10 shows one of the structural schematic diagrams of the charge and discharge circuit 120. The charge and discharge circuit 320 comprises a first diode D1, a second diode D2, a third diode D3, a fourth diode D4, a first resistor R1, a second resistor R2 and a first capacitor C1, wherein the anode of the first diode D1 is connected to the cathode of the second diode D2, the cathode of the first diode D1 is connected to one end of the first resistor R1, the anode of the second diode D2 is connected to one end of the second resistor R2, and the other end of the first resistor R1 is connected to the other end of the second resistor R2; the anode of the third diode D3 is connected to the cathode of the fourth diode D4, the cathode of the third diode D3 is connected between the second diode D2 and the second resistor R2, and the anode of the fourth diode D4 is connected between the first diode D1 and the first resistor R1; the first capacitor C1 is connected in parallel across the first resistor R1; the connection node of the first diode D1 and the second diode D2 is connected to the touch button 310, the connection node of the third diode D3 and the fourth diode D4 is connected to the control circuit 330, and the connection node of the first resistor R1 and the second resistor R2 is grounded. The touch sensing circuit provided by the embodiment of the application is provided with a touch key; the charging and discharging circuit is connected with the touch key; and a control circuit comprising a pin, the pin being connected to the charging and discharging circuit, the control circuit being configured to: switching the pins between a first configuration and a second configuration by time division multiplexing; under the first configuration, the charging and discharging circuit charges the parasitic capacitor of the touch key to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the charging and discharging circuit discharges the parasitic capacitor through the pins, and the current voltage of the parasitic capacitor is measured when the preset time is up; and judging the induction state of the touch key according to the current voltage. The touch sensing circuit provided by the embodiment of the application only utilizes the time division multiplexing function of the control circuit to realize the sensing of the touch state, and the touch sensing circuit is simple in structure, low in cost and capable of being widely used.
As shown in fig. 11, another touch sensing circuit 400 is provided in the embodiment of the present application, where the touch sensing circuit 400 includes a circuit board 410 and the touch sensing circuit 300, and the touch sensing circuit 300 is disposed on the circuit board 410.
The touch sensing circuit provided by the embodiment of the application is provided with a touch key; the charging and discharging circuit is connected with the touch key; and a control circuit comprising a pin, the pin being connected to the charging and discharging circuit, the control circuit being configured to: switching the pins between a first configuration and a second configuration by time division multiplexing; under the first configuration, the charging and discharging circuit charges the parasitic capacitor of the touch key to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the charging and discharging circuit discharges the parasitic capacitor through the pins, and the current voltage of the parasitic capacitor is measured when the preset time is up; and judging the induction state of the touch key according to the current voltage. The touch sensing circuit provided by the embodiment of the application only utilizes the time division multiplexing function of the control circuit to realize the sensing of the touch state, has a simple circuit structure, low cost and wide application range, and can prevent electromagnetic interference.
The embodiment of the application also provides electronic equipment, which comprises an equipment main body and the touch sensing circuit, wherein the touch sensing circuit is arranged in the equipment main body.
In this embodiment, the electronic device may be, but is not limited to, a projector, a micro-projector, a smart television, a smart phone, a tablet computer, an electronic paper book reader, and other smart appliances.
The electronic equipment provided by the embodiment of the application is provided with the touch key; the charging and discharging circuit is connected with the touch key; and a control circuit comprising a pin, the pin being connected to the charging and discharging circuit, the control circuit being configured to: switching the pins between a first configuration and a second configuration by time division multiplexing; under the first configuration, the charging and discharging circuit charges the parasitic capacitor of the touch key to a preset voltage through the pin, and the pin is converted into a second configuration when the parasitic capacitor is charged to the preset voltage; under the second configuration, the charging and discharging circuit discharges the parasitic capacitor through the pins, and the current voltage of the parasitic capacitor is measured when the preset time is up; and judging the induction state of the touch key according to the current voltage. The touch sensing circuit of the electronic device provided by the embodiment of the application only utilizes the time division multiplexing function of the control circuit to realize the sensing of the touch state, has a simple circuit structure, is low in cost and wide in application range, and can prevent electromagnetic interference.
Although the present application has been described with reference to the preferred embodiments, it is to be understood that the present application is not limited to the disclosed embodiments, but rather, the present application is intended to cover various modifications, equivalents and alternatives falling within the spirit and scope of the present application.

Claims (10)

1. A touch sensing method is applied to a control unit, the control unit is connected with a touch key through a pin, and the touch sensing method is characterized by comprising the following steps:
switching the pins between a first configuration and a second configuration by time division multiplexing;
under the first configuration, a parasitic capacitor formed by the touch key and a grounding network is charged to a preset voltage through the pin, and the pin is converted into the second configuration when the parasitic capacitor is charged to the preset voltage;
under the second configuration, discharging the parasitic capacitor through the pin, and measuring the current voltage of the parasitic capacitor when preset time is reached; and
and judging the induction state of the touch key according to the current voltage.
2. The touch sensing method of claim 1, wherein the determining the sensing state of the touch key according to the current voltage comprises:
calculating a difference between the current voltage and a reference voltage, wherein the reference voltage is a reference measurement value of the current voltage under the second configuration when the touch key is in a non-touch state; and
and comparing the difference value with a preset threshold value, and judging the induction state of the touch key according to the comparison result.
3. The touch sensing method of claim 2, wherein the calculating the difference between the current voltage and the reference voltage further comprises:
filtering the current voltage; and
and calibrating the filtered current voltage.
4. The touch sensing method of claim 3, wherein the filtering the present voltage comprises:
and filtering the current voltage by any one or more algorithms of an average value method, a median method, a recursion average value method, a recursion median method and a Kalman filtering method.
5. The touch sensing method of claim 3, wherein the calibrating the filtered present voltage comprises:
filtering the reference voltage by any one or more algorithms of an average value method, a median method, a recursion average value method, a recursion median method and a Kalman filtering method;
carrying out multiple measurement tests on the filtered reference voltage, and obtaining the average value and standard deviation of the multiple measurement tests; and
and normalizing the current voltage by the average value and the standard deviation of the reference voltage.
6. The touch sensing method of claim 5, wherein after performing a plurality of measurement trials on the filtered reference voltage and obtaining a mean and a standard deviation of the plurality of measurement trials, further comprising:
performing multiple touch tests on the touch key, and normalizing the voltage measurement value of each touch test through the average value and the standard deviation of the reference voltage;
calculating the average value and the standard deviation of the plurality of normalized voltage measurement values; and
and determining the preset threshold according to the average value and the standard deviation of the voltage measured values.
7. A touch sensing circuit, comprising:
the touch key is provided with a grounding network around so as to generate parasitic capacitance between the touch key and the grounding network;
the charging and discharging circuit is connected with the touch key; and
a control circuit comprising a pin, the pin connected to the charging and discharging circuit, the control circuit configured to:
switching the pins between a first configuration and a second configuration by time division multiplexing;
under the first configuration, the charging and discharging circuit charges the parasitic capacitor of the touch key to a preset voltage through the pin, and the pin is converted into the second configuration when the parasitic capacitor is charged to the preset voltage;
under the second configuration, the charging and discharging circuit discharges the parasitic capacitor through the pin, and the current voltage of the parasitic capacitor is measured when the preset time is up; and
and judging the induction state of the touch key according to the current voltage.
8. The touch sensing circuit of claim 7, wherein the ground network includes a bottom ground line and a top ground line, the top ground line disposed around the touch key.
9. The touch sensing circuit of claim 7, wherein the charge and discharge circuit comprises a first diode, a second diode, a third diode, a fourth diode, a first resistor, a second resistor, and a first capacitor, wherein an anode of the first diode is connected to a cathode of the second diode, a cathode of the first diode is connected to one end of the first resistor, an anode of the second diode is connected to one end of the second resistor, and the other end of the first resistor is connected to the other end of the second resistor; the anode of the third diode is connected to the cathode of the fourth diode, the cathode of the third diode is connected between the second diode and the second resistor, and the anode of the fourth diode is connected between the first diode and the first resistor; the first capacitor is connected in parallel to two ends of the first resistor; the connection node of the first diode and the second diode is connected to the touch key, the connection node of the third diode and the fourth diode is connected to the control circuit, and the connection node of the first resistor and the second resistor is grounded.
10. An electronic device comprising a device body and the touch sensing circuit according to any one of claims 7 to 9 provided in the device body.
CN202010324113.2A 2020-04-22 2020-04-22 Touch sensing method, circuit and electronic equipment Pending CN113541668A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010324113.2A CN113541668A (en) 2020-04-22 2020-04-22 Touch sensing method, circuit and electronic equipment
PCT/CN2021/086413 WO2021213194A1 (en) 2020-04-22 2021-04-12 Touch sensing method and circuit, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010324113.2A CN113541668A (en) 2020-04-22 2020-04-22 Touch sensing method, circuit and electronic equipment

Publications (1)

Publication Number Publication Date
CN113541668A true CN113541668A (en) 2021-10-22

Family

ID=78094121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010324113.2A Pending CN113541668A (en) 2020-04-22 2020-04-22 Touch sensing method, circuit and electronic equipment

Country Status (2)

Country Link
CN (1) CN113541668A (en)
WO (1) WO2021213194A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114705736A (en) * 2022-03-21 2022-07-05 山东大学 Portable multi-channel detection electrochemical sensing system and application thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221644B (en) * 2022-02-22 2023-08-29 杭州炬源智能科技有限公司 Intelligent water meter with touch keys and detection method of touch keys

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201878122U (en) * 2010-08-04 2011-06-22 鸿富锦精密工业(深圳)有限公司 Touch-control key detection and LED control circuit
US9743357B2 (en) * 2011-12-16 2017-08-22 Joseph Akwo Tabe Energy harvesting computer device in association with a communication device configured with apparatus for boosting signal reception
CN205104959U (en) * 2015-07-03 2016-03-23 广东云控照明科技有限公司 Portable intelligent touch panel and wireless emitter that charges thereof
CN206353778U (en) * 2016-12-19 2017-07-25 上海肯特仪表股份有限公司 The key circuit of electromagnetic flowmeter
CN109245753A (en) * 2018-11-13 2019-01-18 珠海巨晟科技股份有限公司 The sub key system of capacitance type touch key

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114705736A (en) * 2022-03-21 2022-07-05 山东大学 Portable multi-channel detection electrochemical sensing system and application thereof
CN114705736B (en) * 2022-03-21 2023-08-11 山东大学 Portable multi-channel detection electrochemical sensing system and application thereof

Also Published As

Publication number Publication date
WO2021213194A1 (en) 2021-10-28

Similar Documents

Publication Publication Date Title
US11549975B2 (en) Capacitive field sensor with sigma-delta modulator
US9547399B2 (en) Injected touch noise analysis
US10545614B2 (en) Two-electrode touch button with a multi-phase capacitance measurement process
CN110856448B (en) Capacitance detection circuit, touch device and terminal equipment
US8873743B1 (en) Tapered capsense structure
US8599144B2 (en) Grounded button for capacitive sensor
EP3190545A1 (en) Fingerprint recognition system and method
US7541816B1 (en) Capacitive sensor
US20090102813A1 (en) On-screen input image display system
US20030091220A1 (en) Capacitive sensor device
US20080047764A1 (en) Temperature compensation method for capacitive sensors
CN101908875A (en) Key-judging method for capacitive touch keys
CN101908876A (en) Capacitance type touch key system and micro-control unit thereof
CN113541668A (en) Touch sensing method, circuit and electronic equipment
WO2019084832A1 (en) Fingerprint recognition circuit, fingerprint sensor and mobile terminal
US20070124674A1 (en) Motion detection system and motion detection method
CN114355056A (en) Capacitance measuring circuit, capacitance measuring system, touch device and electronic equipment
US8085252B1 (en) Method and apparatus to determine direction of motion in a sensor array of a touch sensing device
CN114356145A (en) Touch detection circuit, touch device and electronic equipment
WO2017197574A1 (en) Capacitance detection device
CN102236481A (en) Approach detection method of capacitance touch plate and application thereof
CN108777574A (en) A kind of capacitance touch button circuit
US11863174B2 (en) Detection chip capable of cancelling baseline voltage
KR102248984B1 (en) High sensitivity touch sensor
US20130043890A1 (en) Sensing Method and Circuit for Use with Capacitive Sensing Devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination