Touch sensing method, circuit, and electronic device
By using time-division multiplexing technology in the control unit, the charging and discharging of parasitic capacitance is used to determine the sensing state of the touch button, which solves the problem of high cost of traditional capacitive touch buttons and achieves lower cost and higher precision touch detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- APPOTRONICS CORP LTD
- Filing Date
- 2020-04-22
- Publication Date
- 2026-05-05
AI Technical Summary
Traditional capacitive touch button detection requires the use of a dedicated capacitance detection IC chip, which is costly and has a complex operating principle.
The time-division multiplexing technology is used to switch between the first and second configurations by the pins of the control unit. The charging and discharging of parasitic capacitance is used to determine the sensing state of the touch button, thus avoiding dependence on a dedicated capacitor detection IC chip.
This reduced hardware costs and improved the accuracy of measurement data and system stability through filtering and calibration.
Smart Images

Figure CN113541668B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of touch sensing, specifically to a touch sensing method, circuit, and electronic device. Background Technology
[0002] Touch buttons are widely used in smart home appliances due to their small size, dust resistance, and attractive appearance. Common touch buttons include piezoelectric film buttons, resistive touch buttons, and capacitive touch buttons. Capacitive touch buttons typically use conductive electrodes of a specific shape. When a finger touches or approaches the electrode, the distributed capacitance of the human body causes a change in the electrode's capacitance. The chip detects this change in capacitance to determine whether the button has been pressed.
[0003] However, traditional capacitive touch button detection requires the use of dedicated capacitance detection IC (Integrated Circuit) chips, which are complex in principle and expensive. Therefore, those skilled in the art urgently need to improve capacitive touch buttons. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a touch sensing method, circuit, and electronic device to solve the aforementioned technical problems.
[0005] The embodiments of this application are implemented using the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a touch sensing method applied to a control unit, wherein the control unit is connected to a touch button via a pin. The method includes: switching the pin between a first configuration and a second configuration via time-division multiplexing; wherein, in the first configuration, the pin charges a parasitic capacitance formed by the touch button and a ground network to a preset voltage via the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is switched to the second configuration; in the second configuration, the pin discharges the parasitic capacitance, and when a preset time is reached, the current voltage of the parasitic capacitance is measured; and
[0007] The touch button's sensing status is determined based on the current voltage.
[0008] In some implementations, determining the sensing state of a touch button based on the current voltage includes calculating the difference between the current voltage and a reference voltage, where the reference voltage is a reference measurement of the current voltage under a second configuration when the touch button is in an untouched state; and comparing the difference with a preset threshold, and determining the sensing state of the touch button based on the comparison result.
[0009] In some implementations, the process includes filtering the current voltage and calibrating the filtered current voltage before calculating the difference between the current voltage and the reference voltage.
[0010] In some implementations, filtering the current voltage includes filtering the current voltage using one or more algorithms selected from the average method, median method, recursive average method, recursive median method, and Kalman filtering.
[0011] In some implementations, calibrating the filtered current voltage includes filtering the reference voltage using one or more algorithms selected from the average method, median method, recursive average method, recursive median method, and Kalman filtering; performing multiple measurements on the filtered reference voltage and obtaining the average value and standard deviation of the multiple measurements; and normalizing the current voltage using the average value and standard deviation of the reference voltage.
[0012] In some implementations, after performing multiple measurement tests on the filtered reference voltage and obtaining the average value and standard deviation of the multiple measurement tests, the method further includes performing multiple touch tests on the touch button, and normalizing the voltage measurement value of each touch test using the average value and standard deviation of the reference voltage; calculating the average value and standard deviation of the normalized multiple voltage measurement values; and determining a preset threshold based on the average value and standard deviation of the multiple voltage measurement values.
[0013] Secondly, embodiments of this application also provide a touch sensing circuit, which includes a touch button, a grounding network surrounding the touch button to generate a parasitic capacitance between the touch button and the grounding network; a charging and discharging circuit connected to the touch button; and a control circuit including a pin connected to the charging and discharging circuit. The control circuit is configured to: switch the pin between a first configuration and a second configuration via time-division multiplexing; wherein, in the first configuration, the charging and discharging circuit charges the parasitic capacitance of the touch button to a preset voltage via the pin, and switches the pin to the second configuration when the parasitic capacitance is charged to the preset voltage; in the second configuration, the charging and discharging circuit discharges the parasitic capacitance via the pin, and measures the current voltage of the parasitic capacitance when a preset time is reached; and determines the sensing state of the touch button based on the current voltage.
[0014] In some implementations, the grounding network includes a bottom ground wire and a top ground wire, the top ground wire being arranged around the touch button.
[0015] 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 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 anode of the second diode is connected to one end of the second resistor, and the other end of the first resistor is connected to the other end of the second resistor. The anode of the third diode is connected to the cathode of the fourth diode, the cathode of the third diode is connected between the second diode and the second resistor, and the anode of the fourth diode is connected between the first diode and the first resistor. The first capacitor is connected in parallel across the first resistor. The connection point between the first and second diodes is connected to a touch button, the connection point between the third and fourth diodes is connected to a control circuit, and the connection point between the first and second resistors is grounded.
[0016] Thirdly, embodiments of this application also provide an electronic device, which includes a device body and a touch sensing circuit as described above disposed within the device body.
[0017] The touch sensing method, circuit, and electronic device provided in this application are applied to a control unit. The control unit is connected to a touch button via a pin. The method first uses time-division multiplexing to switch the pin between a first configuration and a second configuration. In the first configuration, the parasitic capacitance of the touch button is charged to a preset voltage via the pin, and when the parasitic capacitance reaches the preset voltage, the pin is switched to the second configuration. In the second configuration, the parasitic capacitance is discharged via the pin, and the current voltage of the parasitic capacitance is measured when a preset time has elapsed. The sensing state of the touch button is then determined based on the current voltage. In the above process, the implementation of this method does not rely on a dedicated capacitance detection IC chip, but utilizes the time-division multiplexing function in the control unit. Therefore, compared with traditional touch detection schemes that require a dedicated capacitance detection IC chip, the touch sensing method provided in this application requires lower hardware costs.
[0018] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating the touch sensing method provided in an embodiment of this application is shown.
[0021] Figure 2 It shows Figure 1 Flowchart of step S110
[0022] Figure 3 A flowchart illustrating another touch sensing method provided in an embodiment of this application is shown.
[0023] Figure 4 It shows Figure 3 A flowchart of step S220.
[0024] Figure 5 A schematic diagram of a sliding window is shown.
[0025] Figure 6 It shows Figure 3 A flowchart of step S230.
[0026] Figure 7 The diagram shows a flowchart illustrating steps S260 to S280 provided in an embodiment of this application.
[0027] Figure 8 A schematic diagram of the structure of the touch sensing circuit provided in an embodiment of this application is shown.
[0028] Figure 9 A schematic diagram of the grounding network of the touch sensing circuit provided in an embodiment of this application is shown.
[0029] Figure 10 It shows Figure 8 A schematic diagram of one type of charging and discharging circuit.
[0030] Figure 11 A schematic diagram of another touch sensing circuit provided in an embodiment of this application is shown. Detailed Implementation
[0031] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0032] Currently, buttons on the market are divided into traditional mechanical buttons and touch buttons. Mechanical buttons are gradually being phased out due to their disadvantages such as easy wear and tear, complex installation, and susceptibility to environmental factors, while touch buttons are increasingly being used in smart home appliances due to their advantages such as small size, good dust resistance, and attractive appearance.
[0033] Common touch buttons are categorized into piezoelectric film touch buttons, resistive touch buttons, and capacitive touch buttons. Capacitive touch buttons typically use conductive electrodes of a specific shape. When a finger touches or approaches the electrode, the distributed capacitance of the human body causes a change in the electrode's capacitance. The chip detects this change in capacitance to determine whether the button has been pressed.
[0034] However, traditional capacitive touch button detection requires the use of dedicated capacitance detection IC (Integrated Circuit) chips, which are complex in principle and expensive. Therefore, those skilled in the art urgently need to improve capacitive touch buttons.
[0035] To address the aforementioned technical problems, the inventors, after extensive research, proposed the touch sensing method, circuit, and electronic device described in this application. The touch sensing method is applied to a control unit, which connects to a touch button via a pin. The method first uses time-division multiplexing to switch the pin between a first configuration and a second configuration. In the first configuration, the pin charges the parasitic capacitance formed by the touch button and the ground network to a preset voltage. When the parasitic capacitance reaches the preset voltage, the pin is switched to the second configuration. In the second configuration, the pin discharges the parasitic capacitance, and the current voltage of the parasitic capacitance is measured when a preset time has elapsed. Finally, the sensing state of the touch button is determined based on the current voltage. In this process, the implementation of this method does not rely on a dedicated capacitance detection IC chip but utilizes the time-division multiplexing function in the control unit. Therefore, compared to traditional touch detection schemes that require a dedicated capacitance detection IC chip, the touch sensing method provided in this application requires lower hardware costs.
[0036] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0037] like Figure 1 As shown, Figure 1 The diagram illustrates a flowchart of a touch sensing method provided in an embodiment of this application. This method can be applied to a control unit, which is connected to a touch button via pins. The control unit is a microprocessor with time-division multiplexing functionality on its pins. In this embodiment, the control unit can be an MCU (Microcontroller Unit), which is connected to the touch button via external pins. The touch sensing method may include the following steps:
[0038] S110: Switches the pin between the first configuration and the second configuration by time-division multiplexing.
[0039] Time-division multiplexing is an inherent function of the control unit. Its basic principle is to control a multiplexer through a configuration register to connect external pins to different internal pins at different times, enabling the external pins to have multiple functions, but only one function can be used at a time. In this embodiment, the time-division multiplexing function of the control unit is used to switch the external pins connected to the touch buttons between a first configuration and a second configuration, thereby enabling the external pins to have two functions and thus saving pin resources of the control unit.
[0040] Furthermore, such as Figure 2 As shown, step S110 may include steps S111 to S112.
[0041] 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 switched to the second configuration.
[0042] In this embodiment, when the control unit pin is multiplexed to the first configuration, the external pin connected to the touch button is connected to the on-chip GPIO (General-purpose input / output) pin. The touch button has a parasitic capacitance to ground. This parasitic capacitance is charged through the GPIO pin until its voltage reaches a preset voltage. Once the voltage of the parasitic capacitance reaches the preset voltage, the external pin is switched to the second configuration, i.e., connected to another on-chip pin.
[0043] Step S112: In the second configuration, the parasitic capacitance is discharged through the pin, and the current voltage of the parasitic capacitance is measured when the preset time is reached.
[0044] In this embodiment, when the pins of the control unit are multiplexed to the second configuration, the external 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 buttons is discharged through the ADC pins, and a timer begins. When the preset time is reached, the current voltage of the parasitic capacitance is measured through the on-chip ADC pins. In this embodiment, the current voltage represents the voltage to which the parasitic capacitance has decreased after discharging from the preset voltage for the preset time. In this embodiment, the preset time can be flexibly designed according to specific operating conditions and requirements, and its typical value can be set between tens of microseconds and hundreds of microseconds.
[0045] Understandably, after the current voltage measurement is completed, the pin will be reused in the first configuration to recharge the parasitic capacitance. Specifically, the pin can be reused in the first configuration only after the voltage of the parasitic capacitance has discharged to zero; alternatively, the pin can be reused in the first configuration even before the voltage of the parasitic capacitance has discharged to zero. In this embodiment, the pin is reused back and forth between the first and second configurations at a certain frequency, which can be freely set.
[0046] S120: Determines the sensing status of the touch button based on the current voltage.
[0047] Because the human body has distributed capacitance, when a finger approaches or touches a touch button, the parasitic capacitance of the touch button changes, thus altering its discharge rate. Consequently, within the same preset time, the voltage discharged by the parasitic capacitance also changes, resulting in a different voltage drop after a preset discharge period. Therefore, by measuring the current voltage of the parasitic capacitance at the preset time, the change in current voltage can be obtained, and this change in current voltage can be used to determine the touch button's sensing state.
[0048] The aforementioned touch sensing method utilizes the time-division multiplexing function of the control unit to detect touch capacitance. It does not rely on traditional dedicated capacitance detection chips, making it widely applicable and significantly reducing the hardware cost of capacitance detection.
[0049] The touch sensing method provided in this application first uses time-division multiplexing to switch the pin between a first configuration and a second configuration. In the first configuration, the parasitic capacitance of the touch button is charged to a preset voltage via the pin, and when the parasitic capacitance reaches the preset voltage, the pin is switched to the second configuration. In the second configuration, the parasitic capacitance is discharged via the pin, and the current voltage of the parasitic capacitance is measured when a preset time has elapsed. Finally, the sensing state of the touch button is determined based on the current voltage. In the above process, this method does not rely on a dedicated capacitance detection IC chip, but utilizes the time-division multiplexing function in the control unit. Therefore, compared to traditional touch detection schemes that require a dedicated capacitance detection IC chip, the touch sensing method provided in this application requires lower hardware costs.
[0050] like Figure 3 As shown, this application also provides another touch sensing method 200, which may include the following steps S210 to S250.
[0051] Step S210: Switch the pin between the first configuration and the second configuration by time division multiplexing.
[0052] The principle of step S210 is the same as that of step 110 above, and will not be repeated here. Step S210 may also include steps S211 and S212, and the principles of steps S211 and S212 are the same as those of steps S111 and S112 above.
[0053] 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 switched to the second configuration.
[0054] Step S212: In the second configuration, the parasitic capacitance is discharged through the pin, and the current voltage of the parasitic capacitance is measured when the preset time is reached.
[0055] In this embodiment, after obtaining the measured value of the current voltage, the following steps can be performed.
[0056] Step S220: Filter the current voltage.
[0057] In this embodiment, filtering the current voltage can reduce system noise and measurement error. The filtering algorithm used in this embodiment can be any of the following: averaging, median, recursive median, and Kalman filtering. In fact, any filtering algorithm that can improve the system signal-to-noise ratio can be used. Below, this embodiment uses the recursive averaging method with m consecutive numbers as an example to explain the filtering of the current voltage. Figure 4 As shown, Figure 4 This is a flowchart illustrating the recursive average filtering method. It includes steps S221 to S222:
[0058] Step S221: Set up a sliding window and calculate the arithmetic mean of a fixed number of measurement data within the sliding window to output a data point.
[0059] like Figure 5 As shown, Figure 5 This is a schematic diagram of a sliding window. V1 to Vn represent the voltage values measured sequentially through the ADC pin. This sliding window can cover m consecutive measured voltage values. In this embodiment, the typical value of m can be 2 to 5. Further, the arithmetic mean of the m consecutive measured voltage values within the sliding window is used as an output data. Assuming m is 3, and the ADC pin continuously measures three voltage values V1 to V3, the arithmetic mean X1 of V1 to V3 is calculated. This arithmetic mean X1 is equivalent to the output result of one measurement.
[0060] Step S222: Cover the new measurement data with the sliding window in turn, and calculate the arithmetic mean of the measurement data in the sliding window in turn, so as to output multiple data in turn.
[0061] like Figure 5 As shown, X1 to Xn represent the sequentially output data, where each output data is the arithmetic average of m consecutive measured voltage values during the sliding window's movement. Specifically, as a new measured voltage value is generated, the sliding window slides forward sequentially, covering the new measured data. Since the number of data values that the sliding window can hold is fixed, new measured data is added to the window while older measured data is removed. For example, when the sliding window covers measured voltage values V1 to V3, a data point X1 is output. As a new measured voltage value V4 is generated, the sliding window slides forward, adding V4 to the window while removing V1. At this point, the sliding window covers measured voltage values V2 to V4 and outputs a data point X2. As new measured voltage values are continuously generated, the sliding window slides forward sequentially, covering the new measured voltage values and outputting data X1 to Xn sequentially. By filtering the current voltage measurement value using this filtering algorithm, the system's stability and the measurement accuracy of the current voltage can be improved.
[0062] Step S230: Calibrate the filtered current voltage.
[0063] In this embodiment, by calibrating the filtered current voltage, the measurement accuracy can be further improved. For example... Figure 6 As shown, Figure 6 The calibration process is illustrated in the diagram, which includes steps S231 to S233.
[0064] Step S231: Filter the reference voltage.
[0065] The reference voltage is a baseline measurement of the current voltage in the second configuration when the touch button is in an untouched state. When the touch button is not touched, the voltage of the touch button after its parasitic capacitance has discharged for a preset period of time in the second configuration is measured using the methods described in steps S211 to S212. This voltage is the reference voltage, which also represents the baseline value of the current voltage when the touch button is not touched. During actual measurement, this reference voltage can be used as a benchmark to determine the touch state of the touch button.
[0066] In this embodiment, the filtering of the reference voltage can also employ the filtering algorithm of this embodiment, namely, any one of the average value method, median method, recursive median method, and Kalman filtering method. Furthermore, any filtering algorithm can be used as long as it improves the system signal-to-noise ratio. In some implementations, the filtering algorithm used for the current voltage in step S220 can be the same as the filtering algorithm used for the reference voltage to ensure the accuracy of the measurement data.
[0067] Step S232: Perform multiple measurement tests on the filtered reference voltage and obtain the average value and standard deviation of the multiple measurement tests.
[0068] In this implementation, multiple measurement tests are performed on the reference voltage. After the filtering described above, N1 reference measurement data are obtained. Then, the average value μ and standard deviation σ of these N1 reference measurement data are calculated. The value of N1 can be flexibly selected according to the application scenario and measurement speed, and its typical value can be between 10 and 10000.
[0069] Step S233: Normalize the current voltage using the average value and standard deviation of the reference voltage.
[0070] In this embodiment, the average value μ and standard deviation μ of N1 benchmark measurement data can be used to normalize the actual measurement data during subsequent actual measurements. Where X represents the measured data of the current voltage during actual measurement.
[0071] Step S240: Calculate the difference between the current voltage and the reference voltage.
[0072] As mentioned earlier, the reference voltage represents the baseline value of the current voltage when the touch button is not touched. Touch detection of the touch button is divided into two stages: the first is the reference measurement stage, in which a reference value is obtained; the second is the actual measurement stage, in which an actual value is obtained. By measuring the change between the actual value and the reference value, it is possible to determine whether the touch button has been touched.
[0073] In this embodiment, the current voltage is the actual measured value. The difference between the current voltage and the reference voltage represents the change between the actual value and the reference value. This change is used to determine whether the touch button has been touched. Specifically, because the human body has distributed capacitance, when the touch button is touched, the distributed capacitance of the human body is essentially connected in parallel with the parasitic capacitance of the touch button, increasing the measured value of the parasitic capacitance. It is worth noting that the distributed capacitance of the human body is typically between 30pF and 50pF, and the parasitic capacitance of the touch button should be designed to be approximately the same. Since the charging and discharging speed of a capacitor is affected by its size, when the measured value of the parasitic capacitance increases, the discharge speed of the parasitic capacitance slows down. Since the preset time is fixed, the voltage of the parasitic capacitance will be higher than the voltage in the reference non-touched state when the preset time is reached, resulting in a larger measured voltage value. Therefore, the difference between the current voltage and the reference voltage can be used to determine whether the touch button has been touched.
[0074] It is worth noting that the distributed capacitance across the parasitic capacitor varies depending on the human body or operating conditions. This results in inconsistent charging and discharging rates of the parasitic capacitor under different operating conditions, which generally has an adverse effect on system software control. However, in this embodiment, since the parasitic capacitor is charged to a preset voltage during the charging phase and the voltage value is measured after a preset discharge time during the discharging phase, even if the charging and discharging rates of the parasitic capacitor may be inconsistent under each operating condition, it will not affect the measurement results, nor will it affect the system software control required by this application.
[0075] Step S250: Compare the difference with a preset threshold and determine the sensing state of the touch button based on the comparison result.
[0076] The preset threshold is the touch activation threshold for the touch button. In this embodiment, the difference is compared with the preset threshold. If the difference is greater than the preset threshold, it means that the change between the current actual measurement value and the benchmark measurement value exceeds the touch activation window, and the touch button has been effectively touched. The change within the preset threshold is the allowable error range, and the error within this range may be caused by factors such as measurement and environment.
[0077] like Figure 7 As shown, in some embodiments, after step S233, the following steps S260 to S280 may also be included.
[0078] Step S260: Perform multiple touch tests on the touch button, and normalize the voltage measurement of each touch test by using the average value and standard deviation of the reference voltage.
[0079] In this embodiment, after obtaining the average value μ and standard deviation μ of the benchmark measurement data, touch tests can be performed on the touch button. After multiple touch tests, N2 test touch data can be obtained by measuring the voltage of the parasitic capacitance. Each test touch data is then normalized. X1 represents the experimental touch data. The value of N2 can be flexibly selected according to the usage scenario and measurement speed, and its typical value can be between 10 and 10000.
[0080] Step S270: Calculate the average and standard deviation of the normalized voltage measurements.
[0081] In this embodiment, the multiple measured values are the aforementioned test touch data. The average value μ' and standard deviation σ' of the N2 test touch data after normalization are calculated.
[0082] Step S280: Determine the preset threshold based on the average value and standard deviation of multiple voltage measurements.
[0083] 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 during the actual measurement stage. The smaller the standard deviation σ', the higher the stability of the actual measurement data. The higher the stability of the measurement data, the larger the value of the preset threshold can be set.
[0084] Furthermore, preset thresholds can affect the sensitivity of touch buttons and the probability of accidental touches. A smaller preset threshold results in higher touch sensitivity but also a greater chance of accidental touches; conversely, a larger preset threshold leads to greater touch stability. Typical preset threshold values range from 2 to μ'-2σ'. The range of preset threshold values can also be used to assess device stability; that is, a larger value of μ'-2σ'-2 indicates better device stability.
[0085] The touch sensing method provided in this embodiment first switches the pin between a first configuration and a second configuration using time-division multiplexing. In the first configuration, the pin charges the parasitic capacitance formed by the touch button and the ground network to a preset voltage. When the parasitic capacitance reaches the preset voltage, the pin is switched to the second configuration. In the second configuration, the pin discharges the parasitic capacitance, and the current voltage of the parasitic capacitance is measured when a preset time has elapsed. Finally, the sensing state of the touch button is determined based on the current voltage. In this process, the method does not rely on a dedicated capacitance detection IC chip but utilizes the time-division multiplexing function in the control unit. Therefore, compared to traditional touch detection schemes that require a dedicated capacitance detection IC chip, the touch sensing method provided in this application requires lower hardware costs. Furthermore, by filtering and calibrating the measured voltage, the accuracy of the measurement data is improved.
[0086] like Figure 8As shown, this application also provides a touch sensing circuit 300, which includes a touch button 310, a charging / discharging circuit 320, and a control circuit 330. A grounding network is disposed 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 charging / discharging circuit 320. The control circuit 330 includes a pin TK, which is connected to the charging / discharging circuit 320. The control circuit 330 is configured to switch the pin TK between a first configuration and a second configuration via time-division multiplexing. In the first configuration, the charging / discharging circuit 320 charges the parasitic capacitance C0 of the touch button 310 to a preset voltage via the pin TK, and switches the pin TK to the second configuration when the parasitic capacitance C0 is charged to the preset voltage. In the second configuration, the charging / discharging circuit 320 discharges the parasitic capacitance C0 via the pin TK, and measures the current voltage of the parasitic capacitance C0 when a preset time is reached. The sensing state of the touch button 310 is determined based on the current voltage.
[0087] The touch button 310 can be a conductive electrode of any shape, and there is a parasitic capacitance C0 between the conductive electrode and ground. The control circuit 130 is a microcontroller unit (MCU). Time-division multiplexing is a fundamental function of the MCU. Its basic principle is to control a multiplexer through a configuration register to connect an external pin to different internal pins at different times, so that the external pin has multiple functions, but only one function can be used at any given 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 a first configuration and a second configuration. This pin TK is an external pin, thus enabling the external pin to have two functions, thereby saving MCU pin resources.
[0088] When multiplexed to the first configuration, the control circuit 330 connects pin TK to the on-chip GPIO (General-purpose input / output) pin. A parasitic capacitance C0 exists between the touch button 310 and ground. The GPIO pin charges the parasitic capacitance C0 of the touch button 310 through a charging / discharging circuit until the voltage of the parasitic capacitance C0 reaches a preset voltage. Once the voltage of the parasitic capacitance C0 reaches the preset voltage, the TK pin is switched to the second configuration, that is, the TK pin is connected to another on-chip pin.
[0089] When reused in the second configuration, the control circuit connects 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 / discharging circuit 320, and a timer starts simultaneously. 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 changes, thus altering the discharge rate of the parasitic capacitance C0. Therefore, within the same preset time, the voltage discharged by the parasitic capacitance C0 also changes accordingly, resulting in a change in the voltage dropped after a preset discharge period from the preset voltage. Therefore, by measuring the current voltage of the parasitic capacitance C0 when the preset time is reached, the change in the current voltage can be obtained, and the sensing state of the touch button 310 can be determined based on this change in voltage.
[0090] 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.
[0091] It is worth mentioning that, in this embodiment, since a grounding network is provided around the touch button 310, a parasitic capacitance C0 is generated between the touch button 310 and the grounding network. This ensures that the touch sensing circuit 300 will not affect the overall measurement results even if the charging and discharging speed of the parasitic capacitance may be inconsistent under each operating condition, thereby avoiding affecting the system software control required by this application.
[0092] like Figure 9 As shown, the grounding network of the touch sensing circuit 300 includes a bottom ground line 311 and a top ground line 312. The bottom ground line 311 is laid on the back of the touch button, and the top ground line 312 is arranged around the touch button. This arrangement can generate sufficient parasitic capacitance between the touch button and the ground line to meet the requirements of the touch sensing circuit 300. Furthermore, the bottom ground line 311 and the top ground line 312 can shield EMI (Electromagnetic Interference), enhancing the stability of the system.
[0093] like Figure 10 As shown, Figure 10A schematic diagram of one possible structure of the charging / discharging circuit 120 is shown. The charging / 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 first diode D1 is connected to the cathode of the second diode D2, and the cathode of the first diode D1 is connected to one end of the first resistor R1. The anode of the second diode D2 is connected to one end of the second resistor R2, and the other end of the first resistor R1 is connected to the other end of the second resistor R2. The anode of the third diode D3 is connected to the cathode of the fourth diode D4, and the cathode of the third diode D3 is connected between the second diode 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 across the first resistor R1. The connection point between the first diode D1 and the second diode D2 is connected to the touch button 310, the connection point between the third diode D3 and the fourth diode D4 is connected to the control circuit 330, and the connection point between the first resistor R1 and the second resistor R2 is grounded. The touch sensing circuit provided in this application includes a touch button, a charging / discharging circuit connected to the touch button, and a control circuit including pins connected to the charging / discharging circuit. The control circuit is configured to switch the pins between a first configuration and a second configuration via time-division multiplexing. In the first configuration, the charging / discharging circuit charges the parasitic capacitance of the touch button to a preset voltage via the pins, and switches the pins to the second configuration when the parasitic capacitance reaches the preset voltage. In the second configuration, the charging / discharging circuit discharges the parasitic capacitance via the pins, and measures the current voltage of the parasitic capacitance when a preset time is reached. The touch sensing circuit determines the sensing state of the touch button based on the current voltage. The touch sensing circuit provided in this application utilizes only the time-division multiplexing function of the control circuit to sense the touch state. The circuit structure is simple, low-cost, and widely applicable.
[0094] like Figure 11 As shown, this application embodiment also provides another touch sensing circuit 400, which includes a circuit board 410 and the aforementioned touch sensing circuit 300, which is disposed on the circuit board 410.
[0095] The touch sensing circuit provided in this application embodiment includes a touch button; a charging / discharging circuit connected to the touch button; and a control circuit including pins connected to the charging / discharging circuit. The control circuit is configured to: switch the pins between a first configuration and a second configuration via time-division multiplexing; wherein, in the first configuration, the charging / discharging circuit charges the parasitic capacitance of the touch button to a preset voltage via the pins, and switches the pins to the second configuration when the parasitic capacitance is charged to the preset voltage; in the second configuration, the charging / discharging circuit discharges the parasitic capacitance via the pins, and measures the current voltage of the parasitic capacitance when a preset time is reached; and determines the sensing state of the touch button based on the current voltage. The touch sensing circuit provided in this application embodiment only utilizes the time-division multiplexing function of the control circuit to realize the sensing of the touch state. The circuit structure is simple, low-cost, widely applicable, and can prevent electromagnetic interference.
[0096] This application also provides an electronic device, which includes a device body and the aforementioned touch sensing circuit, wherein the touch sensing circuit is disposed within the device body.
[0097] In this embodiment, the electronic device may be, but is not limited to, a projector, a micro-projector, a smart TV, a smartphone, a tablet computer, an e-reader, and other smart home appliances.
[0098] The electronic device provided in this application embodiment includes a touch button; a charging / discharging circuit connected to the touch button; and a control circuit including pins connected to the charging / discharging circuit. The control circuit is configured to: switch the pins between a first configuration and a second configuration via time-division multiplexing; wherein, in the first configuration, the charging / discharging circuit charges the parasitic capacitance of the touch button to a preset voltage via the pins, and switches the pins to the second configuration when the parasitic capacitance is charged to the preset voltage; in the second configuration, the charging / discharging circuit discharges the parasitic capacitance via the pins, and measures the current voltage of the parasitic capacitance when a preset time is reached; and determines the sensing state of the touch button based on the current voltage. The touch sensing circuit of the electronic device provided in this application embodiment only utilizes the time-division multiplexing function of the control circuit to realize the sensing of the touch state. The circuit structure is simple, low-cost, widely applicable, and can prevent electromagnetic interference.
[0099] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A touch sensing method applied to a control unit, wherein the control unit is connected to a touch button via a pin, characterized in that, include: The pin is switched between a first configuration and a second configuration by time-division multiplexing; 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 switched to the second configuration. In the second configuration, the parasitic capacitance is discharged through the pin, and the current voltage of the parasitic capacitance is measured when a preset time is reached; the current voltage represents the voltage to which the parasitic capacitance has dropped after discharging from the preset voltage for a preset time. The current voltage is filtered; and the filtered current voltage is calibrated. Calculate the difference between the current voltage and the reference voltage, where the reference voltage is a reference measurement of the current voltage under the second configuration when the touch button is in an untouched state; and The difference is compared with a preset threshold, and the sensing state of the touch button is determined based on the comparison result. The preset threshold is obtained by the average value and standard deviation of multiple voltage measurements obtained by performing multiple touch tests on the touch button.
2. The touch sensing method as described in claim 1, characterized in that, The filtering of the current voltage includes: The current voltage is filtered using one or more algorithms selected from the following methods: average method, median method, recursive average method, recursive median method, and Kalman filter.
3. The touch sensing method as described in claim 1, characterized in that, The calibration of the filtered current voltage includes: The reference voltage is filtered using one or more algorithms selected from the average value method, median method, recursive average value method, recursive median method, and Kalman filtering method. The filtered reference voltage was subjected to multiple measurement tests, and the average value and standard deviation of the multiple measurements were obtained; and The current voltage is normalized using the average value and standard deviation of the reference voltage.
4. The touch sensing method as described in claim 3, characterized in that, After performing multiple measurement tests on the filtered reference voltage and obtaining the average value and standard deviation of the multiple measurement tests, the method further includes: Multiple touch tests were performed on the touch button, and the voltage measurement value of each touch test was normalized by the average value and standard deviation of the reference voltage. Calculate the mean and standard deviation of the normalized voltage measurements; and The preset threshold is determined based on the average and standard deviation of multiple voltage measurements.
5. A touch sensing circuit, characterized in that, include: A touch button is provided, and a grounding network is provided around the touch button to generate parasitic capacitance between the touch button and the grounding network; The charging and discharging circuit is connected to the touch button; as well as A control circuit, including pins connected to the charging / discharging circuit, is configured to: The pin is switched between a first configuration and a second configuration by time-division multiplexing; In the first configuration, the charging and discharging circuit charges the parasitic capacitance of the touch button to a preset voltage via the pin, and when the parasitic capacitance is charged to the preset voltage, the pin is switched to the second configuration. In the second configuration, the charging and discharging circuit discharges the parasitic capacitor via the pin, and measures the current voltage of the parasitic capacitor when a preset time is reached; the current voltage represents the voltage to which the parasitic capacitor drops after discharging from a preset voltage for a preset time; the current voltage is filtered; and the filtered current voltage is calibrated. Calculate the difference between the current voltage and the reference voltage, where the reference voltage is a reference measurement of the current voltage under the second configuration when the touch button is in an untouched state; compare the difference with a preset threshold, and determine the sensing state of the touch button based on the comparison result, where the preset threshold is the average and standard deviation of multiple voltage measurements obtained from multiple touch tests on the touch button.
6. The touch sensing circuit as described in claim 5, characterized in that, The grounding network includes a bottom ground wire and a top ground wire, with the top ground wire arranged around the touch button.
7. The touch sensing circuit as described in claim 5, characterized in that, 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 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 anode of the second diode is connected to one end of the second resistor, and the other end of the first resistor is connected to the other end of the second resistor. The anode of the third diode is connected to the cathode of the fourth diode, the cathode of the third diode is connected between the second diode and the second resistor, and the anode of the fourth diode is connected between the first diode and the first resistor. The first capacitor is connected in parallel across the first resistor. The connection point between the first diode and the second diode is connected to the touch button, the connection point between the third diode and the fourth diode is connected to the control circuit, and the connection point between the first resistor and the second resistor is grounded.
8. An electronic device, characterized in that, It includes a device body and a touch sensing circuit as described in any one of claims 5 to 7 disposed within the device body.
Citation Information
Patent Citations
Method and device for sensing electric discharge of circuit, touch panel and electronic device
CN101676842A
Touch-control key detection and LED control circuit
CN201878122U
Keying circuit and tame electric installation
CN205566268U
Apparatus for sensing a touch
US20120256868A1