Abstract:
A method for determining a capacitance and/or a change in capacitance of a capacitive sensor element (C 2 ) comprises the steps of: a) discharging an average value capacitor (C 3 ), and either b1) discharging the capacitive sensor element and c1) charging an operating capacitor (C 1 ) to a charging voltage (VDD), or b2) discharging the operating capacitor and c2) charging the capacitive sensor element to the charging voltage, d) connecting the operating capacitor to the capacitive sensor element, e) connecting the operating capacitor to the average value capacitor, and f) evaluating a voltage established across the operating capacitor or across the average value capacitor in order to determine the capacitance and/or the change in capacitance.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
     This application claims priority to German patent application DE 10 2010 042 477.3, filed on Oct. 14, 2010, the contents of which are incorporated by reference for all that it teaches. 
     FIELD OF APPLICATION 
     The invention relates to a method and an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element. 
     BACKGROUND 
     U.S. patent application 2010/0181180 A1 shows a method and an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element, in which an internal capacitor of a microprocessor is used to measure the capacitance. In this case, the internal capacitor is first of all charged and the capacitive sensor element is discharged. The internal capacitor and the capacitive sensor element are then connected to one another, the voltage established across the internal capacitor being evaluated in order to determine the capacitance and/or the change in capacitance. Alternatively, the internal capacitor is first of all discharged and the capacitive sensor element is charged. 
     SUMMARY 
     One embodiment of the invention is based on the problem of providing a method and an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element, which method and apparatus make it possible to reliably determine the capacitance and/or the change in capacitance. 
     The invention addresses this problem in one embodiment by means of a method as claimed herein. The claims relate to preferred embodiments, the wording of which claims is hereby incorporated by reference in the content of the description. 
     The method for determining a capacitance and/or a change in capacitance of a capacitive sensor element in one embodiment, that is to say a capacitor with an unknown capacitance, the capacitance of which changes in a touch-dependent manner for example, comprises the steps of: a) discharging an average value capacitor with a known or unknown capacitance, and either b1) discharging the capacitive sensor element and c1) charging an operating capacitor with a known or unknown capacitance to a known or unknown charging voltage which is, however, substantially constant over time, or b2) discharging the operating capacitor and c2) charging the capacitive sensor element to the charging voltage, d) connecting the operating capacitor to the capacitive sensor element, e) connecting the operating capacitor to the average value capacitor, in which case the operating capacitor is disconnected from the capacitive sensor element beforehand and the operating capacitor is then disconnected from the average value capacitor before carrying out step b1) or b2) again, and f) evaluating a voltage established across the operating capacitor or across the average value capacitor in order to determine the capacitance and/or the change in capacitance. 
     The steps described above preferably form an individual measuring cycle, the measuring cycle preferably being cyclically repeated in order to determine further measured values. Said steps are preferably carried out in succession in the stated order. When the charging voltage is unknown and when the capacitance of the reference and/or average value capacitor is unknown, the voltage established across the operating capacitor or across the average value capacitor can be monitored for a change, for example, by comparing the currently measured voltage with a voltage from a previous measuring cycle or a plurality of previous measuring cycles. When the voltage is known and when the capacitances are known, the capacitance of the sensor element can be determined, for example computationally, using the voltage which is established. 
     In one embodiment, before step f), steps b1) and c1) or b2) and c2) to e) are repeated a predefined number of times, in particular a number of times which is constant over time, for example five to fifteen times, the voltage established across the operating capacitor or across the average value capacitor being evaluated after the repetition in order to determine the capacitance and/or the change in capacitance. Alternatively, steps b1) and c1) or b2) and c2) to f) are repeated until a predefined threshold voltage is established across the operating capacitor or across the average value capacitor in step f) when evaluating the voltage established across the operating capacitor or across the average value capacitor, a number of the repetitions additionally being evaluated in order to determine the capacitance and/or the change in capacitance. The capacitance and/or the change in capacitance can be determined from the required number of repetitions in conjunction with the predefined voltage. 
     In one embodiment, the charging voltage is known. The capacitance of the operating capacitor and/or the capacitance of the average value capacitor is/are preferably known. 
     In one embodiment, the method is carried out using a microprocessor, the microprocessor comprising: an internal capacitor which forms the operating capacitor, an A/D converter which is connected to the internal capacitor, a first port, a second port, and a third port. Each of the ports can be configured as an input or as an output, the capacitive sensor element being connected to the second port, and the average value capacitor being connected to the third port, and a multiplexer which is connected, on the input side, to the ports and is connected, on the output side, to the internal capacitor and connects one of the ports to the internal capacitor. The method also comprises the following steps which are carried out in succession: g) configuring the third port as an output and outputting a low signal at the third port, h) configuring the third port as an input, i) configuring the first port as an output and outputting a high signal at the first port, j) configuring the second port as an output and outputting a low signal at the second port, k) configuring the second port as an input, l) setting the multiplexer in such a manner that the internal capacitor is connected to the first port, m) setting the multiplexer in such a manner that the internal capacitor is connected to the second port, n) setting the multiplexer in such a manner that the internal capacitor is connected to the third port, o) digitizing the voltage present across the internal capacitor into a digital voltage value using the A/D converter, and p) evaluating the digitized voltage value in order to determine the capacitance and/or the change in capacitance. 
     Steps j) to n) are preferably repeated a predefined number of times before step o). Alternatively, steps j) to p) are repeated until a predefined digitized threshold voltage value is established in step p), a number of the repetitions additionally being evaluated in order to determine the capacitance and/or the change in capacitance. 
     An apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element is designed to carry out the abovementioned method and comprises: an average value capacitor, an operating capacitor, means for discharging the average value capacitor, means for discharging the capacitive sensor element and/or charging the capacitive sensor element to a charging voltage, means for discharging the operating capacitor and/or charging the operating capacitor to the charging voltage, means for connecting the operating capacitor to the capacitive sensor element, means for connecting the operating capacitor to the average value capacitor, and means for evaluating a voltage which is established across the operating capacitor or across the average value capacitor in order to determine the capacitance and/or the change in capacitance. 
     In one embodiment, the apparatus comprises a microprocessor comprising an internal capacitor which forms the operating capacitor, an A/D converter which is connected to the internal capacitor, a first port, a second port, and a third port. Each port can be configured as an input or as an output, the capacitive sensor element being connected to the second port, and the average value capacitor being connected to the third port, a multiplexer which is connected, on the input side, to the ports and is connected, on the output side, to the internal capacitor and connects one of the ports to the internal capacitor, and a program memory for storing program code, during the execution of which the method is carried out. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Advantageous embodiments of the invention are schematically illustrated in the drawings and are described below. In this case: 
         FIG. 1  shows a block diagram of a first embodiment of an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element, and 
         FIG. 2  shows a block diagram of another embodiment of an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element. 
     
    
    
     DETAILED DESCRIPTION 
       FIG. 1  schematically shows a block diagram of a first embodiment of an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element  105  (“C 2 ”), for example in the form of a capacitive button  110 , the capacitance of which changes in a touch-dependent manner. The capacitive sensor element C 2  is illustrated using its electrical equivalent circuit diagram. 
     The apparatus comprises a microprocessor  120  (“MP”) having an internal capacitor  125  (“C 1 ”) which has a known capacitance and forms an operating capacitor, an A/D converter  130  (“AD”) which is connected to the operating capacitor, a first port  135  (“P 1 ”), a second port  140  (“P 2 ”) and a third port  145  (“P 3 ”), each of which can be configured as an input or as an output, the capacitive sensor element C 2  being connected to the second port P 2  and the average value capacitor  150  (“C 3 ”) being connected to the third port P 3 , a multiplexer  160  (“MX”) which is connected, on the input side, to the ports P 1  to P 3  and is connected, on the output side, to the operating capacitor C 1  and connects one of the ports to the internal capacitor, and a program memory (not illustrated in detail) for storing program code, during the execution of which the method according to one embodiment of the invention is carried out. 
     In order to determine the capacitance and/or the change in capacitance of the capacitive sensor element C 2 , the following steps are carried out in succession: 
     In a step 1), the first port P 1  is first configured as an output and a high signal is output at the first port P 1 , that is to say a supply voltage VDD of the microprocessor MP is present at the port P 1 . 
     In a step 2), the third port P 3  is then configured as an output and a low signal is output at the third port P 3 , as a result of which the average value capacitor C 3  is discharged at the beginning of a measurement. 
     In a step 3), the third port P 3  is then configured as an input in order to make it possible to gradually charge the average value capacitor C 3 . 
     In a step 4), the second port P 2  is now configured as an output and a low signal is output at the second port P 2 , as a result of which the capacitive sensor element C 2  is discharged. 
     In a step 5), the second port P 2  is then configured as an input in order to make it possible to charge the sensor element C 2 . 
     In a step 6), the multiplexer MX is now set in such a manner that the internal capacitor or the operating capacitor C 1  is connected to the first port P 1 , as a result of which the internal capacitor C 1  is charged to the voltage VDD as the charging voltage. 
     In a step 7), the multiplexer MX is then set in such a manner that the internal capacitor C 1  is connected to the second port P 2  and thus to the capacitive sensor element C 2 . Charge equalization now takes place between the capacitors C 1  and C 2 , that is to say the internal capacitor C 1  is discharged to a residual charge. 
     Equation (1) applies to the voltage (“US 7 ”) across the internal capacitor C 1  after step 7):
 
 US 7 =C 1 *VDD /( C 1 +C 2)  Eq. (1)
 
     In a step 8), the multiplexer MX is now set in such a manner that the internal capacitor C 1  is connected to the third port P 3  and thus to the average value capacitor C 3 , as a result of which part of the residual charge of the internal capacitor C 1  is transferred to the average value capacitor C 3 . 
     In a step 9), steps 4 to 8 are now repeated n times, for example where 4&gt;n&gt;25, as a result of which, in a rough approximation, the following voltage (“US 8 ”) shown in Equation (2) is established across the internal capacitor C 1  and across the average value capacitor C 3  after step 8):
 
 US 8 =C 1 *US 7 *n /( C 1 +C 3)  Eq. (2)
 
     In this case, it may be simplistically assumed that the average value capacitor C 3  is charged in a linear manner in the range considered. 
     In a step 10), the voltage US 8  is converted into a digital voltage value using the A/D converter AD and is evaluated, in a step 11), in order to determine the capacitance and/or the change in capacitance of the capacitive sensor element C 2 . 
     Said steps form a measuring cycle, steps 2) to 11) being repeated in successive measuring cycles. 
     If the values of the voltage VDD and the capacitance values of the capacitors C 1  and C 3  are known, the capacitance of the capacitor C 2  can be calculated and an activation state of the capacitive sensor element C 2  can thus be determined. If the values are not known, a change in the activation state can be inferred by forming the difference between measured values from successive measuring cycles. 
     Instead of repeating steps 4 to 8 a predefined number of times, in particular a constant number of times, in step 9, steps 4 to 8 and 10 and 11 can alternatively be repeated until a predefined digitized threshold voltage value is established, the number of the repetitions being evaluated in order to determine the capacitance and/or the change in capacitance. 
       FIG. 2  shows a block diagram of another embodiment of an apparatus for determining a capacitance and/or a change in capacitance of a capacitive sensor element, in which the previously described internal multiplexer MX and the internal capacitor C 1  are in the form of discrete components. 
     A multiplexer  205  (“MX&#39;”), for example of the type DG508B, connects one of the inputs S 1  to S 8  to a common output D depending on the state of signals at address inputs A 0  to A 2 . The address inputs A 0  to A 2  are connected to ports of a microprocessor (not shown) which drives them in a suitable manner. The average value capacitor  150  C 3  is connected to the input S 8  of the multiplexer MX′ and to a port (not shown) of the microprocessor, the port being able to be configured as an (analogue) input and as an output. VDD is connected to the input S 5  and GND is connected to the input S 6 . 
     Yet further capacitive sensor elements (not shown) may be connected to the inputs S 1  to S 3  and S 7 . 
     The circuit shown in  FIG. 2  may be driven or operated as described below. 
     An EN control  210  line is first of all set to “1”. The EN control line may remain set or may be briefly reset between the individual method steps in order to ensure clear switching states. 
     In order to charge the operating capacitor C 1   125  to VDD, the address inputs A 0  to A 2  are set in such a manner that the switch associated with the input S 5  is closed. 
     In order to transfer charge from C 1   125  to C 2   105 , the address inputs A 0  to A 2  are set in such a manner that the switch associated with the input S 4  is closed. 
     In order to transfer residual charge from C 1  to C 3 , the address inputs A 0  to A 2  are set in such a manner that the switch associated with the input S 8  is closed. 
     The capacitive sensor element C 2  can now be discharged, for example, by the capacitive sensor element C 2  also being additionally connected to a microprocessor port which, for the purpose of discharging, is configured as an output at which a low signal is output. Alternatively, gradual discharging can be carried out using the operating capacitor C 1  which is first of all discharged by being connected to GND by closing the switch associated with the input S 6  and is then connected to the capacitive sensor element C 2  in order to discharge the latter. 
     After the capacitive sensor element C 2  has been discharged, the abovementioned steps are repeated a number of times. The voltage across the capacitor C 3  is then measured using an AD converter of the microprocessor, which voltage is then evaluated in order to determine the capacitance. 
     The average value capacitor C 3  can then be discharged by configuring the associated microprocessor port as an output and outputting a low signal. 
     The abovementioned steps can then be repeated for all capacitive sensor elements. 
     In the embodiments shown, the capacitive sensor element is discharged and the operating capacitor is charged to the charging voltage before the capacitive sensor element is connected to the operating capacitor. The capacitive sensor element can also be alternatively first of all charged to the charging voltage and the operating capacitor can be discharged. 
     The embodiments shown make it possible to determine a capacitance and/or a change in capacitance of a capacitive sensor element in a reliable and interference-free manner.