Arduino Forum

Topics => Home Automation and Networked Objects => Topic started by: shantanuonline on Nov 20, 2018, 10:55 pm

Title: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Nov 20, 2018, 10:55 pm
Hi,

I have been using an Overhead Water Tank Level Indicator and Motor control system based on IC 4049 from last 2 years which was working fine and I thought to have it upgraded to be Controlled by Arduino so that I can enhance the system with some more logics. I did my research for few weeks and finally able to make it with Arduino Nano and Implement the system and it work exactly as I was expected.

Now after 2 weeks of daily use suddenly it just stopped behaving in the way it was made for so after some investigation I found the sensor reading is not stable and started fluctuating from 0 to 1 and vice versa.

Talking about the sensor it just a 5 feet PVC pipe with four steel screws at 4 different levels and one steel screw for +VCC at the bottom and I have managed to seal the PVC pipe in such a way that water cannot enter inside and damage the wire/joints at over the period of time. This might be the best option but I am ok to clean/replace it in few years and it's cost effective.

The reason it stopped working after 2 weeks is because I was using 2 year old sensor which was with Iron screws and telephone line copper cable wrapped "outside" of PVC pipe which was completely burned out because of corrosion but I am not sure why now it is not working with the new sensor setup with steel screws I have described above. To be more precise here, everything works fine with short cable length of 1 feet or less but not when I connect 30 feet CAT5 cable as sensor values just float around.

I am using Arduino Nano with external 10k Pull-down register at pin 9 to 12 and cat 5 cable of around 30 feet attached with the sensor setup described above. I have just downloaded the Fritzing app to make the schematic but yet to see how to make one, if needed I will make the schematic and attach it.

Here are my findings so far:

1. SOMETIME new sensor reading are stable with both short cable length and long cable length wire when the system is powered by my laptops 3.0 USB port running on batteries but its start floating when I attach the laptop charger. Same happens when the system is powered by 5 volt smartphone wall charger. Using of less or high ampere charger does not have any effect here.
 
2. I have to use both Arduino's Internal Pull-up and External pull-down register ate same time for each pin to get it work which should not be the case I believe.

3. Because of the long wire I have tried to change the External pull-down values from 10k to 1k but it just stop reading values form sensor.

My code is too long to post here and also irrelevant to the actual problem so for debugging I am using below simple and short code nowadays and hoping it to work.

After going through all the section of the forum I have chosen this section to post my question , If this is not the correct section of forum please let me know.


Any help will be appreciated.

Thanks
Shantanu


 
Code: [Select]

#define forthLevel    9
#define thirdLevel    10
#define secondLevel   11
#define firstLevel    12

void setup() {

  Serial.begin(9600);
  pinMode(firstLevel, INPUT_PULLUP);                                        //PULLUP to avoid floating values when input is low, addition 10 k register is connected between
  pinMode(secondLevel, INPUT_PULLUP);                                       //each pin and ground
  pinMode(thirdLevel, INPUT_PULLUP);
  pinMode(forthLevel, INPUT_PULLUP);

  digitalWrite(firstLevel, HIGH);
  digitalWrite(secondLevel, HIGH);
  digitalWrite(thirdLevel, HIGH);
  digitalWrite(forthLevel, HIGH);
}

void loop() {

  int firstLevelReading = digitalRead(firstLevel);
  int secondLevelReading = digitalRead(secondLevel);
  int thirdLevelReading = digitalRead(thirdLevel);
  int forthLevelReading = digitalRead(forthLevel);

  Serial.println("--------Status--------"); //reading it via Putty from my laptop.
  Serial.print("firstLevelReading - ");
  Serial.println(firstLevelReading);
  Serial.print("secondLevelReading - ");
  Serial.println(secondLevelReading);
  Serial.print("thirdLevelReading - ");
  Serial.println(thirdLevelReading);
  Serial.print("forthLevelReading - ");
  Serial.println(forthLevelReading);
  Serial.write(27);       // ESC command
  Serial.print("[H");     // cursor to home command

}
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Nov 21, 2018, 03:09 am
You may find that your water supply is earthed (connected to the same ground potential as your computer or Arduino power supply), thus effectively short-circuiting the supply if VCC is immersed in the water. Even if it is not earthed by design, the water in the tank may be at an unpredictable potential with respect to the supply voltage which is almost certainly ground-referenced.   

Either situation can fully explain the problem you are encountering.

You could try isolating the tank water from ground (although I suspect that will be difficult or impossible, and may not actually cure the problem, depending on the volume of water).

You could try a fully isolated supply.  I think you have done that with batteries and found that worked.

You could design a probe that does not rely on being immersed in the ground referenced water tank.  There's many options that would allow that.

Steve

Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Nov 21, 2018, 03:22 pm
Thank you for your reply Steve,

Yes i can't isolate the water tank completely but i have stimulated it with a small capacity tank laying in a completely different floor  and different location but the problem remain same.

When powered by battry sometime it work but not always. Sensor value still float around but not very rapidly but it should not float at all by design.


As i indicated earlier,  i have similar setup in past which work for more than 2 year without any complain and now with Arduino its not helping me.

The only alternative  and cheap solutions i can think of is reed switch based magnetic floats but reading    feedback from other people it sound like it does stuck sometime like 2 times out of 100 attempt or so.
Pressure/capacitance/ultrasonics have there own problem's and frankly i just dont want to go in that direction.

Apart from all these, the cheap diy sensor should work but just have to figure out how to stabilize the floating values.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Nov 21, 2018, 08:13 pm
Okay, understood.  Can you provide a schematic of the wiring and connection arrangements?  That will help diagnose the problem. 

Long lines (I don't know how long your signal line is) can introduce capacitance effects and may be subject to external RF that can affect the signal. We may need to look at how to isolate that.  I am using multiple signals into a weather station and these are up to 15 metres in length, but have no interference or irregular readings, so we can fix this.  On long lines I tend to use strong pullup or pulldown resistors (4k7) rather than weak ones (10k, 100k).  I also in some cases use a latch or buffer to stabilise and reconstruct the signal before delivering it to the microcontroller inputs.  Happy to share all that design stuff, but let's isolate the problem you're having. 

A schematic will help me understand.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Nov 21, 2018, 08:19 pm
Sorry, missed the point it is 30 feet of CAT5.  Can I check you are using a true CAT5 pair (white/whiteBlue) for example?  That's important for these signal types.

Dropping the pulldown to 1k will be too much and will affect the input reading range.  I'd not go under 4k7.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Nov 22, 2018, 02:56 pm
Thanks for sticking into this Steve

Please note that my final project involve RTC Clock, Rain drop sensor, single channel relay module, buzzer, push switch, IR module, I2C .96 OLED soldered on  general purpose PCB with a RJ45 socket for CAT5 connection but after the problem I have dismantled all including the sensor and back to solderless breadboard for troubleshooting and just reading the sensor values via putty with the help of the sketch I have mentioned in my initial post , please see attached "Actual Project.jpg" to get an idea what I want to achieve.

CAT5 is UNSHIELDED twisted pair one, see attached "cat5.jpg"

schematic "Sketch.jpg" is attached which is showing the portion on which I am doing the troubleshooting, it's bare minimum to avoid any clash/interface with other components.

I have attached the reference image "Reference Image for Sensor.jpg" inspired from below blog.
<www(.)makingstuff.info/Projects/Water_Level_Sensor_Part_1>  


I have also attached pics from those good days when it was working :) at least 2 weeks.



Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Nov 25, 2018, 09:11 am
Your images do not yet give me an overall picture of the project.  None of these is a schematic diagram.  A schematic shows the electronic components, power supply and all sensors and connections.  I am happy to diagnose from a schematic, but not from separate and incomplete pictures. 

Specifically, the picture of the four pairs of Cat5 is typical, so tells me nothing. Which wire pair are you using for what connections?

In your code, have enabled or disabled the inbuilt pull-up resistors?  If enabled, then you have 10k pullups and 1k pulldowns on the inputs. 

The image of the "actual project" tells me nothing.  I need a full schematic, not a picture. 

I am keen and happy to help, but there is not enough information.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Nov 26, 2018, 11:42 am
ok understood, I will make a start to end full schematic then and show you by coming weekend.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Dec 02, 2018, 11:00 am
somehow I have managed to create full wiring, this is the fist time i am creating such wiring I am not very good in it, if something is not cleat please let me know.

before posting this wiring diagram I have again tested it in breadboard and result are below.

For testing, I submerge +VCC wire in a glass of water then submerge other 4 sensor wires one by one and it shows HIGH values correctly for each pin and values are stable every time, but when i connect the 30 meter long wire in similar way i got HIGH for the 1st level but then it start fluctuating for 2-3 seconds and then freeze at LOW. Putting other 3 sensor wire in glass of water have either dose not show any effect or it just fluctuate form high to low and unstable.


I am not sure if changing the arrangement of CAT5 pairs will have any effect because i have tried different random combination but results were same.

Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Dec 05, 2018, 08:12 pm
I've a couple of thoughts that I want to prove or disprove before we go any further.  Can you please ground (zero volts ) all wires not in use in the CAT5.  Preferably ground all unused wires at both ends.  Do only that as a first check to see if we are dealing with noise on the cable or something else.   
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Dec 10, 2018, 01:54 pm
Okay, i will test it in next few days or by weekend.

Although i did checked one thing in past, connected all unused wire to Arduino GND but did not noticed any difference. The only thing i did not check what you suggested is to GND  both side of unused wires and i will test this and let you know.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: Byork on Dec 14, 2018, 10:51 am
I have seen some very cheap Cat 5 cables from China which have atrocious build quality. The wires weren't even twisted properly, and placed loosely in the sheath. I did not check the wires themselves, but they are probably not made of copper as well. At that length, you might want to consider trying it on a good quality cat5e if all else fails.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Dec 15, 2018, 04:08 am
Byork makes a good point, have you tested with the same arrangements but with short wire?  I mean take the arduino and power supply near  the tank and wire a short connecting wire - if that cure sit, then we are looking at something introduced on the long wire.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Dec 15, 2018, 08:21 am
Hi Byork and steve, thank you for your suggestions
Yes i did check the arrangement with short  wire near the tank and it was working ok, issue start when i connect the wire in question.

My cat5 is of a good quality single thread copper wire from DLINK, but its  2-3 year old wire exposed in open atmosphere and i doubt it may have build some sort of resistance or something so today i am going to buy a new cat5 and will test it and will post result.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Dec 15, 2018, 08:41 am
That's useful info, thanks.  CAT5 is not exterior rated so it's sheathing will fail when exposed to weather or sun.  In addition,  the internal insulation (Polythene) and the make up of the cable (it's tightly twisted but loosely bundled) makes it prone to capillary action which draws moisture along the internal channels.  Water and copper are a bad mix, resulting in what's commonly called verdigris, which causes "low insulation"  which can be tricky to find - and one usually needs an insulation tester or "megger" (essentially a high voltage test meter). 

Low insulation is exactly the kind of thing that can cause the erratic symptoms you are seeing.  Cat5 is cheaper, but fails fast.  If you can, source an external rated, grease filled cable for a lasting solution. 

Out of interest, was the cable out of service for some time before you re-used it?     
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Dec 15, 2018, 09:00 am
My reply on this was strangely disappeared after posting so posting again.

My existing old cable was brand new and i had bought it just for my IC 4049 setup i have described initially and it was hanging outside from then only. Said setup was working on 12 volts and i am not sure if that can disturb any property of cat 5 in longer use.

As you suggested i will see the availability and budget before buying one today.

For sure my next test and investigation on Arduino setup will be on brand new cat5.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: Byork on Dec 15, 2018, 10:03 am
I also have another suggestion. If short wire works, maybe you can also consider using an ESP8266 instead of Arduino. You can leave one ESP near your tank and connect your sensor wires to it, then send the data over to another ESP, where you can connect your LCD etc. I have personally run an ESP-12 in a waterproof enclosure in a garden for 2 months without issue so far.

I have encountered similar problems as you in the past. My Arduino input readings were unstable, because they experienced signal interference from wires. I have many wires cluttered together, reading many sensors going into the Mega. My sensor network was also growing rapidly. So I decided to once and for all to use ESP8266s to transmit data. For me, it has solved all my data communication issues involving having to lay wires over long distances, cluttering mess, interference and managing the sensor network. I now connect my sensor(s) to ESPs, and use them as client nodes. They then transmit the data to my Raspberry Pi as a central server and database. If my project requires a lot of pins, I will still use an Arduino, then connect an ESP-01 to it via I2C to transmit the data.

Something you can consider for the future perhaps.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Dec 16, 2018, 12:17 pm
Yes Byork, that is a good suggestion on adding one ESP on both end for any similar future project.

Steve, now here is what I got with new cable. instead of cat5 now I have brand new DLINK cat6 30 meter cable but i did not noticed any significant change so the issue is remain same with this new wire in existing setup.

But...it looks like to facilitate things with such long and the issue you both have figured out which is long wire/interference/noise I have to do something with my pull down's because when I change the values of pulldown it started stabling the whole system, not fully stable but bit of progress.

Like you talk about 4.7 k before i tried that but no luck, now at this point I don't know what should be the calculation and if I have to use same value registers for all 4 sensor wire,I have replaced all 10 k with 15 k and things started stabling out.

then i have replaced 15 k with 27 k and it show some more stability. I will keep investigating this with different values but it will be great if you or Byork can guide me if this is the right approach of overcoming the issues you both have already figured out and if yes then how should i got to know what will be the suitable value of registers on long run?

like 4 different values for 4 sensors? because with 27 k, first 3 reading are showing correct every time but when i submerge the last sensor in water, the "first sensor" reading start fluctuating, although this is not a big issue because by logic if the value of next sensor is HIGH then by default it can be consider that the value is previous sensor is also HIGH so by changing the logic of code it will work but this is just a workaround and not a solution i believe.

Thanks
Shantanu
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Dec 28, 2018, 06:49 pm
Hi Again,
That was a helpful experiment - good idea.  It has given me an idea I want to test here as well so I'll set up a copy of your set up to try out. 

I'm keen to have a look but it is holiday time here and i might be a week or two.  I am also looking back at the code  along with what we now know about the cable and what the change in resisitance is doing.  I will contact you as soon as I have a chance to do some more work.
Steve
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Dec 30, 2018, 10:53 pm
Hi Shantanu,
I did the numbers and can see why it is variable.  The arrangement I used to work with is your 20,000 (20k) pullup resistors (built-in), turned on by code lines 9-13 INPUT_PULLUP, and 27k external pull-down resistors.  Water resistivity varies a lot, due to changes in temperature, turbidity, mineral content etc.  It will vary with electrical current in the water as well due to the ionisation process introduced by the dc current between the probes.

Let's say the water resistance is somewhere around 18k per 10cm.  The circuit (+5 - probe - gnd) is a voltage divider with 20k probe to vcc and 10k8 probe to ground. The 10k8 is the combined parallel resistance of 18k in the water and 27k external pull down.  Seen this way, the level probe is at about 1.75 volts above ground and 5v vcc is 3.25 volts above the probe. 

Assuming a 10 cm gap, the current in the water will be in the range of 300 microamps. Any change in the water resistance will have an effect on the current, which will drive a change in the voltage seen at the pin, as it is the centre of a voltage divider.

When the AVR reads an input pin, a small but meaningful change in current results, since a small amount of power is consumed to make the reading.  Since your current in the water is so small it may be affected by the read current, causing varying readings.  In addition, the current in the water is ionising the water and that in itself causes a change in resistance which contributes to instability at the probe.

Thinking about how I would proceed, I would remove the INPUT_PULLUP directive and set the pins as INPUT.  I cannot see why your code needs to set the pins HIGH (lines 15 - 18) because it is the same thing as setting the internal pullups on.  I would advise we turn them off. To do that remove lines 15 - 18 and change lines 9 - 13 to   pinMode(firstLevel, INPUT); would also suggest we use an external pull down value that will give us a bit more current in the water - while this will increase ionisation somewhat, it will also reduce any effect during the microprocessor read cycle. I would try either 10k or 4k7 pull downs. (An alternative approach would be to use the internal pullups and discard the external pull down, then measure from ground to pin rather than vcc to pin - I like that approach better, but it makes no technical difference other than removing the potential introduced because the water is grounded as mentioned in earlier posts).

This way, the only factor affecting the readings is the variance of water resistivity.  Since you are only interested in whether the probe is covered or not, then you can interpret the change in pin voltage (which will now be significant) as covered or uncovered. 
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Jan 03, 2019, 12:44 pm
Thinking about how I would proceed, I would remove the INPUT_PULLUP directive and set the pins as INPUT.  I cannot see why your code needs to set the pins HIGH (lines 15 - 18) because it is the same thing as setting the internal pullups on.  I would advise we turn them off. To do that remove lines 15 - 18 and change lines 9 - 13 to   pinMode(firstLevel, INPUT); would also suggest we use an external pull down value that will give us a bit more current in the water - while this will increase ionisation somewhat, it will also reduce any effect during the microprocessor read cycle. I would try either 10k or 4k7 pull downs.
I have tried this in past before moving to 27k pulldowns but it did not work as expected.

Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Jan 03, 2019, 12:55 pm
(An alternative approach would be to use the internal pullups and discard the external pull down, then measure from ground to pin rather than vcc to pin .  

sorry didn't get it, how can I read between ground to pin instead of vcc to pin? I can try it this weekend but it sounds like it will always show "0" ..how come I get "1" ?
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Jan 04, 2019, 05:48 am
That's a good question and it brings up assumptions I made but did not clarify. 

1.   The bottom probe is currently connected to vcc.  In my arrangement we would connect it to ground.
2.   I forgot you are using digital i/o pins (9 - 13). I would use analogue pins (A1 - A4 for example) set to inputs with 'pinmode(A1, INPUT_PULLUP)'. 

The voltage divider approach depends on using analogue pins configured as inputs with pullups.  These pins will return an integer between 0 and 1023, depending on the voltage read at the pin.  In my approach, the lowest probe in the water is connected to ground.  The next probe is connected to analogue pin A1 (let's say) with its pullup set. This pin will be at vcc when it is out of the water due to the pullup.  The pin will read integer value 1023. When that probe is covered by water, the voltage at the pin will be pulled down due to current flow between the pin (driven by the pullup) and the ground probe.  The voltage at the pin will be (referring to my earlier calculation) 1v75 above ground. The analogue read of that pin would give an integer value of 1.75 / 5 x 1024 = 358. 

So, a reading of 1023 (or anything nearly that, say over 1000, would indicate the probe is uncovered, and a reading under 500 would indicate the probe is in the water.

All these estimates are made using the internal pullups with your original 27k external pulldowns.  I'd dispose of the external pulldowns, in which case, the value of 358 (1v75) would be even lower than that, so the difference is even more notable.

I hope this makes sense. I am using this approach with multiple sensors at up to 20 metres. In my case I read the values at the analogue pins and can resolve daylight readings between integer values of 16 to 1022. 
   
Let me know what I can do to help.
Steve
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Jan 05, 2019, 08:04 pm
Thanks Steve,

I did read between "ground and pin" this time and understood that the readings vary on tank capacity and distance between probes. In my test setup I am using the "actual probe" in a small and long PVC container where I manage submerge all 4 probes and below are the readings of my 10 different attempts.

1st Probe - 400-450
2nd Probe- 400-450
3rd Probe- 450-500
4th Probe- 600- 700

I had test the same is a glass of water with a small setup of probes and it show completely different readings.

I also found that readings fluctuate a bit and then stabilize itself in 5-10 seconds when I move from battery power to wall socket power and vice versa while reading values in my laptop, but this should be fine.

For now I have choose to read anything below 800 is a "HIGH" in my code and its working perfectly but my next plan is to put my "actual probe setup" in my "actual 1000 liter overhead tank" and then read values. I will run it on different intervals and log the reading in my laptop just to see if there is any big change in readings and then I can fix which value I should put to get a "HIGH" correctly every time.

By the way 700 is way to high when the probe is completely submerged in water ..its a huge difference.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Jan 06, 2019, 12:31 am
Okay, that sounds liek good progress.  Let me know how your test inthe real tank goes...
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: shantanuonline on Jan 08, 2019, 03:55 pm
in my actual setup now things are more stable and it's currently under observation, I am getting a good reading between 350-500 from all 4 probes and there is not much fluctuation.

By saying actual setup I am saying the complete system and approx. 500 lines of code including different sensor modules, display and buttons e.t.c I have mentioned in my first post so its a LIVE environment now.

Not sure if it is too early but I think its safe to say that my challenge around unstable readings is now fixed, even if not then also I have that level of control to read what It suppose to.

I am going on vacation soon and will do a full cycle of testing after one week to fix some other bugs.

Thank you for your help on this Steve.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Jan 09, 2019, 02:01 am
It's a pleasure and I've enjoyed working out the answers with you.  Good luck with the rest of your project.
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: Paul_KD7HB on Jan 17, 2019, 11:37 pm
I just finished reading through the entire thread because I was curious about the use of the conductivity of water as a level sensor.

Last summer I planned to upgrade my garden irrigation system to use a similar system. It is fed by our domestic water well. I cannot afford to overflow the tanks and create a lake. Has happened before.

So, after buying two of the conductivity sensor boards on Ebay, I built a sensor probe similar to what the OP has, but used float switches. One at the bottom of the pvc pipe to indicate the tank was nearly empty, and one near the top to indicate the tank was almost full. The top of the pipe is fixed to the top of the tank.

Using a Nano to watch the two switches and control a SSR that controls a solenoid valve to fill the tanks. Worked flawlessly all last season.

My suggestion to the OP is to change his sensor stack to use float switches to indicate the water levels. Then the off/on is truly solid on or off.

Paul
Title: Re: Long wire Water Tank Level Indicator, Floating Values when on Electrical outlet
Post by: steve_mcdonald on Jan 24, 2019, 09:17 pm
Hi Paul,
Your thinking aligns with mine.  I resist the idea of sinking probes (particularly dc fed) into water tanks because of the electrolysis effect for one thing, although that can be reduced using ac or even reverse polarising dc every alternate sampling.  In situations where I've used wet probes, I've used that reversing the polarity approach along with only powering the probes during measurements. 

That way, the life of the probes can be extended quite significantly.  Despite that, electrolysis also causes changes in the water chemistry, which I only understand superficially, but which I'd rather avoid. 

I use floats in my water tanks for that reason.  Mostly I care if there's risk of overflow or risk of empty tank, and I am less concerned about reading intermediate levels, but then I live in a country that never goes long without rainfall!  In addition, I built an ATMEGA based weather station with a rain gauge so I always have a clue how much rainfall we're getting. 

With respect to the model the OP has chosen, the probes do give a clear distinction between covered and uncovered, so it can be interpreted as on or off (although it is not exactly that).  The difficulty is always that the actual readings will change over time as the probes are degraded by electrolysis.  That's my ongoing concern and why I also avoid using wet probes too.   

Hey, interesting discussion and thanks for your comment.  Good luck with future projects and best wishes to you.

Steve