Micropower voltage-independent capacitance measuring method and circuit

A circuit for measuring an unknown capacitance includes a reference capacitor having a known capacitance, an oscillator timing circuit, a variable frequency oscillator and a microcontroller. The oscillator timing circuit includes switches which selectively couple the unknown capacitance and the reference capacitor to the oscillator timing circuit. The variable frequency oscillator generates time varying signals which vary in frequency proportionally to the unknown capacitance and reference capacitor selectively coupled to the oscillator timing circuit. The microcontroller receives the time varying signals from the oscillator, and compares the periods of the time varying signals to determine the value of the unknown capacitance.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention generally relates to capacitive sensors, and more particularly relates to methods and circuits for precisely measuring the capacitance of a component or circuit.

While working with capacitive sensors, there often comes a need for a low-cost high resolution circuit to measure the absolute value of the small capacitance with a high degree of precision. The task becomes even more complicated when it needs to be performed with low current consumption, and under changing voltage conditions commonly found in solar cell powered systems, such as the pressure gauge disclosed in U.S. utility patent application entitled “Light Powered Pressure Gauge”, having Ser. No. 11/314,809, filed on Dec. 21, 2005, and having as a named inventor John W. Weiss, the disclosure of which is incorporated herein by reference.

Description of the Prior Art

There are a number of conventional approaches to this problem. For example, the conventional Wheatstone Bridge configuration (FIG. 1) for measuring an unknown capacitance uses an AC powered capacitive bridge to compare the Cx (unknown capacitance) to Cref (reference capacitance). The imbalance of the bridge produces an AC voltage at the diagonal of the bridge that has to be rectified, amplified and filtered with high precision, and then fed into an analog-to-digital converter to obtain a digital equivalent of the measured Cx/Cref ratio. The method requires an expensive and power consuming analog front-end circuitry, and an independent stable AC voltage source for the bridge excitation.

Another conventional circuit configuration for measuring capacitance makes use of a charge amplifier (FIG. 2) to obtain the Cx/Cref ratio. In this case, the AC voltage source can be referenced to the common ground of the circuit, and the circuit can operate in a ratiometric voltage independent mode. However, all the front end requirements of the previous approach (i.e., the Wheatstone bridge configuration) remain in place with the charge amplifier configuration. The imperfections of the operational amplifier used in the charge amplifier configuration also heavily affect the precision of the circuit.

Another conventional approach (FIG. 3) for measuring capacitance, described in detail in a Texas Instruments MSP430 Family Application Reports (Literature Number SLAA024, pp. 2-208, 2-209), alternatively charges Cx and Cref through the same resistor R from the same Vcc DC voltage source up to the voltage level of the source through switch SW1, and then discharges the respective capacitor through the same resistor R to the ground through switch SW1. The discharge time from the beginning of the discharge process till the moment determined by a comparator when the voltage at the capacitor reaches a nonzero Vth threshold level is measured by a timer, and the ratio of the discharge times is used to calculate the Cx/Cref ratio. This method also allows to account for the stray capacitance Cs by making an extra charge-discharge cycle with SW2and SW3switches open. While this method requires no signal conditioning circuitry, its use is limited to relatively high values of the Cx and Cref capacitances. Small value capacitors (below 100 pF) dictate the use of a high value resistor R (tens of MegOhms) to provide time intervals sufficient for precise ratio calculations. The discharge currents move into a nanoAmp area, where circuit leakages impair the precision.

OBJECTS AND SUMMARY OF THE INVENTION

It is an object of the present invention to provide a capacitance measuring circuit and method that accurately measure unknown capacitance values.

It is another object of the present invention to provide a capacitance measuring circuit which requires low power for its operation.

It is still another object of the present invention to provide a capacitance measuring circuit that does not require an analog-to-digital converter to obtain a digital equivalent of the measured capacitance.

It is a further object of the present invention to provide a capacitance measuring circuit that can be inexpensively manufactured.

It is still a further object of the present invention to provide a circuit and method for measuring capacitance that account for stray capacitance that may have otherwise affected the capacitance measurements.

It is yet a further object of the present invention to provide a capacitance measuring circuit that is not voltage dependent when measuring an unknown capacitance value.

It is another object of the present invention to provide a capacitance measuring circuit and method that can measure small value capacitances.

It is still a further object of the present invention to provide a capacitance measuring circuit that can be compensated for temperature and voltage variations.

In accordance with one form of the present invention, a circuit for measuring an unknown capacitance includes a reference capacitor having a known capacitance, an oscillator timing circuit, a variable frequency oscillator and a microcontroller. The oscillator timing circuit includes switches which selectively couple the unknown capacitance and the reference capacitor to the oscillator timing circuit. The variable frequency oscillator generates time varying signals which vary in frequency proportionally to the unknown capacitance and reference capacitor selectively coupled to the oscillator timing circuit. The microcontroller receives the time varying signals from the oscillator, and compares the periods of the time varying signals to determine the value of the unknown capacitance.

A method of measuring an unknown capacitance in accordance with the present invention includes the steps of generating a first time varying signal which has a period that is proportional to the unknown capacitance, generating a second time varying signal which has a period that is proportional to a known reference capacitance, comparing the periods of the first and second time varying signals and determining the value of the unknown capacitance from the comparison of the periods of the first and second time varying signals.

These and other objects, features and advantages of the present invention will be apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The current invention provides a low power voltage independent method and a circuit for high resolution capacitance measurement that overcome all the drawbacks of the prior art examples discussed above.

The following description and the circuitry are provided for the purpose of illustration and not the limitation of scope of the current invention. It is understood that other types of switches, oscillators and other components can be used without departing from the scope of the invention.

As shown inFIG. 4, the preferred embodiment comprises a preferably low-power generic microcontroller2and a front end circuit4. The microcontroller2(hereafter MCU) operates the front end circuit4and receives a digital signal from the front end circuit4in the form of blocks of pulses (periodic signals), each block having its own frequency of pulses or corresponding period. The MCU2then processes the signals and outputs the result in any form including but not limited to the display readout. The processing does not require an analog-to-digital conversion.

The front end4(FIG. 4) comprises a variable frequency oscillator built around a preferably micropower generic timer6in an astable operation mode, and three electrically controllable switches SW1, SW2, and optional SW3. The timing circuit of the oscillator includes resistors R1and R2and any capacitance attached to the Node A. The switches SW1and SW2, resistors R1and R2, and the capacitance at Node A form part of an oscillator timing circuit (generally, a series R-C network having a grounded capacitor).

More specifically, and again referring toFIG. 4of the drawings, it will be seen that the timer6may be one of many timers that are suitable for use and available in the market, such as the LMC555/LM555/NE555/SA555 family of timers manufactured and distributed by a number of manufacturers, such as National Semiconductor or Fairchild Semiconductor Corporation. Assuming that the timer6chosen is the aforementioned LM555 series of timers, then the ground pin (Pin1) is grounded, the control voltage pin (Pin5) is open circuited, the output pin (Pin3) on which the time varying signals Foutare generated is connected to the MCU2, the Vcc pin (Pin8) is connected to one end of a filter capacitor (C filter), the other end of which is grounded, and to the first contact of switch SW3, the reset pin (Pin4) is similarly connected to the same end of the filter capacitor and the first contact of switch SW3as the Vcc pin, the discharge pin (Pin7) is connected to the junction between the first ends of resistors R1and R2, and the threshold pin (Pin6) and the trigger pin (Pin2) are connected to Node A.

Node A is connected to the second side of resistor R2, to the first contact of switch SW2, to the first contact of switch SW1and, effectively, to one side of the stray capacitance Cs, whose other side is grounded, which is included for illustrative purposes, that is, to illustrate that stray capacitances are taken into effect by the capacitance measuring circuit of the present invention (i.e., Cs is not a physical capacitor).

The second contact of switch SW2is connected to one side of a reference capacitor Cref, whose other side is grounded. The second contact of switch SW1is connected to one end of the unknown capacitance Cx, whose other end is grounded. Node A is also connected to the second end of resistor R2. The second end of resistor R1is connected to the same first contact of switch SW3to which the reset and Vcc pins of the timer6are connected. The second contact of switch SW3is connected to Vcc (the supply voltage for the circuit).

Each of switches SW1, SW2and SW3is shown for simplicity purposes as single pole, single throw electronic switches. The switches are controlled by the MCU2, as illustrated byFIG. 4of the drawings, with the MCU2providing control signals to each of the switches. The MCU2will also provide an output signal which is equal to or proportional to the measured value of the unknown capacitance Cx, and such capacitance may be displayed on display11coupled to MCU2.

The timer6in an astable mode outputs a pulse train with a period according to the following equation:
T=0.693(R1+2*R2)C,
or T=kC,  (1)

where C—is a capacitance at the Node A, and k=0.693(R1+2*R2).

It is obvious that the equation (1) does not include the Vcc value; therefore, the circuit operation is not voltage dependent. However, it is understood that other types of oscillators can be used, where the coefficient k may include a voltage dependent component. It will be shown later that, as long as the Vcc value stays constant within the measurement cycle period, it does not affect the measurement results.

Let us assume for now that the optional switch SW3stays closed all the time, and the front end circuitry is continuously powered.

According to the equation (1), when the switches SW1and SW2are open, the oscillator output signal has a period of
TCs=kCs  (2),

where Cs is not a physical capacitor but a sum of the physical circuit stray capacitance and a capacitance corresponding to the group delay of the internal oscillator circuitry.

With the switch SW1conducting, and the switch SW2open, the output period changes to
TCx+Cs=k(Cx+Cs)  (3).

With the switch SW2conducting, and the switch SW1open, the output period changes to
TCref+Cs=k(Cref+Cs)  (4).

The system of the equations (2), (3), and (4) resolves into the following:
Cx/Cref=(TCx+Cs−TCs)/(TCref+Cs−TCs)  (5)

The equation (5) confirms that the calculated Cx/Cref ratio does not depend on the value of the coefficient k as long as it does not change within the measurement cycle.

The unknown capacitance Cx can be calculated from the equation
Cx=Cref(TCx+Cs−TCs)/(TCref+Cs−TCs)  (6).

Thus, the Cref capacitor is the only critical component of the circuit affecting the precision and stability of the Cx measurement.

The proposed arrangement uses much lower resistor values than the conventional switched capacitors approach described earlier and shown inFIG. 3; therefore, it is much less sensitive to the printed circuit board and component leakages and provides measurement of the capacitance value down to a few picoFarads. The resolution of this measurement method of the present invention is limited by the resolution of the period measurement and the division procedure, and can be quite high. The period measurement resolution increases with the increase of the measurement time. However, the increased measurement time requires more energy from the power source, which may be undesirable in some battery or solar power operated systems.

The SW3power switch may be used to power the oscillator circuit down between the measurement cycles, thereby reducing the average current consumption by taking advantage of the system duty cycle.

The Operation Diagram (FIG. 5) for the present invention illustrates the measurement cycle flow. The MCU2generates control signals to the switches SW1, SW2, and SW3. The high level on the diagram corresponds to the switch in a conducting state. The low level relates to the open state. The Foutportion illustrates three time periods (t0, t1, and t2) of the oscillator output signal corresponding to the various states of the switches.

The measurement cycle begins when the switch SW3turns on and applies power to the oscillator. The switches SW1and SW2stay open for the time period t0while the TCsis measured by the MCU2. Then switch SW1turns on and connects the unknown capacitance Cx to the Node A for the time period t1while the period TCx+Csis measured by the MCU2. After that, the switch SW1turns off, and the switch SW2turns on and connects the reference capacitance Cref to the Node A for the time period t2while the period TCref+Csis measured by the MCU2. Then, all of the switches turn off, and the MCU2processes the results.

A variety of control methods may be used to optimize the oscillator runtime (and the average power consumption) in each time period while preserving the desired resolution level. The two methods described in detail herein illustrate just two possible approaches as an example.

The Period Method of the present invention accumulates a number of pulses of the oscillator output signal required to achieve the resolution in a counter8(either external or internal to the MCU2), and then switches the system to the next mode. For example, to achieve the resolution of 0.1% at least 1000 pulses should be accumulated. The time required to accumulate the preset number of pulses is measured by the MCU timer based on the crystal controlled time base, or by a time period measurement circuit9integrally formed as part of MCU2or as a separate circuit. At the end of the measurement cycle, the MCU2processes the three numbers, corresponding to the appropriate output signal periods multiplied by a number of pulses (1000 in our example), in accordance with equation (6), and outputs the result. (It is envisioned, however, that the predetermined number of pulses (e.g., 1000) of the three time varying signals occurring from which time periods t0, t1and t2are derived need not be same and may be different from one another.) The resulting time periods t0, t1, and t2closely follow the changing period of the oscillator output frequency, and provide the shortest possible runtime of the oscillator. However, this approach requires a high frequency MCU timer time base, which may negate some of the power savings offered by the optimal oscillator runtime.

The Frequency Method of the present invention assumes that the maximum values for wave periods TCs, TCx+Cs, and TCref+Csare known. The fixed time periods t0, t1, and t2are calculated to accept at least the required number of pulses (e.g., 1000), and are generated by the MCU timer based on a low frequency, crystal-operated time base (e.g., 32.768 kHz). The number of pulses accumulated within each time period is proportional to the frequency of the output signal.

The acquired frequencies can be converted into periods as follows
T=1/(n×F)  (7),

where T is a period, n is a scale coefficient, and F is an accumulated number proportional to the corresponding frequency.

If all three time periods t0, t1, and t2are selected equal, then n=1. It is envisioned, however, that the three predetermined time periods t0, t1and t2need not be the same and may be different from one another.

The frequency method obviously provides excessive runtime for the oscillator in most of the cases. However, the appropriate scaling of the time periods and the ability to run the MCU clock at low frequency can result in a very efficient system.

Both methods require just the short time stability from the time base, with the long term fluctuations not affecting the system performance.

Accumulation of large number of pulses in both methods provides an additional benefit of integrating the jitter and noise out of the end results.

A flow chart of the operation of the capacitance measuring circuit of the present invention using the period method is shown inFIG. 6, and using the frequency method is shown inFIG. 7.

More specifically, the operation of the capacitance measuring circuit of the present invention using the period method will now be described. First, the settings and the display of the capacitance measuring circuit are initialized (Block10). Then, switches SW1, SW2and, optionally, SW3are opened (Block12). The MCU2is placed in a low-power mode between measurement cycles (Block14). If the measurement cycle starts (Block16), switch SW3is closed (Block18). If the measurement cycle does not start, the MCU2remains in its low-power mode (Block14).

With the closure of switch SW3(Block18), both switches SW1and SW2are in an open state (Block20). Now, the time period to required to accumulate a first predetermined number of pulses is measured (Block22). This is the first time varying signal that is generated by the oscillator, and the period of this signal is proportional to the stray capacitance. Then, the value of the supply voltage is determined (Block24).

If the supply voltage is below a minimum value (Block26), then the method repeats the steps shown in Blocks12through26, starting with switches SW1, SW2and SW3being opened. However, if the supply voltage is not below a minimum value (Block26), then switch SW1is closed (Block28). Now, the time period t1required to accumulate a second predetermined number of pulses is measured (Block30). This is the second time varying signal that is generated by the oscillator, and the period of this signal is proportional to the combination of the unknown capacitance and the stray capacitance. Switch SW1is then opened, and switch SW2is closed (Block32). Now, the time period t2required to accumulate a third predetermined number of pulses is measured (Block34). This is the third time varying signal that is generated by the oscillator, and the period of this signal is proportional to the combination of the known reference capacitance and the stray capacitance. Switches SW1, SW2and, optionally, SW3are then opened (Block12). The steps in Blocks12through34may be repeated, as required, while the MCU2determines the value of the unknown capacitance from the previous measurements.

Next, the ratio of Cx divided by Cref is computed (Block36) by the MCU2, and the value of the unknown capacitance, Cx, is determined by the MCU2(Block38) and outputted on, for example, a digital display11(seeFIG. 4).

The operation of the capacitance measuring circuit of the present invention using the frequency method, as shown inFIG. 7, will now be described. First, the settings and display of the capacitance measuring circuit are initialized (Block40). Then, the switches SW1, SW2and, optionally, SW3are opened (Block42). The MCU2is placed in a low-power mode between measurement cycles (Block44).

When the measurement cycle starts (Block46), switch SW3is closed (Block48). If the measurement cycle is not started (Block46), the MCU2remains in its low-power mode (Block44).

Again, with the closing of switch SW3, switches SW1and SW2remain open for a time period t0(Block50). Then, the number of pulses accumulated during period t0(a first predetermined time period) are counted (Block52). This is the first time varying signal that is generated by the oscillator, and the period of this signal is proportional to the stray capacitance.

The value of supply voltage is then determined (Block54). If the supply voltage is below a minimum value (Block56), the sequence of steps shown in Blocks42through56are repeated, starting with opening switches SW1, SW2and, optionally, SW3(Block42). If the supply voltage is not below a minimum value (Block56), then the operation of the capacitance measuring circuit continues by closing switch SW1for time t1(a second predetermined time period) (Block58). Again, the number of pulses accumulated during period t1are counted (Block60). This is the second time varying signal that is generated by the oscillator, and the period of this signal is proportional to the combination of the unknown capacitance and the stray capacitance.

Switch SW1is then opened, and switch SW2is closed for time t2(a third predetermined time period) (Block62). The number of pulses accumulated during period t2are then counted (Block64). This is the third time varying signal that is generated by the oscillator, and the period of this signal is proportional to the combination of the known reference capacitance and the stray capacitance. Switches SW1, SW2and, optionally, SW3are then opened (Block42). The steps shown in Blocks42through64may be repeated, as required, while the MCU2determines the value of the unknown capacitance from the previous measurements.

The ratio Cx/Cref is then computed (Block66) by the MCU2, and the value of the unknown capacitance Cx is determined (Block68) by the MCU2, and the value of the unknown capacitance Cx is outputted by the MCU2or displayed on a display11(seeFIG. 4) of the capacitance measuring circuit (Block70).

It is envisioned that if it is not desired to account for the effects of stray capacitance, the steps of measuring the pulse trains with switches SW1and SW2being open in either the period method ofFIG. 6or the frequency method ofFIG. 7may be omitted, with the assumption that the stray capacitance is negligible or zero in the aforementioned equations and the calculations performed by MCU2. It is further envisioned that the circuit and method of the present invention can measure one or more unknown capacitances Cx, and such capability should be understood to be within the scope of the present invention.

Since the preferred embodiment is expected to be used in a solar cell or battery powered applications, it is important to provide a voltage measurement means to extend the reliable circuit operation into low voltages where the front end circuitry exhibits severe nonlinearity, and to avoid displaying erroneous results when the voltage drops below a certain level due to a battery end of life condition or a low light condition for a solar cell.

Voltage induced effects manifest themselves in front end oscillator frequency variations, which are more pronounced at the lower capacitance values. To further improve the accuracy of the measurement circuit, given the extremely high resolution of the preferred embodiment solution, it is preferred that these possible frequency variations are taken into consideration when calculating the capacitors' ratio.

While a variety of well known methods such as voltage detectors and analog-to-digital converters may be used to measure voltage, the preferred embodiment circuit provides a power and cost efficient way described below.

The final circuit calibration should be performed with varying Cx at a number (at least two) of voltage values whereas the first voltage is the minimum one and the other voltages are higher, and the resulting calibration table should include a frequency (or period) of the oscillator running on a fixed capacitance, such as Cs or Cref.

During normal operation, the calibration data is interpolated and extrapolated based on an immediate value of the fixed capacitor frequency (or period). When the voltage drops below the minimum value, the results are no longer valid and should not be displayed or used.

2. Temperature Variations

To further improve the accuracy of the circuit of the present invention when it is used under a wide range of ambient temperatures and to compensate for a possible capacitive sensor temperature variation, a further enhancement to the present invention is contemplated herein. Under such conditions, it is possible that the capacitive sensor itself may exhibit some repeatable temperature related effects. To compensate for the temperature related error, the ambient temperature may be measured by periodically substituting one of the front end oscillator timing resistors R1or R2with a thermistor (or any other temperature sensitive device) network, or periodically adding a thermistor in parallel with either resistor R1or R2. The frequency (or period) of the oscillator running on a fixed capacitance, such as Cs or Cref, under a number of ambient temperature values becomes another entry in a calibration table. During normal operation, the results from the calibration table may be adjusted for the temperature related error.

3. Simplifying the Circuit

When both voltage and temperature compensation features are used, the circuit may be simplified by omitting the Cs measurement. In this case, the Cx value should be calibrated directly against the Cx/Cref ratio, and only Cref should be used for the voltage and temperature related compensation.

4. Measuring Additional Unknown Capacitors

In a system that has the known Cref and two or more unknown capacitors Cx and Cy, the same principals apply. This may occur with a differential or duplex capacitor measuring system. In this case, the second capacitor is used to improve the resolution over a single capacitor. Should Cx decrease upon upscale change, and Cy increase with upscale change, it can be arranged that at some point in the range, Cx is equal to Cy. Also at some point in the scale, the slopes are equal yet opposite, having the same change with incremental change in the property being measured. The measurement can favor the unknown capacitor with greatest slope to have the highest resolution. In addition, should the system have a permanent shift, as when a sensitive meter is dropped, the cross over point will change, indicating an over range condition has occurred or an unexpected shift has occurred. Related circuitry that drives a display can provide an alert message suggesting a check or recalibration is necessary.