WO2021213194A1 - Touch sensing method and circuit, and electronic device - Google Patents

Touch sensing method and circuit, and electronic device Download PDF

Info

Publication number
WO2021213194A1
WO2021213194A1 PCT/CN2021/086413 CN2021086413W WO2021213194A1 WO 2021213194 A1 WO2021213194 A1 WO 2021213194A1 CN 2021086413 W CN2021086413 W CN 2021086413W WO 2021213194 A1 WO2021213194 A1 WO 2021213194A1
Authority
WO
WIPO (PCT)
Prior art keywords
voltage
touch
configuration
pin
diode
Prior art date
Application number
PCT/CN2021/086413
Other languages
French (fr)
Chinese (zh)
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 深圳光峰科技股份有限公司
Publication of WO2021213194A1 publication Critical patent/WO2021213194A1/en

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

Definitions

  • This application relates to the field of touch sensing, and in particular to a touch sensing method, circuit and electronic equipment.
  • touch keys are widely used in household smart appliances.
  • Common touch buttons include piezoelectric film buttons, resistive touch buttons, and capacitive touch buttons.
  • Capacitive touch buttons are usually conductive electrodes with a certain shape. When a finger touches or approaches the electrodes, the distributed capacitance of the human body causes the capacitance of the electrodes to change. The chip detects the change in capacitance to determine whether the button is pressed.
  • the detection of the traditional capacitive touch button requires the use of a dedicated capacitance detection IC (Integrated Circuit, integrated circuit) chip, and the principle of the capacitance detection IC chip is complicated and the cost is relatively high. Therefore, those skilled in the art urgently need to improve the capacitive touch button.
  • IC Integrated Circuit, integrated circuit
  • embodiments of the present application provide a touch sensing method, circuit, and electronic device to solve the above technical problems.
  • an embodiment of the present application provides a touch sensing method, which is applied to a control unit, and the control unit is connected to a touch button through a pin.
  • the method includes: using time division multiplexing to place the pin between the first configuration and the second configuration Among them, in the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and
  • judging the sensing state of the touch button according to the current voltage includes calculating the difference between the current voltage and a reference voltage, where the reference voltage is a reference measurement value of the current voltage in the second configuration when the touch button is in an untouched state. ; And the difference is compared with the preset threshold, and the sensing state of the touch button is judged according to the comparison result.
  • it before calculating the difference between the current voltage and the reference voltage, it further includes filtering the current voltage; and calibrating the filtered current voltage.
  • filtering the current voltage includes filtering the current voltage by any one or more of the average method, median method, recursive average method, recursive median method, and Kalman filter method. The voltage is filtered.
  • calibrating the filtered current voltage includes using any one or more of the average method, the median method, the recursive average method, the recursive median method, and the Kalman filter method.
  • the algorithm filters the reference voltage; performs multiple measurement experiments on the filtered reference voltage, and obtains the average value and standard deviation of the multiple measurement experiments; and normalizes the current voltage through the average value and standard deviation of the reference voltage.
  • the standard deviation normalizes the voltage measurement value of each touch test; calculates the average value and standard deviation of multiple voltage measurement values after normalization; and determines according to the average value and standard deviation of multiple voltage measurement values Preset threshold.
  • an embodiment of the present application also provides a touch sensing circuit, which includes a touch button, and a grounding network is arranged around the touch button, so that parasitic capacitance is generated between the touch button and the grounding network;
  • the discharge circuit is connected to the touch button; and the control circuit includes pins, the pins are connected to the charge and discharge circuit, and the control circuit is configured to switch the pins between the first configuration and the second configuration through time division multiplexing;
  • the charging and discharging circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, The charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the sensing state of the touch button is judged according to the current voltage.
  • the ground network includes a bottom ground wire and a top ground wire, and the top ground wire is arranged around the touch button.
  • 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.
  • the anode of the tube is connected to the cathode of the second diode, the cathode of the first diode is connected to one end of the first resistor, the 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 The other end of the second resistor is connected; 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, the fourth diode The anode of the tube is connected between the first diode and the first resistor; the first capacitor is connected in parallel to both ends of the first resistor; the connection node of the first diode and the second dio
  • an embodiment of the present application also provides an electronic device, which includes a device main body and the above-mentioned touch sensing circuit provided in the device main body.
  • the touch sensing method, circuit, and electronic equipment provided in the present application are applied to a control unit, and the control unit is connected to a touch button through a pin.
  • the control unit is connected to a touch button through a pin.
  • the parasitic capacitance of the touch button in the first configuration, is charged to the preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration Under the configuration, the parasitic capacitance is discharged by the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and then the sensing state of the touch button is judged according to the current voltage.
  • the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
  • FIG. 1 shows a schematic flowchart of a touch sensing method provided by an embodiment of the present application.
  • FIG. 2 shows a schematic diagram of the flow of step S110 in Figure 1
  • FIG. 3 shows a schematic flowchart of another touch sensing method provided by an embodiment of the present application.
  • FIG. 4 shows a schematic flowchart of step S220 in FIG. 3.
  • Figure 5 shows a schematic diagram 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 an embodiment of the present application.
  • FIG. 8 shows a schematic structural diagram of a touch sensing circuit provided by an embodiment of the present application.
  • FIG. 9 shows a schematic diagram of a ground network of a touch sensing circuit provided by an embodiment of the present application.
  • FIG. 10 shows a schematic diagram of one of the circuit structures of the charging and discharging circuit in FIG. 8.
  • FIG. 11 shows a schematic structural diagram of another touch sensing circuit provided by an embodiment of the present application.
  • buttons currently on the market are divided into traditional mechanical buttons and touch buttons.
  • Mechanical keys are gradually abandoned due to shortcomings such as easy wear, complex installation, and environmental influences, while touch keys are gradually widely used in household smart appliances due to their small size, good dust-proof effect, and beautiful appearance.
  • the capacitive touch button is usually a conductive electrode of a certain shape.
  • the distributed capacitance of the human body causes the capacitance of the electrode to change.
  • the chip detects the change in capacitance to determine whether the button is pressed. .
  • the detection of the traditional capacitive touch button requires the use of a dedicated capacitance detection IC (Integrated Circuit, integrated circuit) chip, and the principle of the capacitance detection IC chip is complicated and the cost is relatively high. Therefore, those skilled in the art urgently need to improve the capacitive touch button.
  • IC Integrated Circuit, integrated circuit
  • the inventors have proposed the touch sensing method, circuit and electronic device in the embodiments of the present application after long-term research.
  • the touch sensing method is applied to the control unit, and the control unit is connected to the touch button through the pin.
  • the method first switches the pin between the first configuration and the second configuration through time-division multiplexing; wherein, in the first configuration, through the lead
  • the pin charges the parasitic capacitance formed by the touch button and the ground network to a preset voltage, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the pin is connected to the parasitic capacitance Discharge, and when the preset time arrives, measure the current voltage of the parasitic capacitance; finally, judge the sensing state of the touch button based on the current voltage.
  • the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
  • FIG. 1 shows a schematic flowchart of a touch sensing method provided by an embodiment of the present application.
  • the method can be applied to a control unit, and the control unit is connected to a touch button through a pin.
  • the control unit is a microprocessor with pins with time division multiplexing function.
  • the control unit may be an MCU (Microcontroller Unit, Microcontroller Unit), and the MCU is connected to the touch button through an external pin.
  • the touch sensing method may include the following steps:
  • S110 Switch the pin between the first configuration and the second configuration through time division multiplexing.
  • Time division multiplexing is an inherent function of the control unit. Its basic principle is to control multiple switches through the configuration register to connect the off-chip pins to different on-chip pins at different times, so that the off-chip pins have multiple functions, but Only one of these functions can be used at the same time.
  • the time division multiplexing function of the control unit is used to switch the off-chip pin connected to the touch button between the first configuration and the second configuration, so that the off-chip pin has two functions, so it can Save pin resources of the control unit.
  • step S110 may include the following steps S111 to S112.
  • Step S111 In the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration.
  • the off-chip pins connected to the touch buttons are connected to the on-chip GPIO (General-purpose input/output, general-purpose input/output) pins .
  • the touch button has a parasitic capacitance to the ground. At this time, the parasitic capacitance of the touch button is charged through the GPIO pin until the voltage of the parasitic capacitance is charged to a preset voltage. When the voltage of the parasitic capacitor reaches the preset voltage, the off-chip pin is converted to the second configuration, that is, the off-chip pin is connected to another on-chip pin.
  • Step S112 In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured.
  • the off-chip pins connected to the touch buttons are connected to the on-chip ADC (Analog-to-Digital Converter) pins.
  • ADC Analog-to-Digital Converter
  • the parasitic capacitance of the touch button is discharged through the ADC pin, and the timing is started at the same time.
  • the preset time the current voltage of the parasitic capacitance is measured through the ADC pin on the chip.
  • the current voltage refers to the voltage to which the parasitic capacitance starts to discharge from the preset voltage and the discharge drops to after the preset time has elapsed.
  • the preset time can be flexibly designed according to specific working conditions and requirements, and its typical value can be set between tens of microseconds to hundreds of microseconds.
  • the pins will be multiplexed into the first configuration to charge the parasitic capacitance in a new round.
  • the pin can be multiplexed into the first configuration after the voltage of the parasitic capacitance is discharged to zero; or the pin can be multiplexed into the first configuration when the voltage of the parasitic capacitance is not discharged to zero.
  • the pins are multiplexed between the first configuration and the second configuration at a certain frequency, and the frequency can be set freely.
  • S120 Determine the sensing state of the touch button according to the current voltage.
  • the parasitic capacitance of the touch button Due to the distributed capacitance of the human body, when the finger approaches or touches the touch button, the parasitic capacitance of the touch button will change, and the discharge speed of the parasitic capacitance will change. Then within the same preset time, the voltage discharged by the parasitic capacitance It also changes accordingly, so that the voltage dropped to after a preset period of time after the preset voltage starts to discharge is changed. Therefore, by measuring the current voltage of the parasitic capacitance when the preset time is reached, the current voltage change can be obtained, and then the sensing state of the touch button can be judged by the current voltage change.
  • the above-mentioned touch sensing method utilizes the time division multiplexing function of the control unit to realize the detection of the touch capacitance. It does not need to rely on the traditional capacitance detection dedicated chip, has a wide range of applicability, and can greatly reduce the hardware cost of capacitance detection.
  • the pin is first converted between the first configuration and the second configuration through time division multiplexing; wherein, in the first configuration, the parasitic capacitance of the touch button is charged to When the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the parasitic capacitance is discharged by the pin, and the parasitic capacitance is measured when the preset time is reached. The current voltage of the capacitor; finally, the sensing state of the touch button is judged according to the current voltage.
  • the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
  • the present application also provides another touch sensing method 200.
  • the touch sensing method 200 may include the following steps S210 to S250.
  • Step S210 Switch the pins between the first configuration and the second configuration through time division multiplexing.
  • step S210 is the same as the principle of step 110 described above, and will not be repeated here.
  • Step S210 may also include the following steps S211 and S212.
  • the principles of step S211 and step S212 are consistent with the principles of step S111 and step S112 described above.
  • Step S211 In the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration.
  • Step S212 In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured.
  • Step S220 Filter the current voltage.
  • the filtering algorithm used in this embodiment may be any of the average value method, the median method, the recursive median method, and the Kalman filter method. In fact, any filtering algorithm can be used as long as it can improve the signal-to-noise ratio of the system.
  • the present embodiment takes the recursive average method of m consecutive numbers as an example to explain the filtering of the current voltage.
  • Fig. 4 is a schematic flowchart of the recursive average filtering method. It includes steps S221 to S222:
  • Step S221 Set a sliding window, and calculate the arithmetic average of a fixed number of measurement data in the sliding window to output a piece of data.
  • FIG. 5 is a schematic diagram of a sliding window.
  • V1 to Vn represent voltage values sequentially measured through the ADC pins, and the sliding window can cover consecutive m measured voltage values.
  • the typical value of m can be 2-5.
  • the arithmetic mean value of m consecutive measured voltage values in the sliding window is used as one output data. Assuming that m is 3, the ADC pin continuously measures 3 measured voltage values V1 ⁇ V3. At this time, calculate the arithmetic average value X1 of V1 ⁇ V3. The arithmetic average value X1 is equivalent to the output result of one measurement.
  • Step S222 The sliding window is sequentially covered with the new measurement data, and the arithmetic average of the measurement data in the sliding window is sequentially calculated to output multiple data in sequence.
  • X1 to Xn represent data output in sequence, and each output data is the arithmetic average of m continuous measured voltage values during the sliding process of the sliding window. Specifically, as the new measured voltage value is generated, the sliding window slides forward in turn to cover the new measurement data. Since the amount of data contained in the sliding window is fixed, the new measurement data is added to the window at the same time as the old one. The measurement data exits the window.
  • the sliding window covers the measured voltage values V1 ⁇ V3, and a data X1 is output at this time; as a new measured voltage value V4 is generated, the sliding window slides forward, so that the measured voltage value V4 is added to the window and the measured voltage value V1 exits the window At this time, the sliding window covers the measured voltage values V2 to V4 and outputs a data X2; as new measured voltage values are continuously generated, the sliding window slides and covers the new measured voltage values in turn, and sequentially outputs data X1 to Xn. Filtering the current voltage measurement value through the filtering algorithm can improve the stability of the system and the current voltage measurement accuracy.
  • Step S230 Calibrate the filtered current voltage.
  • FIG. 6 is a schematic diagram of the calibration process, which includes steps S231 to S233.
  • Step S231 filtering the reference voltage.
  • the reference voltage is the reference measurement value of the current voltage in the second configuration when the touch button is in the untouched state.
  • This voltage is also the reference voltage, and the reference voltage is also Indicates the reference value of the above current voltage when the touch button is not touched.
  • the reference voltage can be used as a reference to make a judgment on the touch state of the touch button.
  • the filtering algorithm of this embodiment can also be used to filter the reference voltage, that is, any one of the average value method, the median method, the recursive median method, and the Kalman filter method. And as long as the system signal-to-noise ratio can be improved, any filtering algorithm can be used.
  • 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 Perform multiple measurement experiments on the filtered reference voltage, and obtain the average value and standard deviation of the multiple measurement experiments.
  • N1 reference measurement data are obtained, and then the average ⁇ and standard deviation ⁇ of the N1 reference measurement data are calculated.
  • the value of N1 can be flexibly selected according to the use scene and measurement speed, and its typical value can be between 10 and 10,000.
  • Step S233 normalize the current voltage according to the average value and standard deviation of the reference voltage.
  • the actual measurement data can be normalized in the subsequent actual measurement:
  • X is the measurement data of the current voltage during actual measurement.
  • Step S240 Calculate the difference between the current voltage and the reference voltage.
  • the reference voltage represents the reference value of the current voltage when the touch button is not touched.
  • the touch detection of the touch button is divided into two phases. One is the reference measurement phase, in which a reference value is obtained during the reference measurement phase; the other is the actual measurement phase, in which an actual value is obtained during the actual measurement phase. The amount of change can then determine whether the touch button is currently touched.
  • the current voltage is also the actual measured value
  • the difference between the current voltage and the reference voltage also represents the amount of change between the actual value and the reference value
  • whether the touch button is currently touched is determined by the amount of change.
  • the distributed capacitance of the human body due to the distributed capacitance of the human body, when the touch button is touched, the distributed capacitance of the human body is equivalent to the parasitic capacitance of the touch button in parallel, so that the measured value of the parasitic capacitance increases. It is worth noting that the distributed capacitance of the human body is usually 30pF ⁇ 50pF, and the design of the parasitic capacitance of the touch button should be equivalent to it.
  • the charging and discharging speed of the capacitor is affected by the size of the capacitor, when the measured value of the parasitic capacitance increases, the discharge speed of the parasitic capacitance becomes slower, and the preset time is fixed, so when the preset time arrives, the parasitic capacitance The voltage will be higher than the voltage in the untouched state of the reference, and the measured voltage value will be greater at this time. Therefore, based on the difference between the current voltage and the reference voltage, it can be determined whether the touch button is currently touched.
  • the size of the distributed capacitance connected in parallel to the parasitic capacitance in different human body or working conditions is different, which makes the charging and discharging speed of the parasitic capacitance in different working conditions inconsistent, which will generally bring about the system software control. Negative Effects.
  • the charging and discharging speed of the parasitic capacitor may be inconsistent even under each working condition. , Will not affect the measurement results, and will not affect the system software control required by this application.
  • Step S250 The difference is compared with a preset threshold, and the sensing state of the touch button is judged according to the comparison result.
  • the preset threshold is the touch activation threshold of the touch button.
  • the difference is compared with the preset threshold. If the difference is greater than the preset threshold, it indicates the amount of change between the current actual measurement value and the reference measurement value. The touch activation window was exceeded, and a valid touch occurred on the touch button.
  • the amount of change within the preset threshold is the allowable range of error, and the error within this range may be caused by factors such as measurement and environment.
  • step S233 the following steps S260 to S280 may be further included.
  • Step S260 Perform multiple touch tests on the touch button, and normalize the voltage measurement of each touch test by the average value and standard deviation of the reference voltage.
  • the touch test can be continued on the touch button.
  • N2 test touch data can be obtained by measuring the voltage of the parasitic capacitance. Normalize the touch data for each test: X1 is the test touch data.
  • the value of N2 can be flexibly selected according to the use scenario and measurement speed, and its typical value can be between 10 and 10,000.
  • Step S270 Calculate the average value and standard deviation of the multiple voltage measurement values after normalization.
  • the multiple measured values are the aforementioned test touch data, and the average value ⁇ 'and the standard deviation ⁇ 'of the N2 test touch data after the normalization process are calculated.
  • Step S280 Determine a preset threshold according to the average value and standard deviation of the multiple voltage measurement values.
  • the average value ⁇ 'and standard deviation ⁇ 'of the N2 test touch data obtained from the touch test can reflect the stability of the actual measurement data in the actual measurement phase.
  • the preset threshold may affect the sensitivity of the touch button touch and the probability of false touch.
  • the typical value of the preset threshold is between 2 ⁇ '-2 ⁇ '.
  • the value range of the preset threshold can also evaluate the stability of the device, that is, the larger the value of ⁇ '-2 ⁇ '-2, the stability of the device The better.
  • the pins are first converted between the first configuration and the second configuration through time division multiplexing; wherein, in the first configuration, the parasitic formed by the touch button and the ground network is connected through the pins.
  • the capacitor is charged to the preset voltage, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the parasitic capacitance is discharged by the pin, and when the preset time arrives , Measure the current voltage of the parasitic capacitance; finally judge the sensing state of the touch button based on the current voltage.
  • the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost. And by filtering and calibrating the measured voltage, the accuracy of the measured data is higher.
  • the present application also provides a touch sensing circuit 300, the touch sensing circuit 300 includes a touch button 310, a charging and discharging circuit 320 and a control circuit 330.
  • a grounding network is arranged around the touch button 310 to generate parasitic capacitance between the touch button and the grounding network.
  • the control circuit 330 is connected to the touch button 310 through the charge and discharge circuit 320.
  • the control circuit 330 includes a pin TK, the control circuit 330 is connected to the charging and discharging circuit 320 through the off-chip pin TK, and the control circuit 330 is configured to place the pin TK between the first configuration and the second configuration through time division multiplexing Conversion; wherein, in the first configuration, the charging and discharging circuit 320 charges the parasitic capacitance C0 of the touch button 310 to a preset voltage through the pin TK, and when the parasitic capacitance C0 is charged to the preset voltage, the pin TK is converted It is the second configuration; in the second configuration, the charging and discharging circuit 320 discharges the parasitic capacitance C0 through the pin TK, and when the preset time is reached, the current voltage of the parasitic capacitance C0 is measured; and the touch button is judged according to the current voltage 310's sensing state.
  • the touch button 310 can be a conductive electrode of any shape, and there is a parasitic capacitance C0 between the conductive electrode and the ground.
  • the control circuit 130 is a Microcontroller Unit (MCU). Time division multiplexing is the original function of the MCU. Its basic principle is to control the multiplexer through the configuration register to connect the off-chip pins to different on-chip pins at different times, so that the off-chip pins have multiple functions. Only one of these functions can be used at the same time. In this embodiment, the time division multiplexing function of the MCU is used to switch the pin TK connected to the touch button 310 between the first configuration and the second configuration. The pin has two functions, so it can save the pin resources of the MCU.
  • MCU Microcontroller Unit
  • the control circuit 330 connects the pin TK to the on-chip GPIO (General-purpose input/output, general-purpose input/output) pin.
  • GPIO General-purpose input/output, general-purpose input/output
  • the GPIO pin charges the parasitic capacitance C0 of the touch button 310 through the charging and discharging circuit until the voltage of the parasitic capacitance C0 is charged to a preset voltage.
  • the TK pin is converted to the second configuration, that is, the pin TK is connected to another on-chip pin.
  • the control circuit connects the pin TK to the on-chip ADC (Analog-to-Digital Converter) pin.
  • the ADC pin discharges the parasitic capacitance C0 of the touch button 310 through the charging and discharging circuit 320, and starts timing.
  • the preset time is reached, the current voltage of the parasitic capacitance C0 is measured through the on-chip ADC pin. Due to the distributed capacitance of the human body, when a finger approaches or touches the touch button 310, the parasitic capacitance C0 of the touch button 310 will change, which in turn causes the discharge speed of the parasitic capacitance C0 to change.
  • the parasitic capacitance C0 The discharged voltage also changes accordingly, so that the voltage dropped to after a preset period of time after the preset voltage starts to discharge is changed. Therefore, the current voltage change of the parasitic capacitance C0 can be obtained by measuring the current voltage of the parasitic capacitance C0 when the preset time is reached, and then the sensing state of the touch button 310 can be judged by the current voltage change.
  • a grounding network can be set around the touch button 310 to generate a parasitic capacitance C0 between the touch button 310 and the grounding network.
  • the pin TK of the control circuit 330 is connected to the charging and discharging circuit 320 to charge and discharge the parasitic capacitance C0 through the charging and discharging circuit 320.
  • the ground network of the touch sensing circuit 300 includes a bottom bottom line 311 and a top bottom line 312.
  • the bottom line 311 is laid on the back of the touch button, and the top ground line 312 is arranged around the touch button.
  • sufficient parasitic capacitance can be generated between the touch button and the ground to meet the requirements of the touch sensing circuit 300, and the bottom ground 311 and the top ground 312 can shield EMI (Electromagnetic Interference) and enhance The stability of the system.
  • EMI Electromagnetic Interference
  • FIG. 10 shows a schematic diagram of one structure of the charging and discharging circuit 120.
  • the charging and discharging circuit 320 includes 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.
  • the anode of the 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, and the anode of the second diode D2 is connected to one end of the second resistor R2 ,
  • 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, and the cathode of the third diode D3 is connected to the second diode.
  • 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 to both ends of the first resistor R1;
  • the connection node of the 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, the first resistor R1 and the second resistor
  • the connection node of R2 is grounded.
  • the touch sensing circuit provided by the embodiment of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit, including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to: Use the pin to switch between the first configuration and the second configuration; among them, in the first configuration, the charge and discharge circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and the parasitic capacitance is charged to the preset voltage.
  • the pin When setting the voltage, the pin is converted to the second configuration; in the second configuration, the charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and according to the current The voltage judges the sensing state of the touch button.
  • the touch sensing circuit provided by the embodiments of the present application only uses the time division multiplexing function of the control circuit to realize the touch state sensing, and the circuit structure is simple, low in cost, and can be widely used.
  • the embodiment of the present application also provides another touch sensing circuit 400, the touch sensing circuit 400 includes a circuit board 410 and the above-mentioned touch sensing circuit 300, the touch sensing circuit 300 is disposed on the circuit board 410 on.
  • the touch sensing circuit provided by the embodiments of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to:
  • the pin is switched between the first configuration and the second configuration; wherein, in the first configuration, the charge and discharge circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and the parasitic capacitance is charged to the preset voltage
  • the pin is converted to the second configuration; in the second configuration, the charging and discharging circuit is used to discharge the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the current voltage is judged
  • the sensing state of the touch button only uses the time-division multiplexing function of the control circuit to realize the sensing of the touch state, and has a simple circuit structure, low
  • An embodiment of the present application also provides an electronic device, which includes a device main body and the above-mentioned touch sensing circuit, wherein the touch sensing circuit is provided in the device main body.
  • the electronic device may be, but is not limited to, a projector, a micro-projector, a smart TV, a smart phone, a tablet computer, an electronic paper book reader, and other smart home appliances.
  • the electronic device provided by the embodiment of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit, including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to: Switch between the first configuration and the second configuration; wherein, in the first configuration, the charging and discharging circuit charges the parasitic capacitance of the touch button to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, Convert the pin to the second configuration; in the second configuration, the charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the touch button is judged according to the current voltage The sensing state.
  • the touch sensing circuit of the electronic device provided by the embodiments of the present application only uses the time-division multiplexing function of the control circuit to realize the touch state sensing.
  • the circuit structure is simple, the cost is low, the use range is wide, and electromagnetic interference can be prevented.

Landscapes

  • Electronic Switches (AREA)

Abstract

Embodiments of the present application provide a touch sensing method and circuit, and an electronic device. The method is applied to a control unit, and the control unit is connected to a touch key by means of a pin. The method comprises: first switching the pin between a first configuration and a second configuration by means of time division multiplexing, wherein in the first configuration, a parasitic capacitor of the touch key is charged to a preset voltage by means of the pin, and when the parasitic capacitor is charged to the preset voltage, the pin is switched to the second configuration; and in the second configuration, the parasitic capacitor is discharged by means of the pin, and when a preset time arrives, the current voltage of the parasitic capacitor is measured; and then determining the sensing state of the touch key according to the current voltage. The hardware cost required by the touch sensing method provided by the present application is lower.

Description

触摸感测方法、电路以及电子设备Touch sensing method, circuit and electronic equipment 技术领域Technical field
本申请涉及触摸感测领域,具体涉及一种触摸感测方法、电路以及电子设备。This application relates to the field of touch sensing, and in particular to a touch sensing method, circuit and electronic equipment.
背景技术Background technique
触摸式按键由于体积小、防尘效果好、外形美观等优点,其广泛应用于家用智能电器。常见的触摸式按键包括压电薄膜式按键、电阻式触摸按键以及电容式触摸按键。电容式触摸按键通常是某种特定形状的导电电极,当手指接触或靠近电极时,由于人体存在分布电容,使得电极的电容发生变化,芯片通过检测电容的变化,从而判断按键是否按下。Because of the advantages of small size, good dustproof effect, and beautiful appearance, touch keys are widely used in household smart appliances. Common touch buttons include piezoelectric film buttons, resistive touch buttons, and capacitive touch buttons. Capacitive touch buttons are usually conductive electrodes with a certain shape. When a finger touches or approaches the electrodes, the distributed capacitance of the human body causes the capacitance of the electrodes to change. The chip detects the change in capacitance to determine whether the button is pressed.
但是,传统的电容式触摸按键的检测需要使用专用的电容检测IC(Integrated Circuit,集成电路)芯片,电容检测IC芯片的原理复杂、且成本较高。因此,本领域技术人员迫切地需要对电容式触摸按键进行改进。However, the detection of the traditional capacitive touch button requires the use of a dedicated capacitance detection IC (Integrated Circuit, integrated circuit) chip, and the principle of the capacitance detection IC chip is complicated and the cost is relatively high. Therefore, those skilled in the art urgently need to improve the capacitive touch button.
发明内容Summary of the invention
鉴于以上问题,本申请实施例提供一种触摸感测方法、电路以及电子设备,以解决上述的技术问题。In view of the above problems, embodiments of the present application provide a touch sensing method, circuit, and electronic device to solve the above technical problems.
本申请实施例是采用以下技术方案实现的:The embodiments of this application are implemented using the following technical solutions:
第一方面,本申请实施例提供一种触摸感测方法,应用于控制单元,控制单元通过引脚连接触摸按键,该方法包括:通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚将触摸按键与接地网络形成的 寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;以及In the first aspect, an embodiment of the present application provides a touch sensing method, which is applied to a control unit, and the control unit is connected to a touch button through a pin. The method includes: using time division multiplexing to place the pin between the first configuration and the second configuration Among them, in the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and
根据当前电压判断触摸按键的感应状态。Judge the sensing state of the touch button according to the current voltage.
在一些实施方式中,根据当前电压判断触摸按键的感应状态包括计算当前电压与基准电压的差值,基准电压为当触摸按键在未触摸状态时,在第二配置下的当前电压的基准测量值;以及将差值与预设阈值比较,并根据比较结果判断触摸按键的感应状态。In some embodiments, judging the sensing state of the touch button according to the current voltage includes calculating the difference between the current voltage and a reference voltage, where the reference voltage is a reference measurement value of the current voltage in the second configuration when the touch button is in an untouched state. ; And the difference is compared with the preset threshold, and the sensing state of the touch button is judged according to the comparison result.
在一些实施方式中,计算当前电压与基准电压的差值之前还包括对当前电压进行滤波;以及对滤波后的当前电压进行校准。In some embodiments, before calculating the difference between the current voltage and the reference voltage, it further includes filtering the current voltage; and calibrating the filtered current voltage.
在一些实施方式中,对当前电压进行滤波包括通过平均值法、中位数法、递推平均值法、递推中位数法以及卡尔曼滤波法中的任一种或多种算法对当前电压进行滤波。In some embodiments, filtering the current voltage includes filtering the current voltage by any one or more of the average method, median method, recursive average method, recursive median method, and Kalman filter method. The voltage is filtered.
在一些实施方式中,对滤波后的当前电压进行校准包括通过平均值法、中位数法、递推平均值法、递推中位数法以及卡尔曼滤波法中的任一种或多种算法对基准电压进行滤波;对滤波后的基准电压进行多次测量试验,并获得多次测量试验的平均值以及标准差;以及通过基准电压的平均值以及标准差对当前电压进行归一化。In some embodiments, calibrating the filtered current voltage includes using any one or more of the average method, the median method, the recursive average method, the recursive median method, and the Kalman filter method. The algorithm filters the reference voltage; performs multiple measurement experiments on the filtered reference voltage, and obtains the average value and standard deviation of the multiple measurement experiments; and normalizes the current voltage through the average value and standard deviation of the reference voltage.
在一些实施方式中,对滤波后的基准电压进行多次测量试验,并获得多次测量试验的平均值以及标准差之后,还包括对触摸按键进行多次触摸试验,并通过基准电压的平均值以及标准差对每次触摸试验的电压测量值进行归一化;计算归一化后的多个电压测量值的平均值与标准差;以及根据多个电压测量值的平均值与标准差,确定预设阈值。In some embodiments, after performing multiple measurement tests on the filtered reference voltage, and obtaining the average value and standard deviation of the multiple measurement tests, it also includes performing multiple touch tests on the touch buttons and passing the average value of the reference voltage. And the standard deviation normalizes the voltage measurement value of each touch test; calculates the average value and standard deviation of multiple voltage measurement values after normalization; and determines according to the average value and standard deviation of multiple voltage measurement values Preset threshold.
第二方面,本申请实施例还提供一种触摸感测电路,该电路包括触摸按键,所述触摸按键周围设置接地网络,以使所述触摸按键与所述接地网络之间产生寄生电容;充放电电路,连接触摸按键;以及控制电路,包括引脚,引脚连接充放电电路,控制电路被配置为:通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚使充放电电路将触摸按键的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过引脚使充放电电路对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;以及根据当前电压判断触摸按键的感应状态。In a second aspect, an embodiment of the present application also provides a touch sensing circuit, which includes a touch button, and a grounding network is arranged around the touch button, so that parasitic capacitance is generated between the touch button and the grounding network; The discharge circuit is connected to the touch button; and the control circuit includes pins, the pins are connected to the charge and discharge circuit, and the control circuit is configured to switch the pins between the first configuration and the second configuration through time division multiplexing; In the first configuration, the charging and discharging circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, The charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the sensing state of the touch button is judged according to the current voltage.
在一些实施方式中,所述接地网络包括底层地线以及顶层地线,所述顶层地线围绕所述触摸按键设置。In some embodiments, the ground network includes a bottom ground wire and a top ground wire, and the top ground wire is arranged around the touch button.
在一些实施方式中,充放电电路包括第一二极管、第二二极管、第三二极管、第四二极管、第一电阻、第二电阻以及第一电容,第一二极管的正极连接于第二二极管的负极,第一二极管的负极连接于第一电阻的一端,第二二极管的正极连接于第二电阻的一端,第一电阻的另一端与第二电阻的另一端连接;第三二级管的正极连接于第四二极管的负极,第三二极管的负极连接于第二二极管与第二电阻之间,第四二极管的正极连接于第一二极管与第一电阻之间;第一电容并联在第一电阻两端;第一二极管与第二二极管的连接节点连接于触摸按键,第三二极管与第四二极管的连接节点连接于控制电路,第一电阻与第二电阻的连接节点接地。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. The anode of the tube is connected to the cathode of the second diode, the cathode of the first diode is connected to one end of the first resistor, the 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 The other end of the second resistor is connected; 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, the fourth diode The anode of the tube is connected between the first diode and the first resistor; the first capacitor is connected in parallel to both ends of the first resistor; the connection node of the first diode and the second diode is connected to the touch button, the third and second The connection node of the pole tube 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 also provides an electronic device, which includes a device main body and the above-mentioned touch sensing circuit provided in the device main body.
本申请提供的触摸感测方法、电路以及电子设备,触摸感测方法应用于控制单元,控制单元通过引脚连接触摸按键,该方法先通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚将触摸按键的寄生电 容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过将引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;进而根据当前电压判断触摸按键的感应状态。在上述过程中,该方法的实现无需依赖专用的电容检测IC芯片,而是利用了控制单元中的时分复用功能,因此相比于传统的触摸检测方案需要专用的电容检测IC芯片而言,本申请提供的触摸感测方法所需依赖的硬件成本更低。The touch sensing method, circuit, and electronic equipment provided in the present application are applied to a control unit, and the control unit is connected to a touch button through a pin. Among them, in the first configuration, the parasitic capacitance of the touch button is charged to the preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration Under the configuration, the parasitic capacitance is discharged by the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and then the sensing state of the touch button is judged according to the current voltage. In the above process, the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the application will be more concise and understandable in the description of the following embodiments.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1示出了本申请实施例提供的触摸感测方法的流程示意图。FIG. 1 shows a schematic flowchart of a touch sensing method provided by an embodiment of the present application.
图2示出了图1中步骤S110的流程示意图Figure 2 shows a schematic diagram of the flow of step S110 in Figure 1
图3示出了本申请实施例提供的另一种触摸感测方法的流程示意图。FIG. 3 shows a schematic flowchart of another touch sensing method provided by an embodiment of the present application.
图4示出了图3中步骤S220的流程示意图。FIG. 4 shows a schematic flowchart of step S220 in FIG. 3.
图5示出了滑动窗口的示意图。Figure 5 shows a schematic diagram of a sliding window.
图6示出了图3中步骤S230的流程示意图。FIG. 6 shows a schematic flowchart of step S230 in FIG. 3.
图7示出了本申请实施例提供步骤S260~步骤S280的流程示意图。FIG. 7 shows a schematic flowchart of steps S260 to S280 provided in an embodiment of the present application.
图8示出了本申请实施例提供的触摸感测电路的结构示意图。FIG. 8 shows a schematic structural diagram of a touch sensing circuit provided by an embodiment of the present application.
图9示出了本申请实施例提供的触摸感测电路的接地网络的示意图。FIG. 9 shows a schematic diagram of a ground network of a touch sensing circuit provided by an embodiment of the present application.
图10示出了图8中充放电电路的其中一种电路结构示意图。FIG. 10 shows a schematic diagram of one of the circuit structures of the charging and discharging circuit in FIG. 8.
图11示出了本申请实施例提供的另一种触摸感测电路的结构示意图。FIG. 11 shows a schematic structural diagram of another touch sensing circuit provided by an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性地,仅用于解释本申请,而不能理解为对本申请的限制。The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals indicate the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary, and are only used to explain the present application, and cannot be understood as a limitation to the present application.
目前市场上的按键分为传统的机械按键和触摸式按键。机械按键由于易磨损、安装复杂、受环境影响等缺点逐渐被摒弃,而触摸式按键则由于体积小、防尘效果好、外形美观等优点逐渐广泛应用于家用智能电器。The buttons currently on the market are divided into traditional mechanical buttons and touch buttons. Mechanical keys are gradually abandoned due to shortcomings such as easy wear, complex installation, and environmental influences, while touch keys are gradually widely used in household smart appliances due to their small size, good dust-proof effect, and beautiful appearance.
常见的触摸式按键分为压电薄膜式触摸按键、电阻式触摸按键以及电容式触摸按键。其中,电容式触摸按键通常是某种特定形状的导电电极,当手指接触或靠近电极时,由于人体存在分布电容,使得电极的电容发生变化,芯片通过检测电容的变化,从而判断按键是否按下。Common touch buttons are divided into piezoelectric film touch buttons, resistive touch buttons, and capacitive touch buttons. Among them, the capacitive touch button is usually a conductive electrode of a certain shape. When a finger touches or approaches the electrode, the distributed capacitance of the human body causes the capacitance of the electrode to change. The chip detects the change in capacitance to determine whether the button is pressed. .
但是,传统的电容式触摸按键的检测需要使用专用的电容检测IC(Integrated Circuit,集成电路)芯片,电容检测IC芯片的原理复杂、且成本较高。因此,本领域技术人员迫切地需要对电容式触摸按键进行改进。However, the detection of the traditional capacitive touch button requires the use of a dedicated capacitance detection IC (Integrated Circuit, integrated circuit) chip, and the principle of the capacitance detection IC chip is complicated and the cost is relatively high. Therefore, those skilled in the art urgently need to improve the capacitive touch button.
为了解决上述技术问题,发明人经过长期研究,提出了本申请实施例中的触摸感测方法、电路以及电子设备。触摸感测方法应用于控制单元,控制单元通过引脚连接触摸按键,该方法先通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚将触摸按键与接地网络形成的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过将引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;最后根据当前电压判断触摸按键的感应状态。在上述过程中,该 方法的实现无需依赖专用的电容检测IC芯片,而是利用了控制单元中的时分复用功能,因此相比于传统的触摸检测方案需要专用的电容检测IC芯片而言,本申请提供的触摸感测方法所需依赖的硬件成本更低。In order to solve the above technical problems, the inventors have proposed the touch sensing method, circuit and electronic device in the embodiments of the present application after long-term research. The touch sensing method is applied to the control unit, and the control unit is connected to the touch button through the pin. The method first switches the pin between the first configuration and the second configuration through time-division multiplexing; wherein, in the first configuration, through the lead The pin charges the parasitic capacitance formed by the touch button and the ground network to a preset voltage, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the pin is connected to the parasitic capacitance Discharge, and when the preset time arrives, measure the current voltage of the parasitic capacitance; finally, judge the sensing state of the touch button based on the current voltage. In the above process, the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
为了使本技术领域的人员更好地理解本申请的方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整的描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work shall fall within the protection scope of this application.
如图1所示,图1示出了本申请实施例提供的触摸感测方法的流程示意图,该方法可以应用于控制单元,控制单元通过引脚连接触摸按键。控制单元是引脚具备时分复用功能的微处理器。本申请实施例中,该控制单元可以是MCU(Microcontroller Unit,微控制单元),MCU通过外部引脚连接至触摸按键。该触摸感测方法可以包括以下步骤:As shown in FIG. 1, FIG. 1 shows a schematic flowchart of a touch sensing method provided by an embodiment of the present application. The method can be applied to a control unit, and the control unit is connected to a touch button through a pin. The control unit is a microprocessor with pins with time division multiplexing function. In the embodiment of the present application, the control unit may be an MCU (Microcontroller Unit, Microcontroller Unit), and the MCU is connected to the touch button through an external pin. The touch sensing method may include the following steps:
S110:通过时分复用将引脚在第一配置以及第二配置之间转换。S110: Switch the pin between the first configuration and the second configuration through time division multiplexing.
时分复用是控制单元固有的功能,其基本原理是通过配置寄存器控制多路开关,以将片外引脚在不同时刻连接不同的片内引脚,使得片外引脚具有多种功能,但是在同一时刻仅能使用其中一个功能。本实施例中,利用控制单元的时分复用功能,使连接至触摸按键的片外引脚在第一配置以及第二配置之间转换,进而使得该片外引脚具有两种功能,因此能够节省控制单元的引脚资源。Time division multiplexing is an inherent function of the control unit. Its basic principle is to control multiple switches through the configuration register to connect the off-chip pins to different on-chip pins at different times, so that the off-chip pins have multiple functions, but Only one of these functions can be used at the same time. In this embodiment, the time division multiplexing function of the control unit is used to switch the off-chip pin connected to the touch button between the first configuration and the second configuration, so that the off-chip pin has two functions, so it can Save pin resources of the control unit.
进一步地,如图2所示,步骤S110可以包括以下步骤S111~步骤S112。Further, as shown in FIG. 2, step S110 may include the following steps S111 to S112.
步骤S111:在第一配置下,通过引脚将触摸按键与接地网络形成的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置。Step S111: In the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration.
本实施例中,当复用控制单元的引脚至第一配置时,将连接至触摸按键的片外引脚连接片内的GPIO(General-purpose input/output,通用型输入/输出)引脚。 触摸按键对地存在一个寄生电容,此时通过GPIO引脚对触摸按键的寄生电容充电,直至将该寄生电容的电压充电至一预设电压。当该寄生电容的电压达到该预设电压后,将片外引脚转换为第二配置,也即将该片外引脚连接至另一个片内引脚。In this embodiment, when the pins of the control unit are multiplexed to the first configuration, the off-chip pins connected to the touch buttons are connected to the on-chip GPIO (General-purpose input/output, general-purpose input/output) pins . The touch button has a parasitic capacitance to the ground. At this time, the parasitic capacitance of the touch button is charged through the GPIO pin until the voltage of the parasitic capacitance is charged to a preset voltage. When the voltage of the parasitic capacitor reaches the preset voltage, the off-chip pin is converted to the second configuration, that is, the off-chip pin is connected to another on-chip pin.
步骤S112:在第二配置下,通过引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压。Step S112: In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured.
本实施例中,当复用控制单元的引脚至第二配置时,将连接至触摸按键的片外引脚连接片内的ADC(Analog-to-Digital Converter,模数转换)引脚。此时通过ADC引脚对触摸按键的寄生电容进行放电,同时开始计时,当预设时间到达时,通过片内的ADC引脚测量寄生电容的当前电压。本申请实施例中,当前电压即表示寄生电容从预设电压开始放电,并经过预设时间后放电下降到的电压。本实施例中,该预设时间可以根据具体的工况和需求灵活的设计,其典型值可以设置在几十微秒至几百微秒之间。In this embodiment, when the pins of the control unit are multiplexed to the second configuration, the off-chip pins connected to the touch buttons are connected to the on-chip ADC (Analog-to-Digital Converter) pins. At this time, the parasitic capacitance of the touch button is discharged through the ADC pin, and the timing is started at the same time. When the preset time is reached, the current voltage of the parasitic capacitance is measured through the ADC pin on the chip. In the embodiment of the present application, the current voltage refers to the voltage to which the parasitic capacitance starts to discharge from the preset voltage and the discharge drops to after the preset time has elapsed. In this embodiment, the preset time can be flexibly designed according to specific working conditions and requirements, and its typical value can be set between tens of microseconds to hundreds of microseconds.
可以理解的是,在当前电压测量完毕之后,引脚将被复用至第一配置,对寄生电容进行新一轮的充电。具体地,可以在寄生电容的电压放电至零之后,再将引脚复用为第一配置;也可在寄生电容的电压未放电至零时,即将引脚复用为第一配置。本实施例中,以一定频率将引脚在第一配置与第二配置之间往返复用,该频率可以自由设置。It is understandable that after the current voltage measurement is completed, the pins will be multiplexed into the first configuration to charge the parasitic capacitance in a new round. Specifically, the pin can be multiplexed into the first configuration after the voltage of the parasitic capacitance is discharged to zero; or the pin can 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 between the first configuration and the second configuration at a certain frequency, and the frequency can be set freely.
S120:根据当前电压判断触摸按键的感应状态。S120: Determine the sensing state of the touch button according to the current voltage.
由于人体存在分布电容,当手指靠近或接触触摸按键时,触摸按键的寄生电容会发生变化,进而使寄生电容的放电速度改变,那么在相同的预设时间之内,寄生电容所泄放的电压也相应地发生改变,从而使得从预设电压开始放电一段预设时间后所下降到的电压改变。因此通过在预设时间到达时测量寄生电容的当前 电压能够得到当前电压的变化情况,再通过当前电压的变化情况即可判断触摸按键的感应状态。Due to the distributed capacitance of the human body, when the finger approaches or touches the touch button, the parasitic capacitance of the touch button will change, and the discharge speed of the parasitic capacitance will change. Then within the same preset time, the voltage discharged by the parasitic capacitance It also changes accordingly, so that the voltage dropped to after a preset period of time after the preset voltage starts to discharge is changed. Therefore, by measuring the current voltage of the parasitic capacitance when the preset time is reached, the current voltage change can be obtained, and then the sensing state of the touch button can be judged by the current voltage change.
上述的触摸感测方法,利用控制单元的时分复用功能,实现触摸电容的检测。其无需依赖传统的电容检测专用芯片,适用性非常广泛,能够极大地降低电容检测的硬件成本。The above-mentioned touch sensing method utilizes the time division multiplexing function of the control unit to realize the detection of the touch capacitance. It does not need to rely on the traditional capacitance detection dedicated chip, has a wide range of applicability, and can greatly reduce the hardware cost of capacitance detection.
本申请实施例提供的触摸感测方法,先通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚将触摸按键的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过将引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;最后根据当前电压判断触摸按键的感应状态。在上述过程中,该方法的实现无需依赖专用的电容检测IC芯片,而是利用了控制单元中的时分复用功能,因此相比于传统的触摸检测方案需要专用的电容检测IC芯片而言,本申请提供的触摸感测方法所需依赖的硬件成本更低。In the touch sensing method provided by the embodiment of the application, the pin is first converted between the first configuration and the second configuration through time division multiplexing; wherein, in the first configuration, the parasitic capacitance of the touch button is charged to When the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the parasitic capacitance is discharged by the pin, and the parasitic capacitance is measured when the preset time is reached. The current voltage of the capacitor; finally, the sensing state of the touch button is judged according to the current voltage. In the above process, the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost.
如图3所示,本申请还提供另一种触摸感测方法200,触摸感测方法200可以包括以下步骤S210~步骤S250。As shown in FIG. 3, the present application also provides another touch sensing method 200. The touch sensing method 200 may include the following steps S210 to S250.
步骤S210:通过时分复用将引脚在第一配置以及第二配置之间转换。Step S210: Switch the pins between the first configuration and the second configuration through time division multiplexing.
步骤S210的原理与上述步骤110的原理相同,在此不作赘述。步骤S210同样可以包括以下步骤S211以及步骤S212,步骤S211和步骤S212的原理与上述的步骤S111和步骤S112的原理一致。The principle of step S210 is the same as the principle of step 110 described above, and will not be repeated here. Step S210 may also include the following steps S211 and S212. The principles of step S211 and step S212 are consistent with the principles of step S111 and step S112 described above.
步骤S211:在第一配置下,通过引脚将触摸按键与接地网络形成的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置。Step S211: In the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration.
步骤S212:在第二配置下,通过引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压。Step S212: In the second configuration, the parasitic capacitance is discharged through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured.
本实施例中,在获得当前电压的测量值之后,可以继续执行以下步骤。In this embodiment, after obtaining the measured value of the current voltage, the following steps can be continued.
步骤S220:对当前电压进行滤波。Step S220: Filter the current voltage.
本实施例中,通过对当前电压进行滤波,能够降低系统噪声,并减小测量误差。本实施例所采用的滤波算法可以是平均值法、中位数法、递推中位数法以及卡尔曼滤波法中的任一种。实际上,任何滤波算法只要能能够提高系统信噪比都可以使用。以下,本实施例以连续m个数的递推平均数法为例,对当前电压的滤波进行解释说明。如图4所示,图4为递推平均数滤波法的流程示意图。其包括步骤S221~步骤S222:In this embodiment, by filtering the current voltage, the system noise can be reduced and the measurement error can be reduced. The filtering algorithm used in this embodiment may be any of the average value method, the median method, the recursive median method, and the Kalman filter method. In fact, any filtering algorithm can be used as long as it can improve the signal-to-noise ratio of the system. Hereinafter, the present embodiment takes the recursive average method of m consecutive numbers as an example to explain the filtering of the current voltage. As shown in Fig. 4, Fig. 4 is a schematic flowchart of the recursive average filtering method. It includes steps S221 to S222:
步骤S221:设置滑动窗口,并计算滑动窗口内固定数量的测量数据的算数平均值,以输出一个数据。Step S221: Set a sliding window, and calculate the arithmetic average of a fixed number of measurement data in the sliding window to output a piece of data.
如图5所示,图5为滑动窗口的示意图。V1~Vn表示通过ADC引脚依次测量的电压值,该滑动窗口可以覆盖连续的m个测量电压值,在本实施例中,m的典型值可以取2~5。进一步地,将滑动窗口内连续的m个测量电压值的算数平均值作为一个输出数据。假设m取3,ADC引脚连续测得3个测量电压值V1~V3,此时计算V1~V3的算数平均值X1,该算数平均值X1就相当于是一次测量的输出结果。As shown in Figure 5, Figure 5 is a schematic diagram of a sliding window. V1 to Vn represent voltage values sequentially measured through the ADC pins, and the sliding window can cover consecutive m measured voltage values. In this embodiment, the typical value of m can be 2-5. Further, the arithmetic mean value of m consecutive measured voltage values in the sliding window is used as one output data. Assuming that m is 3, the ADC pin continuously measures 3 measured voltage values V1~V3. At this time, calculate the arithmetic average value X1 of V1~V3. The arithmetic average value X1 is equivalent to the output result of one measurement.
步骤S222:将滑动窗口依次覆盖新的测量数据,并依次计算滑动窗口内的测量数据的算数平均值,以依次输出多个数据。Step S222: The sliding window is sequentially covered with the new measurement data, and the arithmetic average of the measurement data in the sliding window is sequentially calculated to output multiple data in sequence.
如图5所示,X1~Xn表示依次输出的数据,其中每一个输出数据均是滑动窗口在滑动过程中m个连续测量电压值的算数平均值。具体地,随着新的测量电压值的产生,滑动窗口依次向前滑动依次覆盖新的测量数据,而由于滑动窗口所容纳的数据的数量固定的,那么新的测量数据加入窗口的同时旧的测量数据则退出窗口。例如,滑动窗口覆盖测量电压值V1~V3,此时输出一个数据X1;随着新的 测量电压值V4的产生,滑动窗口向前滑动,使得测量电压值V4加入窗口而测量电压值V1退出窗口,此时滑动窗口覆盖测量电压值V2~V4,并输出一个数据X2;随着新的测量电压值连续产生,滑动窗口依次滑动并覆盖新的测量电压值,并依次输出数据X1~Xn。通过该滤波算法对当前电压的测量值进行滤波,能够提高系统的稳定性以及当前电压的测量精度。As shown in Figure 5, X1 to Xn represent data output in sequence, and each output data is the arithmetic average of m continuous measured voltage values during the sliding process of the sliding window. Specifically, as the new measured voltage value is generated, the sliding window slides forward in turn to cover the new measurement data. Since the amount of data contained in the sliding window is fixed, the new measurement data is added to the window at the same time as the old one. The measurement data exits the window. For example, the sliding window covers the measured voltage values V1~V3, and a data X1 is output at this time; as a new measured voltage value V4 is generated, the sliding window slides forward, so that the measured voltage value V4 is added to the window and the measured voltage value V1 exits the window At this time, the sliding window covers the measured voltage values V2 to V4 and outputs a data X2; as new measured voltage values are continuously generated, the sliding window slides and covers the new measured voltage values in turn, and sequentially outputs data X1 to Xn. Filtering the current voltage measurement value through the filtering algorithm can improve the stability of the system and the current voltage measurement accuracy.
步骤S230:对滤波后的当前电压进行校准。Step S230: Calibrate the filtered current voltage.
本实施例中,通过对滤波后的当前电压进行校准,能够进一步提高测量精度。如图6所示,图6为校准的流程示意图,其包括步骤S231~步骤S233。In this embodiment, by calibrating the filtered current voltage, the measurement accuracy can be further improved. As shown in FIG. 6, FIG. 6 is a schematic diagram of the calibration process, which includes steps S231 to S233.
步骤S231:对基准电压进行滤波。Step S231: filtering the reference voltage.
基准电压是当触摸按键在未触摸状态时,在第二配置下的当前电压的基准测量值。在触摸按键未发生触摸的状态时,通过上述步骤S211~步骤S212的方法测量触摸按键在第二配置下,寄生电容放电一段预设时间后的电压,该电压也就是基准电压,该基准电压也表示上述当前电压在触摸按键未触摸状态下的基准值。在实际测量阶段时,可以以该基准电压作为基准,对触摸按键的触摸状态做出判断。The reference voltage is the reference measurement value of the current voltage in the second configuration when the touch button is in the untouched state. When the touch button is not touched, measure the voltage of the touch button after the parasitic capacitance is discharged for a preset period of time in the second configuration by the method of the above steps S211 to S212. This voltage is also the reference voltage, and the reference voltage is also Indicates the reference value of the above current voltage when the touch button is not touched. In the actual measurement phase, the reference voltage can be used as a reference to make a judgment on the touch state of the touch button.
本实施例中,对基准电压的滤波同样可以采用本实施例的滤波算法,即平均值法、中位数法、递推中位数法以及卡尔曼滤波法中的任一种。并且只要能够提高系统信噪比,任何滤波算法都可以使用。在一些实施方式中,在对步骤S220中的当前电压所使用的滤波算法可以与对基准电压所使用的滤波算法相同,以保证测量数据的准确性。In this embodiment, the filtering algorithm of this embodiment can also be used to filter the reference voltage, that is, any one of the average value method, the median method, the recursive median method, and the Kalman filter method. And as long as the system signal-to-noise ratio can be improved, any filtering algorithm can be used. 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.
步骤S232:对滤波后的基准电压进行多次测量试验,并获得多次测量试验的平均值以及标准差。Step S232: Perform multiple measurement experiments on the filtered reference voltage, and obtain the average value and standard deviation of the multiple measurement experiments.
本实施中,对基准电压进行多次测量试验,经过上述的滤波之后,从而获得 N1个基准测量数据,再计算该N1个基准测量数据的平均值μ以及标准差σ。N1的值可以根据使用场景和测量速度灵活的选取,其典型值可以在10~10000之间。In this implementation, multiple measurement tests are performed on the reference voltage, and after the above-mentioned filtering, N1 reference measurement data are obtained, and then the average μ and standard deviation σ of the N1 reference measurement data are calculated. The value of N1 can be flexibly selected according to the use scene and measurement speed, and its typical value can be between 10 and 10,000.
步骤S233:通过所述基准电压的平均值以及标准差对所述当前电压进行归一化。Step S233: normalize the current voltage according to the average value and standard deviation of the reference voltage.
本实施例中,通过N1个基准测量数据的平均值μ以及标准差μ,可以在后续实际测量时,对实际的测量数据进行归一化处理:
Figure PCTCN2021086413-appb-000001
其中,X为在实际测量时,该当前电压的测量数据。
In this embodiment, through the average μ and standard deviation μ of the N1 benchmark measurement data, the actual measurement data can be normalized in the subsequent actual measurement:
Figure PCTCN2021086413-appb-000001
Among them, X is the measurement data of the current voltage during actual measurement.
步骤S240:计算当前电压与基准电压的差值。Step S240: Calculate the difference between the current voltage and the reference voltage.
如前文所述,基准电压表示当前电压在触摸按键未触摸状态下的基准值。触摸按键的触摸检测分为两个阶段,一是基准测量阶段,在基准测量阶段得到一个基准值;二是实际测量阶段,在实际测量阶段得到一个实际值,通过实际值与基准值之间的变化量,进而能够判断触摸按键当前是否发生触摸。As mentioned above, the reference voltage represents the reference value of the current voltage when the touch button is not touched. The touch detection of the touch button is divided into two phases. One is the reference measurement phase, in which a reference value is obtained during the reference measurement phase; the other is the actual measurement phase, in which an actual value is obtained during the actual measurement phase. The amount of change can then determine whether the touch button is currently touched.
本实施例中,当前电压也即实际测量值,当前电压与基准电压的差值也即表示了实际值与基准值之间的变化量,通过该变化量判断触摸按键当前是否发生触摸。具体而言,由于人体存在分布电容,当触摸按键发生触摸时,人体的分布电容相当于与触摸按键的寄生电容并联,使得寄生电容的测量值增大。值得注意的是,人体的分布电容大小通常在30pF~50pF,触摸按键的寄生电容大小设计应该与之相当。由于电容的充放电速度受电容大小的影响,当寄生电容的测量值增大时,寄生电容的放电速度变慢,而预设时间是固定不变的,那么在预设时间到达时寄生电容的电压会比基准未触摸状态下的电压更高,此时测量的电压值更大。因此,通过当前电压与基准电压的差值,能够判断触摸按键当前是否发生触摸。In this embodiment, the current voltage is also the actual measured value, and the difference between the current voltage and the reference voltage also represents the amount of change between the actual value and the reference value, and whether the touch button is currently touched is determined by the amount of change. Specifically, due to the distributed capacitance of the human body, when the touch button is touched, the distributed capacitance of the human body is equivalent to the parasitic capacitance of the touch button in parallel, so that the measured value of the parasitic capacitance increases. It is worth noting that the distributed capacitance of the human body is usually 30pF~50pF, and the design of the parasitic capacitance of the touch button should be equivalent to it. Since the charging and discharging speed of the capacitor is affected by the size of the capacitor, when the measured value of the parasitic capacitance increases, the discharge speed of the parasitic capacitance becomes slower, and the preset time is fixed, so when the preset time arrives, the parasitic capacitance The voltage will be higher than the voltage in the untouched state of the reference, and the measured voltage value will be greater at this time. Therefore, based on the difference between the current voltage and the reference voltage, it can be determined whether the touch button is currently touched.
值得一提的是,不同的人体或工况并联在寄生电容两端的分布电容的大小都不一样,这使得不同工况下寄生电容的充放电速度不一致,一般情况下会为系统 软件控制带来不利影响。但是,本实施例中,由于在寄生电容充电阶段将其充电至一预设电压,并在放电阶段测量预设放电时间之后电压值,因此即使每个工况下寄生电容的充放电速度可能不一致,也不会对测量结果产生影响,同时也不会影响到本申请所需的系统软件控制。It is worth mentioning that the size of the distributed capacitance connected in parallel to the parasitic capacitance in different human body or working conditions is different, which makes the charging and discharging speed of the parasitic capacitance in different working conditions inconsistent, which will generally bring about the system software control. Negative Effects. However, in this embodiment, since the parasitic capacitor is charged to a preset voltage during the charging phase, and the voltage value after the preset discharge time is measured during the discharge phase, the charging and discharging speed of the parasitic capacitor may be inconsistent even under each working condition. , Will not affect the measurement results, and will not affect the system software control required by this application.
步骤S250:将差值与预设阈值比较,并根据比较结果判断触摸按键的感应状态。Step S250: The difference is compared with a preset threshold, and the sensing state of the touch button is judged according to the comparison result.
预设阈值是触摸按键的触摸激活阈值,本实施例中,将该差值与预设阈值比较,如果该差值大于该预设阈值,则说明当前的实际测量值与基准测量值的变化量超过了触摸激活窗口,触摸按键发生了有效的触摸。而在预设阈值之内的变化量,则是误差允许的范围,该范围之内的误差可能由诸如测量、环境等因素引起。The preset threshold is the touch activation threshold of the touch button. In this embodiment, the difference is compared with the preset threshold. If the difference is greater than the preset threshold, it indicates the amount of change between the current actual measurement value and the reference measurement value. The touch activation window was exceeded, and a valid touch occurred on the touch button. The amount of change within the preset threshold is the allowable range of error, and the error within this range may be caused by factors such as measurement and environment.
如图7所示,在一些实施方式中,在步骤S233之后,还可以包括以下步骤S260~S280。As shown in FIG. 7, in some embodiments, after step S233, the following steps S260 to S280 may be further included.
步骤S260:对触摸按键进行多次触摸试验,并通过基准电压的平均值以及标准差对每次触摸试验的电压测量进行归一化。Step S260: Perform multiple touch tests on the touch button, and normalize the voltage measurement of each touch test by the average value and standard deviation of the reference voltage.
本实施例中,在得到基准测量数据的平均值μ以及标准差μ之后,可以继续对触摸按键进行触摸试验,在多次触摸试验后,通过测量寄生电容的电压可以得到N2个试验触摸数据,对每一个试验触摸数据均做归一化处理:
Figure PCTCN2021086413-appb-000002
X1为试验触摸数据。N2的值可以根据使用场景和测量速度灵活的选取,其典型值可以在10~10000之间。
In this embodiment, after obtaining the average value μ and the standard deviation μ of the reference measurement data, the touch test can be continued on the touch button. After multiple touch tests, N2 test touch data can be obtained by measuring the voltage of the parasitic capacitance. Normalize the touch data for each test:
Figure PCTCN2021086413-appb-000002
X1 is the test touch data. The value of N2 can be flexibly selected according to the use scenario and measurement speed, and its typical value can be between 10 and 10,000.
步骤S270:计算归一化后的多个电压测量值的平均值以及标准差。Step S270: Calculate the average value and standard deviation of the multiple voltage measurement values after normalization.
本实施例中,多个测量值也就是上述的试验触摸数据,计算归一化处理之后的N2个试验触摸数据的平均值μ’以及标准差σ’。In this embodiment, the multiple measured values are the aforementioned test touch data, and the average value μ'and the standard deviation σ'of the N2 test touch data after the normalization process are calculated.
步骤S280:根据多个电压测量值的平均值与标准差,确定预设阈值。Step S280: Determine a preset threshold according to the average value and standard deviation of the multiple voltage measurement values.
本实施例中,根据触摸试验所得到的N2个试验触摸数据的平均值μ’以及标准差σ’可以体现出在实际测量阶段时实际测量数据的稳定性,标准差σ’越小则实际测量数据的稳定性越高,测量数据的稳定性越高,则可以将预设阈值的值设置的更大。In this embodiment, the average value μ'and standard deviation σ'of the N2 test touch data obtained from the touch test can reflect the stability of the actual measurement data in the actual measurement phase. The smaller the standard deviation σ', the actual measurement. The higher the stability of the data and the higher the stability of the measurement data, the greater the value of the preset threshold can be set.
进一步地,预设阈值可以影响到触摸按键触摸的灵敏度以及误触的几率。预设阈值越小,则触摸的灵敏度更高,误触的几率也更大;而预设阈值越大,则触摸的稳定性更高。预设阈值的典型值在2~μ’-2σ’之间,预设阈值的取值范围也可以评估设备的稳定性,即μ’-2σ’-2的值越大,说明设备的稳定性越好。Further, the preset threshold may affect the sensitivity of the touch button touch and the probability of false touch. The smaller the preset threshold, the higher the sensitivity of the touch and the greater the probability of false touch; the larger the preset threshold, the higher the stability of the touch. The typical value of the preset threshold is between 2~μ'-2σ'. The value range of the preset threshold can also evaluate the stability of the device, that is, the larger the value of μ'-2σ'-2, the stability of the device The better.
本实施例提供的触摸感测方法,先通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚将触摸按键与接地网络形成的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过将引脚对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;最后根据当前电压判断触摸按键的感应状态。在上述过程中,该方法的实现无需依赖专用的电容检测IC芯片,而是利用了控制单元中的时分复用功能,因此相比于传统的触摸检测方案需要专用的电容检测IC芯片而言,本申请提供的触摸感测方法所需依赖的硬件成本更低。并且通过对测量的电压滤波和校准,使得测量数据的精度更高。In the touch sensing method provided in this embodiment, the pins are first converted between the first configuration and the second configuration through time division multiplexing; wherein, in the first configuration, the parasitic formed by the touch button and the ground network is connected through the pins. The capacitor is charged to the preset voltage, and when the parasitic capacitance is charged to the preset voltage, the pin is converted to the second configuration; in the second configuration, the parasitic capacitance is discharged by the pin, and when the preset time arrives , Measure the current voltage of the parasitic capacitance; finally judge the sensing state of the touch button based on the current voltage. In the above process, the implementation of this method does not need to rely on a dedicated capacitance detection IC chip, but uses the time-division multiplexing function in the control unit. Therefore, compared with the traditional touch detection scheme that requires a dedicated capacitance detection IC chip, The touch sensing method provided in this application requires a lower hardware cost. And by filtering and calibrating the measured voltage, the accuracy of the measured data is higher.
如图8所示,本申请还提供一种触摸感测电路300,该触摸感测电路300包括触摸按键310、充放电电路320以及控制电路330。其中,触摸按键310周围设置接地网络,以使所述触摸按键与所述接地网络之间产生寄生电容。控制电路330通过充放电电路320连接于触摸按键310。控制电路330包括引脚TK,控制电路330通过该片外引脚TK连接于充放电电路320,且控制电路330被配置为通过时分复用将引脚TK在第一配置以及第二配置之间转换;其中,在第一配置下,通 过引脚TK使充放电电路320将触摸按键310的寄生电容C0充电至预设电压,并在寄生电容C0充电至预设电压时,将引脚TK转换为第二配置;在第二配置下,通过引脚TK使充放电电路320对寄生电容C0进行放电,并在预设时间到达时,测量寄生电容C0的当前电压;以及根据当前电压判断触摸按键310的感应状态。As shown in FIG. 8, the present application also provides a touch sensing circuit 300, the touch sensing circuit 300 includes a touch button 310, a charging and discharging circuit 320 and a control circuit 330. Wherein, a grounding network is arranged around the touch button 310 to generate parasitic capacitance between the touch button and the grounding network. The control circuit 330 is connected to the touch button 310 through the charge and discharge circuit 320. The control circuit 330 includes a pin TK, the control circuit 330 is connected to the charging and discharging circuit 320 through the off-chip pin TK, and the control circuit 330 is configured to place the pin TK between the first configuration and the second configuration through time division multiplexing Conversion; wherein, in the first configuration, the charging and discharging circuit 320 charges the parasitic capacitance C0 of the touch button 310 to a preset voltage through the pin TK, and when the parasitic capacitance C0 is charged to the preset voltage, the pin TK is converted It is the second configuration; in the second configuration, the charging and discharging circuit 320 discharges the parasitic capacitance C0 through the pin TK, and when the preset time is reached, the current voltage of the parasitic capacitance C0 is measured; and the touch button is judged according to the current voltage 310's sensing state.
触摸按键310可以是任意形状的导电电极,导电电极与地之间存在寄生电容C0。控制电路130为微控制单元(Microcontroller Unit;MCU)。时分复用是MCU原本的功能,其基本原理是通过配置寄存器控制多路开关,以将片外引脚在不同时刻连接不同的片内引脚,使得片外引脚具有多种功能,但是在同一时刻仅能使用其中一个功能。本实施例中,利用MCU的时分复用功能,使连接至触摸按键310的引脚TK在第一配置以及第二配置之间转换,该引脚TK是片外引脚,进而使得片外引脚具有两种功能,因此能够节省MCU的引脚资源。The touch button 310 can be a conductive electrode of any shape, and there is a parasitic capacitance C0 between the conductive electrode and the ground. The control circuit 130 is a Microcontroller Unit (MCU). Time division multiplexing is the original function of the MCU. Its basic principle is to control the multiplexer through the configuration register to connect the off-chip pins to different on-chip pins at different times, so that the off-chip pins have multiple functions. Only one of these functions can be used at the same time. In this embodiment, the time division multiplexing function of the MCU is used to switch the pin TK connected to the touch button 310 between the first configuration and the second configuration. The pin has two functions, so it can save the pin resources of the MCU.
当复用至第一配置时,控制电路330将引脚TK连接片内的GPIO(General-purpose input/output,通用型输入/输出)引脚。触摸按键310对与地之间存在寄生电容C0,此时GPIO引脚通过充放电电路对触摸按键310的寄生电容C0充电,直至将该寄生电容C0的电压充电至一预设电压。当该寄生电容C0的电压达到该预设电压后,将TK引脚转换为第二配置,也即将该引脚TK连接至另一个片内引脚。When multiplexing to the first configuration, the control circuit 330 connects the pin TK to the on-chip GPIO (General-purpose input/output, general-purpose input/output) pin. There is a parasitic capacitance C0 between the pair of touch buttons 310 and the ground. At this time, the GPIO pin charges the parasitic capacitance C0 of the touch button 310 through the charging and discharging circuit until the voltage of the parasitic capacitance C0 is charged to a preset voltage. When the voltage of the parasitic capacitor C0 reaches the preset voltage, the TK pin is converted to the second configuration, that is, the pin TK is connected to another on-chip pin.
当复用至第二配置时,控制电路将引脚TK连接片内的ADC(Analog-to-Digital Converter,模数转换)引脚。此时ADC引脚通过充放电电路320对触摸按键310的寄生电容C0进行放电,同时开始计时,当预设时间到达时,通过片内的ADC引脚测量寄生电容C0的当前电压。由于人体存在分布电容,当手指靠近或接触触摸按键310时,触摸按键310的寄生电容C0会发生变化,进而使寄生电容C0的放电速度改变,那么在相同的预设时间之内,寄生电容C0所泄放的电压也相应地 发生改变,从而使得从预设电压开始放电一段预设时间后所下降到的电压改变。因此通过在预设时间到达时测量寄生电容C0的当前电压能够得到当前电压的变化情况,再通过当前电压的变化情况即可判断触摸按键310的感应状态。When multiplexing to the second configuration, the control circuit connects the pin TK to the on-chip ADC (Analog-to-Digital Converter) pin. At this time, the ADC pin discharges the parasitic capacitance C0 of the touch button 310 through the charging and discharging circuit 320, and starts timing. When the preset time is reached, the current voltage of the parasitic capacitance C0 is measured through the on-chip ADC pin. Due to the distributed capacitance of the human body, when a finger approaches or touches the touch button 310, the parasitic capacitance C0 of the touch button 310 will change, which in turn causes the discharge speed of the parasitic capacitance C0 to change. Then within the same preset time, the parasitic capacitance C0 The discharged voltage also changes accordingly, so that the voltage dropped to after a preset period of time after the preset voltage starts to discharge is changed. Therefore, the current voltage change of the parasitic capacitance C0 can be obtained by measuring the current voltage of the parasitic capacitance C0 when the preset time is reached, and then the sensing state of the touch button 310 can be judged by the current voltage change.
具体而言,可以在触摸按键310的周围设置接地网络,使触摸按键310与接地网络之间产生寄生电容C0。控制电路330的引脚TK连接于充放电电路320,以通过充放电电路320对寄生电容C0充放电。Specifically, a grounding network can be set around the touch button 310 to generate a parasitic capacitance C0 between the touch button 310 and the grounding network. The pin TK of the control circuit 330 is connected to the charging and discharging circuit 320 to charge and discharge the parasitic capacitance C0 through the charging and discharging circuit 320.
值得一提的是,本实施例中,由于触摸按键310的周围设置接地网络,使触摸按键310与接地网络之间产生寄生电容C0,使得触摸感测电路300即使在每个工况下寄生电容的充放电速度可能不一致的情况下,也不会影响整体的测量结果,进而避免影响到本申请所需的系统软件控制。It is worth mentioning that in this embodiment, since the touch button 310 is surrounded by a grounding network, a parasitic capacitance C0 is generated between the touch button 310 and the grounding network, so that the touch sensing circuit 300 has a parasitic capacitance even under each operating condition. When the charging and discharging speeds of the system may be inconsistent, it will not affect the overall measurement result, thereby avoiding affecting the system software control required by this application.
如图9所示,该触摸感测电路300的接地网络包括底层底线311以及顶层底线312,其中底层地线311铺设于触摸按键背面,顶层地线312围绕触摸按键设置。如此设置,在触摸按键与地线之间能够产生足够的寄生电容,满足上述触摸感测电路300的需求,并且底层地线311与顶层地线312能够屏蔽EMI(Electromagnetic Interference,电磁干扰),增强系统的稳定性。As shown in FIG. 9, the ground network of the touch sensing circuit 300 includes a bottom bottom line 311 and a top bottom line 312. The bottom line 311 is laid on the back of the touch button, and the top ground line 312 is arranged around the touch button. With this configuration, sufficient parasitic capacitance can be generated between the touch button and the ground to meet the requirements of the touch sensing circuit 300, and the bottom ground 311 and the top ground 312 can shield EMI (Electromagnetic Interference) and enhance The stability of the system.
如图10所示,图10示出了充放电电路120的其中一种结构示意图。充放电电路320包括第一二极管D1、第二二极管D2、第三二极管D3、第四二极管D4、第一电阻R1、第二电阻R2以及第一电容C1,第一二极管D1的正极连接于第二二极管D2的负极,第一二极管D1的负极连接于第一电阻R1的一端,第二二极管D2的正极连接于第二电阻R2的一端,第一电阻R1的另一端与第二电阻R2的另一端连接;第三二级管D3的正极连接于第四二极管D4的负极,第三二极管D3的负极连接于第二二极管D2与第二电阻R2之间,第四二极管D4的正极连接于第一二极管D1与第一电阻R1之间;第一电容C1并联在第一电阻R1两端;第 一二极管D1与第二二极管D2的连接节点连接于触摸按键310,第三二极管D3与第四二极管D4的连接节点连接于控制电路330,第一电阻R1与第二电阻R2的连接节点接地。本申请实施例提供的触摸感测电路,该电路设置有触摸按键;充放电电路,连接触摸按键;以及控制电路,包括引脚,引脚连接充放电电路,控制电路被配置为:通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚使充放电电路将触摸按键的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过引脚使充放电电路对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;以及根据当前电压判断触摸按键的感应状态。本申请实施例提供的触摸感测电路仅利用控制电路的时分复用功能实现触摸状态的感测,电路结构简单、成本低廉且能够广泛使用。As shown in FIG. 10, FIG. 10 shows a schematic diagram of one structure of the charging and discharging circuit 120. The charging and discharging circuit 320 includes 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. The anode of the 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, and the anode of the second diode D2 is connected to one end of the second resistor R2 , 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, and the cathode of the third diode D3 is connected to the second diode. Between the pole tube D2 and the second resistor R2, 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 to both ends of the first resistor R1; The connection node of the 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, the first resistor R1 and the second resistor The connection node of R2 is grounded. The touch sensing circuit provided by the embodiment of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit, including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to: Use the pin to switch between the first configuration and the second configuration; among them, in the first configuration, the charge and discharge circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and the parasitic capacitance is charged to the preset voltage. When setting the voltage, the pin is converted to the second configuration; in the second configuration, the charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and according to the current The voltage judges the sensing state of the touch button. The touch sensing circuit provided by the embodiments of the present application only uses the time division multiplexing function of the control circuit to realize the touch state sensing, and the circuit structure is simple, low in cost, and can be widely used.
如图11所示,本申请实施例还提供另一种触摸感测电路400,该触摸感测电路400包括电路板410以及上述的触摸感测电路300,该触摸感测电路300设置于电路板410上。As shown in FIG. 11, the embodiment of the present application also provides another touch sensing circuit 400, the touch sensing circuit 400 includes a circuit board 410 and the above-mentioned touch sensing circuit 300, the touch sensing circuit 300 is disposed on the circuit board 410 on.
本申请实施例提供的触摸感测电路,设置有触摸按键;充放电电路,连接触摸按键;以及控制电路,包括引脚,引脚连接充放电电路,控制电路被配置为:通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚使充放电电路将触摸按键的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过引脚使充放电电路对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;以及根据当前电压判断触摸按键的感应状态。本申请实施例提供的触摸感测电路仅利用控制电路的时分复用功能实现触摸状态的感测,电路结构简单、成本低廉、使用范围广泛且能够防止电磁干扰。The touch sensing circuit provided by the embodiments of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to: The pin is switched between the first configuration and the second configuration; wherein, in the first configuration, the charge and discharge circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and the parasitic capacitance is charged to the preset voltage When the time, the pin is converted to the second configuration; in the second configuration, the charging and discharging circuit is used to discharge the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the current voltage is judged The sensing state of the touch button. The touch sensing circuit provided by the embodiments of the present application only uses the time-division multiplexing function of the control circuit to realize the sensing of the touch state, and has a simple circuit structure, low cost, wide range of use, and can prevent electromagnetic interference.
本申请实施例还提供一种电子设备,该电子设备包括设备主体以及上述的触摸感测电路,其中触摸感测电路设于设备主体内。An embodiment of the present application also provides an electronic device, which includes a device main body and the above-mentioned touch sensing circuit, wherein the touch sensing circuit is provided in the device main body.
本实施例中,电子设备可以是但不限于是投影仪、微投、智能电视、智能手机、平板电脑、电纸书阅读器以及其他智能家电。In this embodiment, the electronic device may be, but is not limited to, a projector, a micro-projector, a smart TV, a smart phone, a tablet computer, an electronic paper book reader, and other smart home appliances.
本申请实施例提供的电子设备,设置有触摸按键;充放电电路,连接触摸按键;以及控制电路,包括引脚,引脚连接充放电电路,控制电路被配置为:通过时分复用将引脚在第一配置以及第二配置之间转换;其中,在第一配置下,通过引脚使充放电电路将触摸按键的寄生电容充电至预设电压,并在寄生电容充电至预设电压时,将引脚转换为第二配置;在第二配置下,通过引脚使充放电电路对寄生电容进行放电,并在预设时间到达时,测量寄生电容的当前电压;以及根据当前电压判断触摸按键的感应状态。本申请实施例提供的电子设备的触摸感测电路仅利用控制电路的时分复用功能实现触摸状态的感测,电路结构简单、成本低廉、使用范围广泛且能够防止电磁干扰。The electronic device provided by the embodiment of the present application is provided with a touch button; a charging and discharging circuit connected to the touch button; and a control circuit, including pins, which are connected to the charging and discharging circuit, and the control circuit is configured to: Switch between the first configuration and the second configuration; wherein, in the first configuration, the charging and discharging circuit charges the parasitic capacitance of the touch button to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, Convert the pin to the second configuration; in the second configuration, the charging and discharging circuit discharges the parasitic capacitance through the pin, and when the preset time is reached, the current voltage of the parasitic capacitance is measured; and the touch button is judged according to the current voltage The sensing state. The touch sensing circuit of the electronic device provided by the embodiments of the present application only uses the time-division multiplexing function of the control circuit to realize the touch state sensing. The circuit structure is simple, the cost is low, the use range is wide, and electromagnetic interference can be prevented.
以上,仅是本申请的较佳实施例而已,并非对本申请作任何形式上的限制,虽然本申请已以较佳实施例揭示如上,然而并非用以限定本申请,任何本领域技术人员,在不脱离本申请技术方案范围内,当可利用上述揭示的技术内容做出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本申请技术方案内容,依据本申请的技术实质对以上实施例所作的任何简介修改、等同变化与修饰,均仍属于本申请技术方案的范围内。The above are only the preferred embodiments of the application, and do not limit the application in any form. Although the application has been disclosed as above in the preferred embodiments, it is not intended to limit the application. Anyone skilled in the art, Without departing from the scope of the technical solution of the present application, when the technical content disclosed above can be used to make slight changes or modification into equivalent embodiments with equivalent changes, provided that the content of the technical solution of the present application is not deviated from the technical content of the present application, the technical essence of the present application Any introduction modifications, equivalent changes and modifications made in the above embodiments still fall within the scope of the technical solution of the present application.

Claims (10)

  1. 一种触摸感测方法,应用于控制单元,所述控制单元通过引脚连接触摸按键,其特征在于,包括:A touch sensing method, applied to a control unit, the control unit is connected to a touch button through a pin, and is characterized in that it includes:
    通过时分复用将所述引脚在第一配置以及第二配置之间转换;Switching the pin between the first configuration and the second configuration through time division multiplexing;
    其中,在所述第一配置下,通过所述引脚将所述触摸按键与接地网络形成的寄生电容充电至预设电压,并在所述寄生电容充电至预设电压时,将所述引脚转换为所述第二配置;Wherein, in the first configuration, the parasitic capacitance formed by the touch button and the ground network is charged to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the lead The feet are converted to the second configuration;
    在所述第二配置下,通过所述引脚对所述寄生电容进行放电,并在预设时间到达时,测量所述寄生电容的当前电压;以及In the second configuration, discharge the parasitic capacitance through the pin, and measure the current voltage of the parasitic capacitance when a preset time is reached; and
    根据所述当前电压判断所述触摸按键的感应状态。The sensing state of the touch button is determined according to the current voltage.
  2. 如权利要求1所述的触摸感测方法,其特征在于,所述根据当前电压判断所述触摸按键的感应状态,包括:5. The touch sensing method of claim 1, wherein the judging the sensing state of the touch button according to the current voltage comprises:
    计算所述当前电压与基准电压的差值,所述基准电压为当所述触摸按键在未触摸状态时,在所述第二配置下的所述当前电压的基准测量值;以及Calculating the difference between the current voltage and a reference voltage, where the reference voltage is a reference measurement value of the current voltage in the second configuration when the touch button is in an untouched state; and
    将所述差值与预设阈值比较,并根据比较结果判断所述触摸按键的感应状态。The difference value is compared with a preset threshold value, and the sensing state of the touch button is judged according to the comparison result.
  3. 如权利要求2所述的触摸感测方法,其特征在于,所述计算所述当前电压与所述基准电压的差值之前,还包括:3. The touch sensing method of claim 2, wherein before calculating the difference between the current voltage and the reference voltage, the method further comprises:
    对所述当前电压进行滤波;以及Filtering the current voltage; and
    对滤波后的所述当前电压进行校准。Calibrate the filtered current voltage.
  4. 如权利要求3所述的触摸感测方法,其特征在于,所述对所述当前电压进行滤波,包括:The touch sensing method of claim 3, wherein the filtering the current voltage comprises:
    通过平均值法、中位数法、递推平均值法、递推中位数法以及卡尔曼滤波法中的任一种或多种算法对所述当前电压进行滤波。The current voltage is filtered by any one or more of the average method, the median method, the recursive average method, the recursive median method, and the Kalman filter method.
  5. 如权利要求3所述的触摸感测方法,其特征在于,所述对滤波后的所述当前电压进行校准,包括:8. The touch sensing method of claim 3, wherein the calibrating the filtered current voltage comprises:
    通过平均值法、中位数法、递推平均值法、递推中位数法以及卡尔曼滤波法中的任一种或多种算法对所述基准电压进行滤波;Filtering the reference voltage by any one or more of an average value method, a median method, a recursive average method, a recursive median method, and a Kalman filter method;
    对滤波后的所述基准电压进行多次测量试验,并获得多次测量试验的平均值以及标准差;以及Perform multiple measurement tests on the filtered reference voltage, and obtain the average value and standard deviation of the multiple measurement tests; and
    通过所述基准电压的平均值以及标准差对所述当前电压进行归一化。The current voltage is normalized by the average value and standard deviation of the reference voltage.
  6. 如权利要求5所述的触摸感测方法,其特征在于,所述对滤波后的所述基准电压进行多次测量试验,并获得多次测量试验的平均值以及标准差之后,还包括:7. The touch sensing method of claim 5, wherein after performing multiple measurement experiments on the filtered reference voltage and obtaining the average value and standard deviation of the multiple measurement experiments, the method further comprises:
    对所述触摸按键进行多次触摸试验,并通过所述基准电压的平均值以及标准差对每次触摸试验的电压测量值进行归一化;Performing multiple touch tests on the touch button, and normalizing the voltage measurement value of each touch test by the average value and standard deviation of the reference voltage;
    计算归一化后的多个电压测量值的平均值与标准差;以及Calculate the average value and standard deviation of multiple voltage measurements after normalization; and
    根据多个电压测量值的平均值与标准差,确定所述预设阈值。The preset threshold value is determined according to the average value and standard deviation of a plurality of voltage measurement values.
  7. 一种触摸感测电路,其特征在于,包括:A touch sensing circuit, characterized in that it comprises:
    触摸按键,所述触摸按键周围设置接地网络,以使所述触摸按键与所述接地网络之间产生寄生电容;A touch button, a grounding network is arranged around the touch button, so that a parasitic capacitance is generated between the touch button and the grounding network;
    充放电电路,连接所述触摸按键;以及A charging and discharging circuit, connected to the touch button; and
    控制电路,包括引脚,所述引脚连接所述充放电电路,所述控制电路被配置为:The control circuit includes a pin connected to the charging and discharging circuit, and the control circuit is configured to:
    通过时分复用将所述引脚在第一配置以及第二配置之间转换;Switching the pin between the first configuration and the second configuration through time division multiplexing;
    其中,在所述第一配置下,通过所述引脚使所述充放电电路将所述触摸按键的寄生电容充电至预设电压,并在所述寄生电容充电至预设电压时,将所述引脚转换为所述第二配置;Wherein, in the first configuration, the charging and discharging circuit is used to charge the parasitic capacitance of the touch button to a preset voltage through the pin, and when the parasitic capacitance is charged to the preset voltage, the charge and discharge circuit is charged to the preset voltage. The pin is converted to the second configuration;
    在所述第二配置下,通过所述引脚使所述充放电电路对所述寄生电容进行放电,并在预设时间到达时,测量所述寄生电容的当前电压;以及In the second configuration, the charging and discharging circuit is used to discharge the parasitic capacitance through the pin, and when a preset time is reached, the current voltage of the parasitic capacitance is measured; and
    根据所述当前电压判断所述触摸按键的感应状态。The sensing state of the touch button is determined according to the current voltage.
  8. 如权利要求7所述的触摸感测电路,其特征在于,所述接地网络包括底层地线以及顶层地线,所述顶层地线围绕所述触摸按键设置。8. The touch sensing circuit of claim 7, wherein the ground network comprises a bottom ground wire and a top ground wire, and the top ground wire is arranged around the touch button.
  9. 如权利要求7所述的触摸感测电路,其特征在于,所述充放电电路包括第一二极管、第二二极管、第三二极管、第四二极管、第一电阻、第二电阻以及第一电容,所述第一二极管的正极连接于所述第二二极管的负极,所述第一二极管的负极连接于所述第一电阻的一端,所述第二二极管的正极连接于所述第二电阻的一端,所述第一电阻的另一端与所述第二电阻的另一端连接;所述第三二级管的正极连接于所述第四二极管的负极,所述第三二极管的负极连接于所述第二二极管与所述第二电阻之间,所述第四二极管的正极连接于所述第一二极管与所述第一电阻之间;所述第一电容并联在所述第一电阻两端;所述第一二极管与所述第二二极管的连接节点连接于所述触摸按键,所述第三二极管与所述第四二极管的连接节点连接于所述控制电路,所述第一电阻与所述第二电阻的连接节点接地。The touch sensing circuit of claim 7, wherein the charging and discharging circuit comprises a first diode, a second diode, a third diode, a fourth diode, a first resistor, A second resistor and a first capacitor, the anode of the first diode is connected to the cathode of the second diode, the cathode of the first diode is connected to one end of the first resistor, the The anode of the second diode is connected to one end of the second resistor, 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 first resistor The cathode of the four diodes, 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 to the first and second resistors. Between the pole tube and the first resistor; the first capacitor is connected in parallel across the first resistor; the connection node of the first diode and the second diode is connected to the touch button A connection node of the third diode and the fourth diode is connected to the control circuit, and a connection node of the first resistor and the second resistor is grounded.
  10. 一种电子设备,其特征在于,包括设备主体以及设于所述设备主体内的如权利要求7至9任一项所述的触摸感测电路。An electronic device, characterized by comprising a device main body and the touch sensing circuit according to any one of claims 7 to 9 provided in the device main body.
PCT/CN2021/086413 2020-04-22 2021-04-12 Touch sensing method and circuit, and electronic device WO2021213194A1 (en)

Applications Claiming Priority (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
CN202010324113.2 2020-04-22

Publications (1)

Publication Number Publication Date
WO2021213194A1 true WO2021213194A1 (en) 2021-10-28

Family

ID=78094121

Family Applications (1)

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

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
CN114221644A (en) * 2022-02-22 2022-03-22 杭州炬源智能科技有限公司 Intelligent water meter with touch keys and detection method of touch keys

Families Citing this family (1)

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

Citations (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
US20130157729A1 (en) * 2011-12-16 2013-06-20 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 charging and transmitting device 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

Patent Citations (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
US20130157729A1 (en) * 2011-12-16 2013-06-20 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 charging and transmitting device 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
CN114221644A (en) * 2022-02-22 2022-03-22 杭州炬源智能科技有限公司 Intelligent water meter with touch keys and detection method of touch keys
CN114221644B (en) * 2022-02-22 2023-08-29 杭州炬源智能科技有限公司 Intelligent water meter with touch keys and detection method of touch keys

Also Published As

Publication number Publication date
CN113541668A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN105531654B (en) Injection touch noise analysis
US9495038B2 (en) Detection of a conductive object during an initialization process of a touch-sensing device
WO2021213194A1 (en) Touch sensing method and circuit, and electronic device
US9684418B1 (en) Self and mutual capacitance measurement in a touch screen
US9043183B1 (en) Hard press rejection
KR101798985B1 (en) Fingerprint sensing system and method comprising a refernece sensing element
US7205776B2 (en) Capacitance measuring apparatus and method, and program
US9430103B2 (en) Method and device for sensing control point on capacitive-type panel
US20080047764A1 (en) Temperature compensation method for capacitive sensors
US20090102813A1 (en) On-screen input image display system
TW202029655A (en) Capacitive touch detection device with self-calibration function
US8212159B2 (en) Capacitive touchpad method using MCU GPIO and signal processing
US20090045821A1 (en) Capacitive sensor with alternating current power immunity
WO2019084832A1 (en) Fingerprint recognition circuit, fingerprint sensor and mobile terminal
CN108777574A (en) A kind of capacitance touch button circuit
CN114355056A (en) Capacitance measuring circuit, capacitance measuring system, touch device and electronic equipment
CN1963738A (en) Method and apparatus for preventing mistriggering of capacitance type key-press
US8085252B1 (en) Method and apparatus to determine direction of motion in a sensor array of a touch sensing device
KR102248984B1 (en) High sensitivity touch sensor
US20090014309A1 (en) Initializing a capacitive sensing switch for a wireless device
CN116203411A (en) Touch key capacitance detection method and system applied to MCU
TWI574193B (en) Touch sensing device
TWI474245B (en) Touch control device, sensing circuit and sensing method thereof
CN113949373A (en) Contact detection circuit using different currents for charging and discharging and operation method thereof
CN208723872U (en) A kind of capacitance touch button circuit

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: 21792741

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21792741

Country of ref document: EP

Kind code of ref document: A1