# Modeling water probe in LTspice

#### ebeowulf17

Joined Aug 12, 2014
3,306
TLDR:
I need advice on modeling water conductivity. Can it be modelled primarily as a simple resistance, or are capacitance and inductance high enough to be significant factors? Are there non-linear properties (will the apparent resistance or impedance be totally different depending on what voltage and/or current you use to test it?)

Full description/background:
I'd like to create a simple, crude, ballpark-approximation model of water conductivity in LTspice. This is tap water (ideally, filtered and de-chlorinated) and depending where in the world a machine is being installed, it might have TDS ranging anywhere from 50-75 ppm TDS (Seattle has great, fairly pure water) through 300-350 ppm TDS (Midwest, harder water, but not horrible) up to much higher levels where the water gets kind of gross and I'd rather not think about it!

I'm currently working on analyzing several different circuits that are all meant to detect water level in a tank. To be clear, the circuit only needs to determine whether water is touching a metal probe or not, not determine how full it is with any greater precision than that. Simple boolean state: water is high enough to touch probe or not.

In all of the circuits in question, the tank is metal, it is connected to the circuit common(ground,) and it is used as part of the detection circuit. The circuits send alternating positive and negative pulses to the probe and then they monitor the voltage at the probe. If there is water touching the probe, the current from the pulse will "ground out," or conduct through the water to the common/ground connection at the tank, resulting in lower voltage at the probe.

I've been toying with all of these circuits in LTspice, but so far I've been modelling the water as a simple resistance anywhere from 10k (maybe too low?) all the way up to 10M. I realized at one point that some of my circuit tweaks that look great in simulation would probably fail miserably if real world water has too much stray capacitance (or maybe inductance too?)

I'd like to improve my water model. Any advice on plausible ranges of resistance, capacitance, inductance, or any non-linearities would be greatly appreciated. Thanks!

#### ericgibbs

Joined Jan 29, 2010
16,364
hi ebo,
Do you have a draft LTS asc file circuit you could post.?
E

#### Irving

Joined Jan 30, 2016
3,128
Water conductivity is mostly determined by the impurities in it. Pure distilled water is supposedly a good insulator.

From https://www.lenntech.com
"Water conductivity
Pure water is not a good conductor of electricity. Ordinary distilled water in equilibrium with carbon dioxide of the air has a conductivity of about 10 x 10-6 W-1*m-1 (20 dS/m). Because the electrical current is transported by the ions in solution, the conductivity increases as the concentration of ions increases.
Thus conductivity increases as water dissolved ionic species.​
Typical conductivity of waters:
Ultra pure water 5.5 · 10e-9 S/m
Drinking water 0.005 – 0.05 S/m
Sea water 5 S/m​
"
So two 1sq cm plates,1cm apart would measure the above as:
ultra pure = 18.1MΩ​
drinking water = 20 - 200Ω​
Sea water = 0.2Ω​

Assuming my maths is correct.

I don;'t think you need to consider capacitive or inductive effects unless the measuring wire is very long and your 'AC' signal is a high frequency.

BTW, why alternating polarity pulses?

#### Alec_t

Joined Sep 17, 2013
13,149
BTW, why alternating polarity pulses?
To minimise electrolytic corrosion of the probe. An alternative would be to use very occasional brief DC pulses.

#### Irving

Joined Jan 30, 2016
3,128
To minimise electrolytic corrosion of the probe. An alternative would be to use very occasional brief DC pulses.
Yes, I thought of that later... or choose the right probe material.

Of course, if the sense voltage/current is low enough (<2v) there won't be any electrolytic action.

Which answers the TS question re linearity/non-linearity... if the voltage is high enough for such action then the conductivity will vary, probably unpredictably. Keep it low voltage and all should be well.

#### LowQCab

Joined Nov 6, 2012
2,502
The "Probe" should be constructed with 2 Stainless-Steel elements,
the larger the surface area of the elements, the better resolution will be,
and will make component selection less critical.

The Elements should be rigidly mounted, and spaced far enough apart to
reduce the likelihood of Water-Droplets remaining
attached to the Elements by Surface-Tension, and possibly creating a bridge between
the Elements when the Water-Level recedes from the Elements.

Do not use the Tank as one of the Elements,
use 2 identical Elements mounted side-by-side.

Keep the Voltage between the 2 Elements at or below 1-Volt to avoid any Plating issues.
.
.
.
.
.
.

#### ebeowulf17

Joined Aug 12, 2014
3,306
hi ebo,
Do you have a draft LTS asc file circuit you could post.?
E
There's really nothing to see there. I'm not really looking for advice on the level sensing circuit itself (at least not yet,) but just looking for advice on how to model the resistance/conductivity of the water.

All I'm using to simulate water at the moment is a resistor. I could upload a schematic of a single resistor, but you probably wouldn't appreciate it!

#### ebeowulf17

Joined Aug 12, 2014
3,306
Water conductivity is mostly determined by the impurities in it. Pure distilled water is supposedly a good insulator.

From https://www.lenntech.com
"Water conductivity
Pure water is not a good conductor of electricity. Ordinary distilled water in equilibrium with carbon dioxide of the air has a conductivity of about 10 x 10-6 W-1*m-1 (20 dS/m). Because the electrical current is transported by the ions in solution, the conductivity increases as the concentration of ions increases.​
Thus conductivity increases as water dissolved ionic species.​
Typical conductivity of waters:
Ultra pure water 5.5 · 10e-9 S/m​
Drinking water 0.005 – 0.05 S/m​
Sea water 5 S/m​
"
So two 1sq cm plates,1cm apart would measure the above as:
ultra pure = 18.1MΩ​
drinking water = 20 - 200Ω​
Sea water = 0.2Ω​

Assuming my maths is correct.

I don;'t think you need to consider capacitive or inductive effects unless the measuring wire is very long and your 'AC' signal is a high frequency.

BTW, why alternating polarity pulses?
Thanks for the reference and calculations.

One of my problems when understanding water specs is that the units of conductivity have never made sense to me. Intuitively, it seems like conductivity would drop with longer distances and go up with larger cross sectional areas... so there would be three dimensions involved, but the units are siemens/meter, which sounds like only one dimension.

After reading the info at the site you linked, a few things started clicking. I just reread some of the Wikipedia descriptions of conductance and conductivity, and it's finally starting to make sense; area and distance are all involved, but things cancel out such that only one linear dimension appears in the units. It's not at all intuitive to be written this way, but I think I finally get it now. Thanks for pushing me in the right direction!

#### ebeowulf17

Joined Aug 12, 2014
3,306
Yes, I thought of that later... or choose the right probe material.

Of course, if the sense voltage/current is low enough (<2v) there won't be any electrolytic action.

Which answers the TS question re linearity/non-linearity... if the voltage is high enough for such action then the conductivity will vary, probably unpredictably. Keep it low voltage and all should be well.
Very interesting point about low voltage keeping things in the linear region. That makes sense now that you've pointed it out.

All of the circuits we've used or modelled for possible future use had 3.3V supplies driving the pulses. However, with the pulses being fed through small caps and large-ish resistors, the available current for the probe is quite low. As such, I don't think the probe gets anywhere near 3.3V when water is touching it, only when it's dry.

Presumably this means we're still safely avoiding electrolytic activity/electroplating action, as long as the probe voltage, when wet, stays below 1-2V?

#### ebeowulf17

Joined Aug 12, 2014
3,306
The "Probe" should be constructed with 2 Stainless-Steel elements,
the larger the surface area of the elements, the better resolution will be,
and will make component selection less critical.

The Elements should be rigidly mounted, and spaced far enough apart to
reduce the likelihood of Water-Droplets remaining
attached to the Elements by Surface-Tension, and possibly creating a bridge between
the Elements when the Water-Level recedes from the Elements.

Do not use the Tank as one of the Elements,
use 2 identical Elements mounted side-by-side.

Keep the Voltage between the 2 Elements at or below 1-Volt to avoid any Plating issues.
.
.
.
View attachment 274541.
.
.
Why are you so adamantly against using the tank itself as one of the conductors? There are zillions of machines out there that work this way and seem to "work fine."

I'm not disagreeing with you - I don't doubt that it's better to have two separate probes and not rely on the thank... but if that's the case, could you tell me why? What are the disadvantages of using the tank this way? I'd like to understand the pros and cons, not just follow directions without learning why/how things work.

#### LowQCab

Joined Nov 6, 2012
2,502
"" To be clear,
the circuit only needs to determine whether water is touching a metal probe or not, ............ ""

If this is the case, You don't need to know about the
wild unpredictability of the conductivity of Water.

You have "unknown-Water", presumably loaded with Minerals, and "no-Water".
So it's easy to make a further assumption, and imagine that You are
concerned with consistency of operation, and interfacing, with a Micro-Controller.

As far as using the Tank goes ......
this simply adds a large number of variables into the equation,
and generally increases the Voltage required for a definitive Signal.

Also, running a single High-Impedance-Wire to the Tank creates a really good
Antenna for picking-up Electrical-Noise,
this means that more attention must be paid to insuring that the Sensor-Input is well filtered.
You will also be depending upon an undefined Grounding arrangement to the Tank,
which could also be another source of Noise,
and, under worst-case conditions,
could even develop a Voltage-Potential "above or below Ground"
that could smoke the Sensor-Input-Circuitry.

If the environmental conditions are not known and specifically controlled,
it's a good idea to bypass potential problems, and simply run
a separate Sensor-Ground-Wire, which should be in the form of a Shielded, Twisted-Pair, Cable.
This will also add additional protection against physical damage -vs- a single-Conductor.
.
.
.

#### Irving

Joined Jan 30, 2016
3,128
Thanks for the reference and calculations.

One of my problems when understanding water specs is that the units of conductivity have never made sense to me. Intuitively, it seems like conductivity would drop with longer distances and go up with larger cross sectional areas... so there would be three dimensions involved, but the units are siemens/meter, which sounds like only one dimension.

After reading the info at the site you linked, a few things started clicking. I just reread some of the Wikipedia descriptions of conductance and conductivity, and it's finally starting to make sense; area and distance are all involved, but things cancel out such that only one linear dimension appears in the units. It's not at all intuitive to be written this way, but I think I finally get it now. Thanks for pushing me in the right direction!
Conductivity is an intrinsic property of a substance and is spec'd as 'per metre' but you're right its really a 3-dimensional property - the assumption being that it is per metre between 1m sq electrodes. So the value per metre is the same per cm using 1cm sq electrodes. Thus the specific resistance (ignoring edge and spreading effects) is:

R = length of path/(conductivity * area of electrodes) (and now its obvious why its S/unit length)​

#### Danko

Joined Nov 22, 2017
1,441
I'd like to improve my water model. Any advice on plausible ranges of resistance, capacitance, inductance, or any non-linearities would be greatly appreciated. Thanks!
Simple capacitive water level sensor.
Works in with any quality water.
Capacitance between dry electrodes may be 0.46 - 23.6 pF.
Capacitance of fully immersed electrodes is 36...1850pF.
Capacitance of immersed probe on diagrams changes in range 0 - 50 - 0 pF.
EDIT:
Circuit enhanced.

#### Attachments

• 2.8 KB Views: 0
Last edited:

#### prairiemystic

Joined Jun 5, 2018
290
I find those wet capacitance values out to lunch- the "double-layer" effect generates huge capacitance with wet electrodes.
Simply measure their capacitance if you don't believe me. I easily get many uF and thus use lower frequency excitation, even a few kHz is plenty.

#### Danko

Joined Nov 22, 2017
1,441
I find those wet capacitance values out to lunch- the "double-layer" effect generates huge capacitance with wet electrodes.
Simply measure their capacitance if you don't believe me. I easily get many uF and thus use lower frequency excitation, even a few kHz is plenty.
Supercapacitance. About 20 μF / sq.cm.
It is true for electrolytes, does not matter water or some
other polar liquid is used as solvent.
For universal water sensor we should hope only on
dielectric constant of water (78.4).
Dielectric Constant of Water from 0 0 to 100° C C. G. Malmberg and A. A. Maryott
Experiment with capacitor in water.
No additional capacitance from double-layers was noticed.

Last edited:

#### prairiemystic

Joined Jun 5, 2018
290
I don't agree with your 80-1,600pF values because they are two orders of magnitude lower and I was using deionized water. Tap water was also high capacitance in the uF range with a multimeter-sized probe of stainless steel. Again, if you don't believe me, just measure the capacitance. But it doesn't matter really, you can make changes to frequency and coupling capacitance on your circuit for higher probe capacitance.
I think a polar dielectric does not matter (compared to non-polar) because we are using AC excitation.
Water effectively makes a super cap due to the double-layer. This is how you build a model in the first place, taking real-world measurements. I also had done modelling of electrode size and spacing, as part of water sensing in commercial designs.

#### ebeowulf17

Joined Aug 12, 2014
3,306
Hey everybody, thanks for all the insights and example circuits so far. Sorry for the slow response on my end - been way too busy at work, and haven't had time for fun forum action!

Yes, I thought of that later... or choose the right probe material.

Of course, if the sense voltage/current is low enough (<2v) there won't be any electrolytic action.

Which answers the TS question re linearity/non-linearity... if the voltage is high enough for such action then the conductivity will vary, probably unpredictably. Keep it low voltage and all should be well.
The "Probe" should be constructed with 2 Stainless-Steel elements,
the larger the surface area of the elements, the better resolution will be,
and will make component selection less critical.

The Elements should be rigidly mounted, and spaced far enough apart to
reduce the likelihood of Water-Droplets remaining
attached to the Elements by Surface-Tension, and possibly creating a bridge between
the Elements when the Water-Level recedes from the Elements.

Do not use the Tank as one of the Elements,
use 2 identical Elements mounted side-by-side.

Keep the Voltage between the 2 Elements at or below 1-Volt to avoid any Plating issues.
.
.
.
View attachment 274541.
.
.
@Irving and @LowQCab, you both talked about keeping voltage low to avoid certain electro-chemical effects, and I'm curious to learn a bit more about this. Am I right in thinking that the voltage threshold for such activity is related to standard electrode potentials for various elements, such as those listed in this wikipedia page? If so, I see that the electrode potentials don't really stop below any particular voltage; there are plenty of elements with potentials much smaller than +/-1V. Are the 1V or 2V thresholds you've each suggested based on knowledge of which minerals are likely to be found in drinking water (and equally important, which elements can safely be ignored when discussing drinking water)? Or, am I misunderstanding the origin of these proposed thresholds?

"" To be clear,
the circuit only needs to determine whether water is touching a metal probe or not, ............ ""

If this is the case, You don't need to know about the
wild unpredictability of the conductivity of Water.

You have "unknown-Water", presumably loaded with Minerals, and "no-Water".
So it's easy to make a further assumption, and imagine that You are
concerned with consistency of operation, and interfacing, with a Micro-Controller.

As far as using the Tank goes ......
this simply adds a large number of variables into the equation,
and generally increases the Voltage required for a definitive Signal.

Also, running a single High-Impedance-Wire to the Tank creates a really good
Antenna for picking-up Electrical-Noise,
this means that more attention must be paid to insuring that the Sensor-Input is well filtered.
You will also be depending upon an undefined Grounding arrangement to the Tank,
which could also be another source of Noise,
and, under worst-case conditions,
could even develop a Voltage-Potential "above or below Ground"
that could smoke the Sensor-Input-Circuitry.

If the environmental conditions are not known and specifically controlled,
it's a good idea to bypass potential problems, and simply run
a separate Sensor-Ground-Wire, which should be in the form of a Shielded, Twisted-Pair, Cable.
This will also add additional protection against physical damage -vs- a single-Conductor.
.
.
.
Thanks for the clear and detailed explanation about the down-sides of using the tank as the return path instead of having a dedicated 2nd probe. That all makes a lot of sense and is useful information for future reference. I think my current project is already too far along and is stuck with the single probe approach, but now I know the factors to consider for future projects (and possible explanations if things go wrong on this one!)

Simple capacitive water level sensor.
Works in with any quality water.
Capacitance between dry electrodes may be 1- 20 pF.
Capacitance of fully immersed electrodes is 80...1600pF.
Capacitance of immersed probe on diagrams changes in range 0 - 50 - 0 pF.
EDIT:
Circuit enhanced.
View attachment 274625
This is very intriguing. I wasn't previously aware of immersed capacitive water sensing like this. I'm interested in learning more about it. My first few google searches on the subject yielded sensors and systems that claim to detect analog ranges of water levels, not just boolean high/low like I've asked for here, and I wonder how much calibration those setups require, how much they're affected by mineral content in the water, etc.

As for the specifics in yours example, I see that you suggest a very wide range of possible capacitance values for fully immersed probes (80-1600pF.) What are the main factors in determining what value you could actually expect in any given situation? Are those values affected by water chemistry, or is it more a question of probe spacing, geometry, etc?

For my current project, I only need boolean output, but there is a possibility that I would need an "analog" level sensor for another project in the next few months, and this looks like a good starting point. Thanks!

#### Danko

Joined Nov 22, 2017
1,441
Am I right in thinking that the voltage threshold for such activity is related to standard electrode potentials for various elements, such as those listed in this wikipedia page? If so, I see that the electrode potentials don't really stop below any particular voltage; there are plenty of elements with potentials much smaller than +/-1V. Are the 1V or 2V thresholds you've each suggested based on knowledge of which minerals are likely to be found in drinking water (and equally important, which elements can safely be ignored when discussing drinking water)? Or, am I misunderstanding the origin of these proposed thresholds?
Yes, you are right. Thresholds are defined by electrochemical potentials of ions.
See attachment.
This is very intriguing. I wasn't previously aware of immersed capacitive water sensing like this.
This sensor was designed especially for your case, because capacitance of immersed sensor is stable
and independent from level of water impurity.
As for the specifics in yours example, I see that you suggest a very wide range of possible capacitance values for fully immersed probes (80-1600pF.)
As you can see on diagram in post #13, circuit is ON at 36 pF and becomes OFF at 23.6 pF,
therefore minimal capacitance of dry sensor should be more than 36 pF/78.4=0.46 pF
and maximal capacitance of dry sensor should be lower than 23.6 pF.
Numbers 80-1600 pF are from first, discarded variant of circuit, I will change them.

Below is model of water sensor I use.
Resistance R defined by ions concentration.
Capacitance C2: for electrodes area = 4,5 sq. in and separation distance between plates = 0.1 in,
capacitance of dry electrodes is 10.12 pF, immersed 10.12pF*78.4=793.4 pF.
Capacitance C1= capacitance C3 ≈ 1160 μF (each of them is double electrical layer).

#### Attachments

• 6.8 MB Views: 4
Last edited: