Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine.

Capacitive Fluid Level Sensor


This project, a capacitive fluid level sensor from 1991,  shows how to create a simple liquid level sensor using only a single probe.

This is a capacitive sensor that utilized the fact that changes in liquid level alter the dielectric contant of plates attached to the fluid container (when the plates are viewed as a capacitor).

In this case the sensor plates (capacitor) are aranged to be:

1. The containter case itself.

2. A probe attached to the container (and electrically isolated from it).

Note that the probe does not come into contact with the internal liquid.



Executive Summary of the Capacitive Fluid Level Sensor

A capacitive liquid level sensor utilizes capacitive principles to sense the level of a liquid contained within a receptacle. As a liquid rises and falls in the container, the dielectric effect of the liquid changes the effective capacitance of a sensing capacitor which is detected by electronic circuitry coupled to the sensor.

One plate of the sensor capacitor is a probe disposed within a receptacle while a grounded conductive portion of the receptacle is a second plate of the capacitor. The liquid within the receptacle acts as a dielectric between the plates.

Background of the Capacitive Fluid Level Sensor

Fluid level detectors which sense the level of a liquid contained within a receptacle are well known for use in conjunction with automotive engines. Historically, such detectors have been made in the form of float operated switches involving moving parts which are subject to friction and wear.

Other devices utilize an electrical probe to detect fluid levels by measuring the conductivity of the fluid. However, these devices require complicated current amplifying systems because there is often an insufficient amount of current passing through the electrodes to power an indicator lamp.

Several systems have been developed using both intrusive and non-intrusive capacitive means to sense fluid levels contained in receptacles. The non-intrusive systems typically involve wave propagation techniques which are implemented through a transmitter/receiver system. Typically, these systems involve the transmission of an ultrasonic signal from a transmitting transducer through a fluid to a receiving transducer.

Such ultrasonic transmission systems require a liquid transmission medium in order to carry the ultrasonic signal from the transmitting transducer to the receiving transducer. Lack of signal at the receiving transducer relates to a lack of liquid transmission medium, activating a no fluid present indication.

However, a failure in the transducer pair or in their respective electronic connections results in a lack of signal from the receiving transducer which, in turn, activates the normal failure mode, thereby falsely indicating a dry or no fluid present state.

The increasing importance of monitoring fluid levels in automotive and other applications creates a need for more reliable intrusive and non-intrusive fluid level sensors.

Summary of the Capacitive Fluid Level Sensor

The present design utilizes capacitive principles to sense the level of a liquid contained within a receptacle. As a liquid rises and falls in the container, the dielectric effect of the liquid changes the effective capacitance of the sensing capacitor which is detected by electronic circuitry coupled to the sensor.

In an illustrative embodiment, one plate of the sensor capacitor is a probe disposed within a receptacle while a grounded conductive portion of the receptacle is a second plate of the capacitor. The liquid within the receptacle acts as a dielectric between the plates.


Figure 1a : Schematic diagram for the capacitive fluid level sensor

View larger image here.


Description of the Capacitive Fluid Level Sensor

FIG. 1A illustrates the circuit diagram of one embodiment of the fluid level detector of the present design. The supply voltage for this circuit is typically provided by a 12-volt automobile battery which is reduced to a 5-volt DC source voltage by means of a voltage regulator comprising the combination of resistor R1 and zener diode Z1. Capacitor C1 serves as a filter for this voltage supply regulator.

The detector of FIG. 1A incorporates an amplifier A1 in conjunction with a resistor/capacitor network R4 and C2 and resistors R5 and R6 to form a square wave oscillator. A reference voltage is supplied from the voltage regulator where the reference voltage value is determined by the voltage divider circuit R2/R3.

This voltage serves as a reference voltage for the square wave oscillator and voltage comparators A2, A4 located in the circuit, as will be described.


Figure 2a : Signal diagrams of signals at certain test for the capacitive fluid level sensor



The output of the square-wave oscillator described above is shown as the square wave of FIG. 2A. The oscillator produces an alternating electrical output which causes capacitors C3 and C4 to charge through diodes D1 and D2, respectively, where capacitor C4 is a sensor capacitor and capacitor C3 is a reference capacitor.

As stated, capacitor C4 is the sensor capacitor wherein the two conductive surfaces of the capacitor are plate Pl and the residual ground of the receptacle 10 through its mounting arrangement. The dielectric of the capacitor is the fluid in the receptacle 10 such that the capacitance value of C4 varies relative to the fluid level in the receptacle.

The capacitance value of capacitor C3 is adjustable to match the value of capacitor C4 when a predetermined liquid level is sensed, i.e., at the critical level.


Figure 1b : Schematic of alternate sensing circuit for the capacitive fluid level sensor



FIG. 1B shows an alternative embodiment of the present design wherein plates P2 and P3 are added to the configuration of sensing capacitor C4. The plates P2 and P3 are connected to circuit ground. A lower level capacitance is provided by plates P1 and P2, and an upper level capacitance is provided by plates P1 and P3.

When the voltage from the oscillator circuit at test point 1 (TP1) makes a transition from positive to negative, capacitors C3 and C4 begin to discharge through resistors R9 and R10, respectively. It is the difference in voltage decay across resistors R9 and R10 due to the capacitance values of capacitors C3 and C4 which enables the circuit to determine if there is sufficient fluid in the receptacle 10.

Referring again to FIG. 1A, voltage comparator A2 compares the voltage at test point 2 (TP2) with the reference voltage set by resistors R2 and R3. FIGS. 2B and 2C illustrate that when the voltage at TP2 decreases below the reference voltage V1, due to the discharge of capacitor C3, the output of the comparator A2 reference voltage at TP3 drops to zero.

The time between the point where capacitor C3 begins to discharge and the output of the comparator A2 drops to zero is used as a reference time T1. Similarly, the comparator A3 compares the square wave output of the comparator A2 with the voltage decay signal across resistor R10 due to sensor capacitor C4 at test point TP4.

As shown in FIGS. 2C-2E, if the discharge time T3 of capacitor C4 is longer than the reference time T1 established by the comparator A2, the output of the comparator A3 remains high. Conversely, if discharge time T3 is shorter than reference time T1, due to a faster discharge rate in C4, the output of the comparator A3 pulses low for a period of time in which the discharge voltage at TP4 is less than the output voltage of the comparator A2 (TP3). In application, this pulse is actually a current pulse rather than a voltage pulse.

The output of the comparator A3 is an open collector type output which allows capacitor C5 to charge through resistor R14. If the output of A3 pulses low, capacitor C5 discharges to ground and the voltage at test point 5 (TP5) goes to zero.

Finally, the reference voltage set by resistors R2 and R3 is compared to the voltage at TP5 through the comparator A4. If the voltage at TP5 is high, representing capacitance C4 to be of a relatively large value and corresponding to a sufficient fluid in the reservoir, the output of A4 will pull to ground and transistor TR1 will not conduct.

However, if the voltage at TP5 is low, which means that capacitance C4 is not of a sufficient value, the output of A4 will bias transistor TR1 such that current will flow through the collector and energize lamp L1.

In operation, when the fluid level in the receptacle is full, capacitor C4 takes a certain length of time to discharge; when the fluid is at a lower level, capacitor C4 takes a shorter period to discharge. Thus, as the fluid level in the receptacle decreases, the capacitance of capacitor C4 also decreases, which, in turn, decreases the discharge time of capacitor C4.

This causes a current pulse to be output by comparator A3 during the period in which the discharge voltage from capacitor C4 is less than the voltage output from comparator A2. The current pulse causes capacitor C5 to discharge, thereby allowing the output of comparator A4 to rise and allowing current to flow through transistor TR1 to light lamp L1.


Figure 3a : Exploded perspective viewspoints for the capacitive fluid level sensor




Figure 3b : Exploded perspective viewspoints for the capacitive fluid level sensor



An exploded perspective view of the present design is shown in FIG. 3A and FIG. 3B where sensor plate P1 is shown as an integral part of the assembled unit. In an alternative embodiment, capacitor plate Pl can be physically separated from the electronic circuitry of the design such that the sensor plate Pl is attached to the fluid receptacle and is electronically coupled to the corresponding electronic circuitry located at a position which is isolated from the receptacle.


Figure 4a : Two-dimensional views of alternative mounting for the capacitive fluid level sensor



In accordance with the present design, as shown in FIGS. 4A and 4B, the sensing capacitor plate P1 can be mounted to the receptacle 10 in various ways, depending on whether the receptacle 10 is made of a conductive or a non-conductive material. In one embodiment of the design shown in FIG. 4A, the fluid receptacle 10 is completely made of a non-conductive material, and the sensing capacitor plate Pl is mounted directly to the surface of the receptacle 10.


Figure 4b : Two-dimensional views of alternative mounting for the capacitive fluid level sensor



In another embodiment of the design shown in FIG. 4B, the receptacle 10 is made of a conductive material except for a relatively small window 12 of non-conductive material making up a portion of a wall of the receptacle 10 upon which the capacitive plate Pl is mounted.


Figure 5 : Schematic of the alternate circuitry for the capacitive fluid level sensor

View larger image here.


Referring to FIG. 5, as discussed in the previous embodiment, the supply voltage for the circuit is reduced to a 5-volt DC source voltage by means of a voltage regulator comprising the combination of resistor R1' and zener diode Z1. Capacitor C1' serves as a filter for this voltage supply regulator.

Amplifier A1' in conjunction with a resistor/capacitor network R4' and C2' and resistors R5' and R6', form a square wave oscillator. A reference voltage is supplied from the voltage regulator where the reference voltage value is determined by the voltage divider circuit R2'/R3'. This voltage serves as a reference voltage for the square wave oscillator and voltage comparator A2' located in the circuit, as will be described.


Figure 6a : Signal diagrams of signals at certain test points in the alternate circuitry for the capacitive fluid level sensor



The output of the square-wave oscillator described above is shown as the square wave of FIG. 6A. The oscillator produces an alternating electrical output which causes capacitors C6' and C7' to charge through diodes D1' and D2', respectively, where capacitor C7' is a sensor capacitor constructed of a capacitor C8' and a capacitor including the capacitive probe C9' connected in parallel and capacitor C6' is a reference capacitor.

Capacitor C7' is similar in function to capacitor C4 of the previous embodiments and is the sensor capacitor wherein the two conductive surfaces of the capacitor are probe C9' and the residual ground of the receptacle through its mounting arrangement. The dielectric of the capacitor is the fluid in the receptacle such that the capacitance value of the capacitor comprised of C9' and the conductive grounded portion of the receptacle, and hence the combined capacitive value C7' varies relative to the fluid level in the receptacle.

In the illustrative embodiment, the capacitive probe C9' for use in oil level sensing is a wire, such as a 22AWG wire with approximately 7-11pf capacitance. For water sensing, the illustrative 22AWG wire has 0.12 inch outer diameter of insulation and has a capacitance of approximately 5-20pf.

The capacitance value of capacitor C6' is adjustable to match the value of capacitor C7' when a predetermined liquid level is sensed.

When the voltage from the oscillator circuit at test point 1' (TP1') makes a transition from positive to negative, capacitors C7' and C6' begin to discharge through resistors R9' and R10', respectively. It is the difference in voltage decay across resistors R9' and R10' due to the capacitance values of capacitors C7' and C6' which enables the circuit to determine the level of fluid in the receptacle.

The voltage comparator A2' compares the voltage at test point 2' (TP2') with the reference voltage set by resistors R2' and R3'. FIGS. 6B and 6C illustrate that when the voltage at TP2' decreases below the reference voltage determined by the voltage divider R2' and R3', due to the discharge of capacitor C7', the output of the comparator A2' reference voltage at TP3' drops to zero.

The time between the point where capacitor C7' begins to discharge and the output of the comparator A2' drops to zero is used as a reference time T. Similarly, the comparator A3' compares the square wave output of the comparator A2' with the voltage decay signal across resistor R10' due to reference capacitor C6' at test point TP4'.

As shown in FIGS. 6C-6E, if the discharge time of reference capacitor C6' is longer than the reference time T established by the comparator A2', the output of the comparator A3' remains high. Conversely, if discharge time of reference capacitor C6' is shorter than reference time T, due to a faster discharge rate in C6', the output of the comparator A3' pulses low for a period of time in which the discharge voltage at TP4' is less than the output voltage of the comparator A2' (TP3').

In application, this pulse is actually a current pulse rather than a voltage pulse. A diode D3' is connected to test point 3' (TP3') to increase the temperature stability of the device.

The output of the comparator A3' is an open collector type output which allows capacitor C5' to charge through resistors R14' and R16'. If the output of A3' pulses low, capacitor C5' discharges to ground and the voltage at test point 5' (TP5') goes to zero.

The combination of resistors R14', R16', and R17' and capacitor C5' act as an integrator whose output is the input to the base of a transistor TR1' which is a first transistor in an emitter-follower pair including TR1', TR2' and resistors R18', R19', and R20'. The integrated voltage at testpoint 5' (TP5') determines the amount of current flowing through transistor TR2' to ground.

The resulting voltage drop across resistor R20' determines the voltage between test point 6' (TP6') corresponding with output 01, and ground. In the embodiment shown, this output is substantially linearly dependent upon the pulse width of the negative going signal present at testpoint 1' (TP1') and hence is substantially proportional to the relative decay times of capacitors C6' and C7'.

In turn, since the relative capacitances between C6' and C7' is proportional to the amount of dielectric (fluid) adjacent probe C9' the output voltage at 01 is substantially linearly proportional to the amount of fluid in the reservoir.

The output voltage at testpoint 6' (TP6') is also an input to a comparator A4'. The other input of comparator A4' is determined by a voltage divider made of resistors R21' and R22'. The combination of these resistors provide a reference voltage to the comparator A4' such that when the voltage at testpoint 6' (TP6') is less than the reference voltage produced by the divider R21' and R22', the output of the comparator A4' is zero.

The output of the comparator A4' is the base voltage of a transistor TR3' and hence determines whether current flows through transistor TR3' by way of resistor output 02 and can be used to control the switching on and off of an indicator light or such in response to the fluid level determined by C7' being below a predetermined amount.

By choosing various values of resistors R21' and R22' or alternatively by using a variable resistor for R21' or R22', the setpoint at which the transistor conducts and hence provides an output voltage at output 02, can be varied.

Although the illustrative embodiment has been described herein as incorporating transistors, one of skill in the art can appreciate that other switching means, such as FETs or mechanical switching means can be similarly substituted therefor.

While in one embodiment a probe is indicated herein as being a wire of a certain gauge, it can be appreciated that other wire sizes or probe means can be used in the present design.

Although the design has been shown and described with respect to exemplary embodiments thereof, various other changes, omissions and additions in form and detail thereof may be made therein without departing from the the spirit and scope of the design.


Click here for more project ideas.

New! Comments

Have your say about what you just read! Leave me a comment in the box below.



Claim Your: Useful

"Arduino Software Guide"

   Right Now...





Jump from the capacitive fluid level sensor page to
Best Microcontroller Projects Home Page.


Privacy Policy | Contact | About Me

Site Map | Terms of Use



518-2545


Visit our Facebook Page:

   Click Here



Sign up for MicroZine
''The'' Microcontroller Newsletter

Enter your first Name and primary email address in the form below:


And receive absolutely FREE a full project for:

"Measuring Analogue Voltages
Without An ADC"

(Using only one pin).

Instant Download:
You Can
Get It Right Now

Warning: This project could be  Removed 
at any time.  

It will  NOT be 
available indefinitely SO
To avoid 
disappointment  get it:

Now



:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine
Remember this is a project with full description and fully debugged C Source code - and it's not available from the main website.

You can only get it through this newsletter.

To get exclusive access Enter your first name Name and primary email address Now in the form above.:



But wait !

There's more...

You'll receive more
free and exclusive reports as well as site information and site product updates


Scroll up to the form above and sign up NOW. Don't forget it's FREE and if you don't like it, you can unsubscribe at any time.

Click Here Now to use the form above to get your Valuable information absolutely free.



Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's

SUPERB and FANTASTIC."

- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan

bursach<at>gmail.com<

"Awesome site,
very, very easy and nice
to navigate!"


- Matt
matt_tr<at>
wolf359.cjb.net


Learn Microcontrollers

"Interested in
Microcontrollers?"

Sign up for The
Free 7 day guide:

FREE GUIDE : CLICK HERE


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."


- Dave

de_scott<at>bellsouth.net

"Your site is a great
and perfect work.
congratulations."


- Suresh

integratredinfosys<at>
yahoo.com

"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.
Regards."


- Anon

Recent Articles

  1. How to use the DHT22 (or DHT11) with an Arduino; full code and description. Also including a comparison of the DHT11 vs DHT22.

    The Essential Guide to the DHT22/11 humidity sensor including a library code guide for the Arduino. Learn how to determine Humidity, Dew point and Heat Index.

    Read more

  2. How to Use the MAX7219 to drive an 8x8 LED display Matrix on the Arduino.

    The Essential Guide to the MAX7219; What it is and how you can easily use one in any of your projects.

    Read more

  3. How to use a DS18B20 (single or multiple on one wire) for temperature measurement using the Arduino Uno.

    How to Easily Use the DS18B20 Maxim One-Wire thermometer with Arduino example code showing external or parasitic power modes.

    Read more