Water level sensor?

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I am a novice with this sort of thing. I bought an STK500 about a week ago and have managed to work out some basic stuff so far.

I am working on a controller which needs to detect when a water level gets to a certain point. I was thinking of making a sensor with 2 stainless steel probes in it and check for electrical conductivity between the probes to know when it is wet or dry. I am not sure of the best way to check if the sensor is wet or dry. I am going to use a Tiny13 and there is going to be about 2m of wire between the Tiny13 and the sensor. I was thinking I could put VCC to one probe, the connect the other probe to an ADC pin on the Tiny13 and use ADC to see if any current flows. Would this work? Or would there be some other circuit I could use at the sensor that will allow me to just check whether the input pin is high or low?

Any advice will be appreciated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a link I found with Google that may help.
http://www.discovercircuits.com/...

This link is the water level sensor section of the above page.
http://www.discovercircuits.com/...

-Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How pure is the water? If it's too clean, it's an insulator, and must be detected by other means.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Taipan wrote:
Would this work? Or would there be some other circuit I could use at the sensor that will allow me to just check whether the input pin is high or low?

Any advice will be appreciated.

Taipan,

Yes it would work! It might take a bit of fiddling to get it just right, but for a beginner water detector what you have described is okay.

Do you want a binary (two state) result? (i.e. Water low and water high), or do you want a continuous guage of water level? (litres, cm / gallons, inches). A fuel guage on a car is a good example of the latter.

Beyond the demonstration stage this might not be a good solution for many reasons. Firstly, the liquid is part of the electrical circuit (and may pose some safety concerns), and pure water does not conduct electricity, so your detector may never trip. Secondly, the water (or it's other chemicals) may destroy the probe over time due to corrosion or contamination of the probe's surface. A lot of effort is made to keep water out of metal and electrical systems!

An alternative scheme could use a float in the water to find the level, and it in turn blocks a photo-sensor. This is a non-contact system where there are no moving parts (except the float) and no electrical contact with the liquid. The float needs to be opaque (a rubber 'cork'?) and could ride loosely in a plastic tube that's open at the top. A hole drilled in one side of the tube would contain a photo sensor (photodiode) and an LED in the opposite hole. When the float is low the LED lights the photodiode and signals 'normal' to the uC. If the float rises (or the LED fails or the power fails) the signal is lost and indicates a 'fault' to the uC.

You'd only need three wires to the uC (Power, Gnd, Signal).

Another scheme uses a pressure sensor in an enclosed tube. As the liquid rises the pressure trips the sensor. This also has no electrical contact with the liquid or moving parts.

Let us know what you come up with!

Peter

--
Peter J. Stonard
www.stonard.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All the water sensor I have come across use AC to the probes to avoid oxidation.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mneary wrote:
How pure is the water? If it's too clean, it's an insulator, and must be detected by other means.

The water will have dissolved salts so it will conduct electricity to some dgree.

bigglez wrote:

Do you want a binary (two state) result? (i.e. Water low and water high), or do you want a continuous guage of water level? (litres, cm / gallons, inches). A fuel guage on a car is a good example of the latter.

All I need is a simple (two state) result. Is it wet or dry.

I'll have a think about the other ideas, but there will be advantages for me in using the sensor I described. That was why I was wondering if I should use some other electronics at the probe that can signal an on/off state, possibly through an opto isolator?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
All the water sensor I have come across use AC to the probes to avoid oxidation.

I have seen a similar probe to what I am thinking of use carbon rods instead of stainless steel, would this avoid the oxidation problem?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi
i also would recommend to use AC.

Not only because of oxidation:
As said before the conductivity of water changes very much with the minerals (salt...) in it. This would give you an error.
About temperature dependency I don´t know.
But is you measure with AC (hig enough that NO DC current flows) then you can measure the capacitance between your two electrodes.
Because e_r of water is very high you will get good signal.

What you would try:
create an R-C oscillator with the "C" is you two electrodes and a much bigger C (foil) in series to avoid DC currents.
The output frequency is water level dependent. This you simply can measure using an AVR counter input.
The lower the frequency, the higher the voltage level. Because f ~ 1/level calculation may be difficult.
But you can do it the other way round. Measure the time until the couter counts to a constant value.
The time may me about proportional to your water level (but with offset)
I´ve never tried it - but maybe it´s worth to do so...

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about this simple solution:
http://www.webx.dk/oz2cpu/waterp...
I made this a few years ago, it still runs perfect.

Yours: Thomas Scherrer - Denmark
OZ2CPU www.webx.dk

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MegaUSBFreak wrote:

What you would try:
create an R-C oscillator with the "C" is you two electrodes and a much bigger C (foil) in series to avoid DC currents.
The output frequency is water level dependent. This you simply can measure using an AVR counter input.
The lower the frequency, the higher the voltage level. Because f ~ 1/level calculation may be difficult.
But you can do it the other way round. Measure the time until the couter counts to a constant value.
The time may me about proportional to your water level (but with offset)
I´ve never tried it - but maybe it´s worth to do so...

Sounds good MegaUSBFreak but I am really a novice and most of what you suggested went over my head. I'll do a bit of experimenting with some ideas and see how I go.

ThomasScherrer wrote:
How about this simple solution:
http://www.webx.dk/oz2cpu/waterp...
I made this a few years ago, it still runs perfect.

Thanks Thomas, that is a great example. I have to study up on electronics a bit, I am having a bit of trouble understanding how the components do their job, but I have quite a few ideas to try now.

Thanks for all your help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you use a smal PTC and a constant current source. The point are:

If the PTC is in the water, the cooling holds the R low. PTC in air, mo cooling, the R are warmed and rhe R rais -> rhe voltage across rais and so do the power, forcing more heating.

HM

HM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mossige wrote:
If you use a smal PTC and a constant current source. The point are:

If the PTC is in the water, the cooling holds the R low. PTC in air, mo cooling, the R are warmed and rhe R rais -> rhe voltage across rais and so do the power, forcing more heating.

HM

Please excuse my ignorance, I don't understand what you mean here. Is a PTC some sort of sensor?

edit:- OK I get it now, a thermistor where the R goes up with temperature. This could be a bit difficult to utilise as some uses may involve warmed water and other may not, as well the water temp will vary a lot throughout the year. I also need almost instant recognition of the wet/dry condition. It's another possibility though, thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Taipan wrote:

Please excuse my ignorance, I don't understand what you mean here. Is a PTC some sort of sensor?

edit:- OK I get it now, a thermistor where the R goes up with temperature. This could be a bit difficult to utilise as some uses may involve warmed water and other may not, as well the water temp will vary a lot throughout the year. I also need almost instant recognition of the wet/dry condition. It's another possibility though, thanks.

Taipan,

Correct! PTC = Positive Temp Coefficient. Ideal components have little or no temperature dependence, others do. There's also NTC.

If the temp of the water varies by season or time of day you could install two temp sensors. One gets wets (on high water) while the other monitors the air temp.

On low water level both sensors give the same reading, and could be cancelled out electronically. This takes out the seasonal (daily) variation.

One method would be to digitize each channel and subtract the data, another method would do it in analogue at the sensor circuit with a difference amplifer (trival with today's monolithic op amps).

I think poster "mossige" suggested to use a PTC and passing a fairly high current through the thermistor, creating self-heating, and placing it above ambient temp. When the liquid rises it draws off the heat and the thermistor's resistance falls enough to trip your alarm. At low liquid level the exposed PTC will self-regulate at a higher and steady temp (actual value is not important).

Trivia: Back-to-back PTC and NTC thermistors are found in CRT TV sets and monitors to give a deguassing action (to the CRT) at power on. After a few seconds the self heating keeps slowly draws them out of the circuit and also requires a rest period before another cycle, even if the power switch is operated quickly.

Comments Welcome

Peter

--
Peter J. Stonard
www.stonard.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A different approach, if it's okay to drill a hole in the thing that holds the liquid:

Attachment(s): 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
A different approach, if it's okay to drill a hole in the thing that holds the liquid:

I can drill a hole, but I don't have the space for a float switch. That was my original thought, but if I go with some sort of probe type sensor I can mount it almost flush with the inside of the container.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would help to know more info about your container. size, material, etc ...

The most reliable I've found is a combination float/ photosensor.
The basic idea is to place your sensor above the max water line and use a float that would actually trip the photoeye. This keeps the electric out of the water and gives immunity to the cleanliness of the water.

Mike H.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The container will probably be something like a 20L bucket. I know no system is foolproof, but I am concerned about the float getting stuck in the tube with the float/photosensor idea. Not that it is likely but possible if some grit or something fouled the water. I am waiting on a few components that should arrive next week and I'll start experimenting. I'll post what I try and the successes of each.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

You can use the same principle to a hot water kettle that has a bead in the vertical column.
Then the bead can be shape of a long rod & use the opto to sense it.
Ultrasonic sensors can be made to measure the height of the water.

Or what about a float that mounted on a pulley arrangement couple to a potentiometer.

Ken

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I really know very little about electronics as you will see from these questions. I am trying to learn as I go. For my first experiment I used a 240VAC to 8.5VAC transformer that can supply 1A. I ran the 8.5VAC through 2 probes in a glass of water, and then through a bridge and LM7805 and I got 3.0V DC out the other end. So I think I can successfully use this method for my probes.

What I need to know is how I make sure that this 8.5VAC running through this water is safe if someone puts their hand in the water? Should I run it through a resistor to make sure, and if so how do I know what size resistor?

On the input of the Tiny13 I need to make sure it is not going to get overloaded, and there is always the possibility that a faulty pump was placed in the water and 240VAC goes straight into the water. So I am going to use an optoisolator with a 5V regulated supply going through it to the Tiny13. What size resistor is required so I don't send too much current into the Tiny13?

You advise is much appreciated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just bought an Ultrasonic transceiver for that very purpose for a water tank. Can measure between 25 feet and 18 inches. http://www.emssensors.com.

Output is a lovely 0V to 5V or 4-20mA depending on what you want.

cheers!
Paul

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just use AKO-53180 or AKO-53170 families for conductivity liquids control or AKO-53190 for ultrasonic level control. http://www.ako.com

Guillem.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Taipan wrote:
Hi, I am a novice with this sort of thing. I bought an STK500 about a week ago and have managed to work out some basic stuff so far.

I am working on a controller which needs to detect when a water level gets to a certain point. I was thinking of making a sensor with 2 stainless steel probes in it and check for electrical conductivity between the probes to know when it is wet or dry. I am not sure of the best way to check if the sensor is wet or dry. I am going to use a Tiny13 and there is going to be about 2m of wire between the Tiny13 and the sensor. I was thinking I could put VCC to one probe, the connect the other probe to an ADC pin on the Tiny13 and use ADC to see if any current flows. Would this work? Or would there be some other circuit I could use at the sensor that will allow me to just check whether the input pin is high or low?

Any advice will be appreciated.

Water detectoror OR Water Level detector?
one method of detecting if water has reached a certain level is to use a thermistor mounted at the level so that it will come in contact with the water. some current is used to 'excite' the termistor so that its body temperature is slightly warm. you can measure its temperature crudely by measuring its voltage drop fir the given excitation current and sense when the temperature drops due to the increased thermal mass (and lower temperature) of the water.

DFR