Capacitance measuring circuit and method for liquid leak detection by measuring charging time
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates generally to the field of leak detection, wherein a leaking fluid causes an impedance change in a sensing cable and the impedance change is detected as an indication of the leak. 
     2. Related Art 
     A variety of chemicals (e.g., oils, crude oil, refined petroleum products, gasoline, kerosene, organic solvents, and the like) are stored in underground tanks and transported through buried pipelines. Leakage from these tanks and pipelines can contaminate ground water and cause extensive environmental damage. Further, leaks are difficult to detect and often are not detected until extensive environmental damage has already occurred. 
     One method of detection has been to run a cable adjacent to the underground pipeline or tank. The cable includes a pair of conductors (e.g., coaxial or twin lead) with a permeable insulation disposed therebetween. If a leak occurs, the chemical will permeate the insulation and will cause a change in its dielectric properties such that the electrical characteristics between the conductors is changed. This will result in an impedance change that can be sensed at a remote end of the cable. 
     A common means for performing such sensing is time domain refelectometry (TDR) wherein an electrical pulse is propagated down the cable and any reflections are received and observed. An additional means which may be used is capacitance measuring. 
     Capacitance measuring has been used to locate faults in electrical communication cables. If the measured capacitance of a cable is compared with a known distributed capacitance per unit length for that cable, the length of the cable or the location of an open fault (i.e., a break) may be determined. In a similar manner, capacitance measuring could be used to sense a change in the capacitance of a cable due to permeation of a liquid chemical. 
     A known means for measuring capacitance is to charge a cable with a constant current to a predetermined voltage and to measure the charge time. The charge time can then be related to the value of the unknown capacitance. U.S. Pat. No. 3,452,272 to Collins et al., U.S. Pat. No. 3,761,805 to Dornberger, and U.S. Pat. No. 4,103,225 to Stephens provide examples of constant current capacitance measuring systems. 
     While these systems may be relatively simple, they tend to yield poor accuracy (i.e., the systems suffer from measurement error) and/or require frequent calibration. A substantial amount of error is caused by variations in the constant charging current, which is caused by variations in the power supply voltage and variations in circuit component values. 
     SUMMARY OF THE INVENTION 
     The present invention is a method and system for leak detection. The capacitance of a leak detection cable is changed by a leaking liquid. A capacitance measuring circuit detects changes in the capacitance of the cable and thereby detects the presence of a leak. 
     The capacitance measuring circuit includes an inverter, a current source, a comparator, and a timer. The inverter inverts a DC voltage to produce a mirror-image inverted DC voltage. The current source produces a constant current proportional to the mirror-image inverted DC voltage and supplies the constant current to the cable so that the cable is charged from a first potential to a second potential. A comparator compares the voltage across the cable to the input voltage and produces a match signal when a predetermined relationship exists therebetween. A timer responsive to the match signal measures the time required for the cable to be charged from the first potential to the second potential. The capacitance of the cable is directly proportional to the charge time. 
     In the preferred embodiment a switch connected in parallel with the cable shunts the constant current to ground such that the first potential is zero volts. A controller controls the switch and the timer such that the switch is caused to open and the timer is caused to begin counting simultaneously. 
     It is an advantage of the present invention that voltage related errors are eliminated from the capacitance measuring circuit such that the need for calibration is eliminated. 
     It is another advantage of the invention that an accurate and stable capacitive measuring circuit is disclosed which is simple and contains relatively few parts. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a diagram showing the leak detection system of the present invention. 
     FIGS. 2(a) and (b) show cutaway perspective views of two embodiments of leak detection cable 104. 
     FIG. 3 is a block diagram of capacitance measuring circuit 102 of the present invention. 
     FIG. 4 is a graphical representation of the charging voltage and time for cable 104. 
     FIG. 5 is a partial schematic diagram detailing capacitance measuring circuit 102. 
    
    
     PREFERRED EMBODMENT OF THE PRESENT INVENTION 
     A leak detection system 100 is shown in FIG. 1 in the environment of a storage tank 106 and a pipeline 108. System 100 includes a capacitance measuring circuit 102 and a leak detection cable 104. Storage tank 106 and pipeline 108 contain a chemical (e.g., fuel oil) for which leak detection is desired. Cable 104 is laid adjacent tank 106 and pipeline 108. One end of cable 104 is connected to capacitive measuring circuit 102. The other end of cable 104 remains unterminated. 
     Leak detection cable 104 is a conventional leak detection cable as is known in the art. The specific cable chosen will depend on the properties of the liquid to be detected. In the preferred embodiment, a cable may be used such as that disclosed in U.S. Pat. No. 4,877,923 to Sahakian and available as part number LLF-0126 (water and liquid chemical cable) or LLF-0118 (hydrocarbon cable) from W. L. Gore &amp; Associates, Inc., Wilmington, Del. Examples of other leak detection cables are disclosed in U.S. Pat. Nos. 3,981,181 to Ochiai, 4,029,889 to Mizuochi, 4,206,632 to Suzuki, 4,594,638 to Suzuki, and, 4,910,998 to Willis et al. 
     A first embodiment 104(a) of cable 104 is shown in detail in FIG. 2(a). This embodiment can be used for detecting water as well as liquid chemicals. Cable 104(a) includes an inner conductor 202, a first insulation layer 204, a second insulation layer 206, a coaxial outer conductor 208, and an outer protective layer 210. 
     First insulation layer 204 is a hydrophobic, micro-porous insulation such as expanded, micro-porous polytetrafluoroethylene (EPTFE). Second insulation layer 206 is a polyester braided filler which is permeable so as to pass chemicals, but is not hydrophobic. Outer conductor 208 is of braided conductive metal construction and is fluid permeable. Protective layer 210 is a permeable material such as polyethylene or polyester and can be woven or braided. 
     A second embodiment 104(b) of cable 104 is shown in detail in FIG. 2(b). This embodiment can be used for detecting liquid hydrocarbons. Cable 104(b) includes an inner conductor 202, a first insulation layer 204, a coaxial outer conductor 208, an outer hydrophobic layer 209, and an outer protective layer 210. 
     First insulation layer 204 and hydrophobic layer 209 are both hydrophobic, micro-porous insulation such as EPTFE. Outer conductor 208 is of braided conductive metal construction and is fluid permeable. Protective layer 210 is a permeable material such as polyethylene or polyester and can be woven or braided. 
     Note that cable 104(a) may be used to sense a variety of liquids (including water), while cable 104(b) is limited to liquids which are capable of permeating hydrophobic layer 209 (e.g., hydrocarbons). The operative difference between the cables is hydrophobic layer 209 of cable 104(b) which prevents water from reaching the conductors such that the impedance of cable 104(b) will not be affected by water. Cable 104(a), on the other hand, allows water to be absorbed into second insulation layer 206 between the conductors such that water can be detected. 
     Referring now to FIGS. 1 and 2(a), operation of leak detection system 100 is described. If a leak (e.g., leak 110) occurs in tank 106 or pipe 108, the leaking liquid will eventually come into contact with cable 104. In the case of cable 104(a), the liquid will pass through protective layer 210 and conductor 208, and will be absorbed into first insulation layer 204 and second insulation layer 206. The absorbed liquid will cause a change in the dielectric properties of insulation layers 204 and 206. This will result in a change in the capacitance of the cable which can be sensed by capacitance measuring circuit 102 at a remote end of the cable. 
     In the case of cable 104(b), shown in FIG. 2(b), the liquid will pass through protective layer 210 and contact hydrophobic layer 209. Only hydrocarbons will pass through layer 209 (i.e., water will be excluded). The hydrocarbon will then pass through outer conductor 208 and will be absorbed into first insulation 204. As with cable 104(a), the absorbed liquid will cause a change in the dielectric properties of insulation layer 204, resulting in a corresponding change in the capacitance of the cable which can be sensed by capacitance measuring circuit 102. 
     Capacitance measuring circuit 102 is shown in FIG. 3. A voltage source 302 provides a stable DC voltage (V IN ) to a first input of a comparator circuit 312 and to an input (terminal 320) of inverter circuit 304. Inverter circuit 304 inverts V IN  from voltage source 302 and provides a mirror-image inverted DC voltage (-V IN ) to an input (terminal 322) of a constant current source 306. Current source 306 has an output terminal 318. 
     Cable 104, having a capacitance C x  which is to be measured, is connected between terminal 318 and ground. Inner conductor 202 of cable 104 is connected to terminal 318 while outer conductor 208 is tied to ground. Current source 306 provides a constant DC charging current (I c ) to cable 104. A digitally controlled, analog switch 308 is connected in shunt fashion across cable 104 (i.e., between terminal 318 and ground). Terminal 318 is also connected to a second input of comparator circuit 312. The output of comparator circuit 312 is input to a microcontroller unit (MCU) 316. MCU 316 provides an output signal to a display unit 314, and a control signal to digitally controlled analog switch 308. A keypad 315 is provided as a user-interface to MCU 316. 
     The principle of operation of capacitance measuring circuit 102 is now described with reference to FIGS. 3 and 4. Initially, switch 308 is CLOSED. In this position, switch 308 shorts terminal 318 to ground such that the net voltage between conductors 202 and 208 of cable 104 is zero. Output current I c  from output terminal 318 is shunted to ground through switch 308. 
     At a time t 1 , MCU 316 causes switch 308 to toggle OPEN. I C  then loses its direct path to ground through switch 308 and is forced to flow through cable 104. This causes the cable to be charged. 
     As a result of the charging, a net voltage V C  is developed between the conductors of cable 104. Comparator circuit 312 continuously compares V C  (as seen at terminal 318) to V IN . At a time t 2 , V C  becomes equal to V IN , causing comparator circuit 312 to toggle and send a match signal to MCU 316 indicating that V C  has reached the desired level. MCU 316 then computes a time Δt=t 2  -t 1 . Time Δt is directly proportional to a capacitance value C X  of cable 104. 
     The relationship between Δt and C X  can be defined mathematically as follows. For a capacitor being charged by a constant current: ##EQU1## where: ΔV=voltage change across capacitor 
     I=constant charging current 
     Δt=charge time 
     C=capacitance 
     Substituting the circuit variables discussed above into this generic equation yields. ##EQU2## 
     The formula for current I c  from current source 306 is set forth in Equation 8 below. If Equation 8 is substituted into Equation 2 and Equation 2 is solved for C X , the following results: ##EQU3## This equation can be further simplified. Since the initial charge on cable 104 at time t 1  is zero volts, ΔV c  will be equal to V c . Also, comparator circuit 312 will trip when V C  =V IN . Therefore, V IN  can be substituted for ΔV C  such that Equation 3 can be simplified to: ##EQU4## Thus, the value of the unknown capacitance C X  is directly proportional to the charge time (Δt), and is independent of V IN . 
     Again, Equation 4 illustrates that the measured value C X  of cable 104 is independent of V IN . This eliminates voltage related errors from circuit 102, and eliminates the need for calibration. The result is an accurate and stable capacitive measuring apparatus which is simple and contains relatively few parts. 
     After determining the value of capacitance C X , MCU 316 will compare the measured value of C X  to a range of predetermined acceptable limits. If the value of C X  does not fall within the range of acceptable limits, then MCU 316 may generate an alarm signal indicating a leak or broken cable condition. Keypad 315 and display 314 provide a user interface to MCU 316. 
     FIG. 5 is a schematic diagram of inverter 304, current source 306, comparator circuit 312, and switch 308 of capacitance measuring circuit 102. Inverter 304 includes a resistor R1, a resistor R2, and an operational amplifier U1. U1, R1 and R2 are connected in an inverting amplifier configuration with R1 connected between terminal 320 and the inverting input of U1. Resistor R2 is connected between the inverting input and the output (terminal 322) of U1. The non-inverting input of U1 is connected to ground. 
     For an ideal operation amplifier (U1), inverter 304 produces an output voltage at terminal 322 defined by the following equation. 
     For R1=R2, the equation simplifies to: ##EQU5## 
     The output voltage of inverter 304 is fed to the input of current source 306. Current source 306 includes operation amplifier U2, and resistors R3-R7. The voltage at terminal 322 (-V IN ) is fed to the inverting input of U2 through R3. R4 provides feedback from the output of U2 to the inverting input of U2. The non-inverting input of U2 is connected to ground through R5. R7 is connected between the output of U2 and output terminal 318. R6 is connected between output terminal 318 and the non-inverting input of U2. 
     For an ideal operation amplifier (U2), current source 306 produces an output current defined by the following equation: ##EQU6## Substituting Equation 6 into Equation 7 yields: ##EQU7## 
     Cable 104 is represented as a capacitance C X  connected from output terminal 318 to ground. Comparator circuit 312 monitors the voltage at terminal 318. Comparator circuit 312 includes comparator U3 and resistor R8. The non-inverting input of U3 is connected to V IN . R8 is connected from the output terminal of U3 to the non-inverting input of the same. The inverting input of U3 is connected to terminal 318. The output of comparator circuit 312 is connected to MCU 316. 
     Note that the mirror-image inverted input voltage -V IN  is the opposite of the input voltage V IN . As V IN  varies, -V IN , and correspondingly I C , will vary an equal amount in the opposite direction. The consequence of this, as set forth in the mathematical equations discussed above, is that any variation in V IN  as seen at comparator circuit 312 will be negated by an equal and opposite variation in V C  (as carried through -V IN  and I C ). Thus, voltage supply related errors are eliminated. 
     The only error sources remaining in the circuit are the non-ideal characteristics of the circuit components. These include leakage and bias currents of operational amplifiers U1 and U2, propagation delays through the circuit, and resistor value variations. Each of these variables comprises an initial tolerance (e.g., initial deviation from ideal), a temperature variation, and an end-of-life variation (i.e., aging). The effects of initial tolerances may be eliminated by &#34;trimming&#34; circuit 102 during a one time calibration at manufacture. 
     This leaves component variations due to temperature and end-of-life as the only remaining potential source of errors. Component variations due to temperature and aging, however, are easily minimized by using precision components. 
     In the preferred embodiment of the invention, the following components would be utilized in circuit 102. U1 and U2 are MC33282P operational amplifiers from Motorola Semiconductor Products, Inc., Phoenix, Ariz. Voltage comparator U3 is available from Texas Instruments Incorporated, Dallas, Tex., as part number LC372IP. MCU 316 is an MC68HC811E2FN microcontroller, also from Motorola. Digitally controlled analog switch 308 is available from Siliconix Incorporated, Santa Clara, Calif., as part number DG401AK. Alternatively, switch 308 may be a transistor. 
     Display 314 is a 2×16 Dot Matrix LCD (Liquid Crystal Display), part number L1642 from Seiko Instruments USA, Inc., Torrance, Calif. Keypad 315 is a one by four membrane keypad available from W.H. Brady Company, Xymox Division, Milwaukee, Wis., under part number 2012084. V IN  is a +5 Volt DC voltage. Resistors R1-R8 are 1% tolerance, carbon composition resistors having the following values: 
     
         ______________________________________                                    
       Resistor                                                           
              Value                                                       
______________________________________                                    
       R1     1            MΩ                                       
       R2     1            MΩ                                       
       R3     2            MΩ                                       
       R4     1            MΩ                                       
       R5     2            MΩ                                       
       R6     500          KΩ                                       
       R7     500          KΩ                                       
       R8     5.1          KΩ                                       
______________________________________                                    
 
    
     The output of comparator 312 is tied to an edge-sensitive input capture pin PA2 (pin 32) of MCU 316. The armature of switch 308 is controlled by pin PC3 (pin 12) of MCU 316. PC3 (pin 12) of MCU 316 is also connected to an edge-sensitive input capture pin PA1 (pin 33) of MCU 316. 
     Substituting the above resistor values into Equations 4 and 8 yields the following: ##EQU8## 
     For fuel oil leak detection, operation of leak detection system 100 would be as follows. Assuming that cable 104 is 100 feet in length and has a distributed capacitance of 23 pF/foot, then the nominal or reference capacitance (C REF ) measured by circuit 102 will be 2300 pF (e.g. corresponding to a charge time of 2300 μsec). Given that fuel oil will change the capacitance of cable 104 by 12 pF/foot, and that it is desired to indicate a leak when at least two feet of cable 104 are in contact with leaking oil, then MCU 316 may be programmed to sound an alarm when the capacitance of the cable exceeds a predetermined leak detection threshold (LDT). Similarly, a break in the cable may be sensed as a decrease in the capacitance of the line, and an alarm sounded when the capacitance falls below a predetermined cable break threshold (CBT). 
     The predetermined thresholds (i.e., LDT and CBT) may be determined in accordance with the following considerations. A capacitance change of approximately ±5 pF has been found to be a suitable threshold for a cable 230 feet long. As the cable length is increased, however, each threshold should be adjusted to account for variation of the cable capacitance due to temperature. With shorter cable lengths (e.g., ≦230 feet), temperature effects are small and may be ignored. As the length of a cable is increased, however, the per foot capacitance change per degree (i.e., pF/(foot·degree)) has an increasing effect, and should not be ignored. 
     Accordingly, in the preferred embodiment, the thresholds are determined by the following equations: ##EQU9## where: C REF  =the nominal or reference capacitance of the cable 
     INT=a function which takes the next highest integer value 
     Examples of several cable lengths for a 23 pF/foot cable which exhibits a 12 pF/foot change in impedance when contacted by the leaking liquid are listed below in Table I. LDT and CBT were calculated according to the equations listed above. L WET  represents the length of cable which must contact the leaking liquid in order to exceed the LDT. L CUT  represents the length of a portion of cable which must be cut in order to fall below the CBT. 
     
                       TABLE I                                                     
______________________________________                                    
CABLE LENGTH                                                              
            C.sub.REF                                                     
                     LDT     CBT   L.sub.WET                              
                                         L.sub.CUT                        
______________________________________                                    
1000&#39;       23,000 pF                                                     
                     23,105  22,895                                       
                                   8.75&#39; 4.6&#39;                             
100&#39;        2,300 pF 2,315   2,285 1.25&#39; .65&#39;                             
10&#39;         230 pF   236     224   .50&#39;  .26&#39;                             
1&#39;          23 pF    28      18    .42&#39;  .22&#39;                             
______________________________________                                    
 
    
     In this preferred embodiment, a current limit resistor may be placed between terminal 318 and capacitance C X  in series connection to meet Underwriter&#39;s Laboratories intrinsic safety requirements for electrical apparatus for monitoring in hazardous locations. A wire-wound 120 Ω, 3 Watt resistor is used in the preferred embodiment. This resistor will limit the current that can be drawn by cable 104 in the event of an internal short-circuit failure of circuit 102. Because I C  is a very small current, only a negligible voltage drop will occur across this resistor, such that no significant measurement error will be introduced. 
     Once a leak or a break in the cable is sensed using the apparatus and method of the present invention, known time domain reflectometry (TDR) techniques may be used to precisely locate the position of the leak or break along the cable, if desired. 
     It should be understood that capacitance measuring circuit 102 can be used with any length of cable. It should be further understood, that capacitance measuring circuit 102 has many applications in addition to that of leak detection. For example, circuit 102 could be used as a general purpose capacitance measuring circuit. 
     Although the invention has been described and illustrated with a certain degree of particularity, it is understood that those skilled in the art will recognize a variety of additional applications and appropriate modifications within the spirit of the invention and the scope of the claims.