Water detect wire

julianE

Senior Member
I made a simple water level detector using a transistor and a pair of wires, transistor turns on and triggers a picaxe. All works well. The question i have is about the wire. I used some tinned copper wire, looks silverish, it does not oxidize in the air but after sitting near water and being dunked a few times I noticed greenish copper tarnish on the wire. Is there a wire that will be safe to have near water that does not oxidize. Stainless steel maybe, I do have some nichrome wire, wonder if that will work.
Thanks in advance.
 

papaof2

Senior Member
If you apply even a small DC potential across almost any two wires in water, there is the chance for some interaction - water that is safe to drink isn't free of all dissolved minerals and the electric potential may be moving atoms from one wire to the other. Stainless steel might be a better choice but platinum is the metal of choice for minimum interaction. I'm guessing that if you could afford platinum electrodes you wouldn't be asking here ;-)
 

eclectic

Moderator
@julianE

1. Can you please post your schematic and program?

2. There are MANY moisture / water detector postings on the Forum.

Two of many things to consider are

a. Using say stainless steel (dining fork tines) as disposable electrodes.

b. Using Alternating Current and readadc.

e
 

mushroom

New Member
Many decades ago, (pre-picaxe), I used a relay for a pump on and off controlled by a very simple op amp circuit and 12V DC. Not my circuit and lost now, but was suppose to be AC through the 3 stainless steel probes. I never had significant corrosion issues. Worked for years.
This was for sensing a low level in a 25lt drum and pumping to an upper level probe when triggered.
Tip: I used 2x 3 connectors from a common 12way screwed strip connector. Three 1.5mm diam stainless rod run through the two conector pieces gave an adjustable hieght for the three probes,and a wire connection point. Com lowest probe, low level probe, and high level probe. Resently I needed some 1.5mm stainless rod and found it's still very cheep for a couple of meters. Hope something in my rave is of help.
 

julianE

Senior Member
Here is the schematic, everything works, just using readadc command to read the value, would work if i used a logic level too.
Hopefully someone else finds the simple circuit useful,

24716
 

julianE

Senior Member
Three 1.5mm diam stainless rod run through the two conector pieces gave an adjustable hieght for the three probes,and a wire connection point. Com lowest probe, low level probe, and high level probe.
Thanks for the replies gents. I ordered some 18 gauge stainless steel wire from ebay, i think it's used for jewelry. I'll give it a try. I was hoping i had some wire I could use in stock, I do have a vague memory of a spool of very shiny wire. I know that i have nichrome wire, it should work too I suspect.
 

julianE

Senior Member
Get 316 grade stainless if you can.
316 contains molybdenum and is much more resistant to corrosion than the common 304 grade.
316 is often called Marine Grade.
Brilliant suggestion, I was hesitant to post such a trivial question glad I did else I would have never learned about 316 grade stainless. It makes so much sense to use marine grade for outdoor applications. Thank you.
 

erco

Senior Member
Non-electrical-contact alternatives:

Use several insulated plates (pennies?) at various levels as capacitive touch sensors.

Use a float on a moving arm to a rheostat, like a fuel tank sender.

Point an ultrasonic sensor down at the water from above to measure distance/level.
 

AllyCat

Senior Member
Hi,

Personally I've never developed a water level sensor, but I'd use a rather different design approach. Firstly, I'd arrange to disconnect any d.c current source except when actually making the measurement, perhaps using another PICaxe pin (but not essential). Then I'd connect the "water resistance" (probes) directly between a PICaxe ADC input pin and Ground (perhaps with just a low series "protection" resistor). Then, the current source is from the supply rail, which could be via the internal "Weak Pullup Resistor" (about 30k), that can be enabled by software when required.

Apart from controlling the LED, the transistor (Q1) doesn't appear to offer much "added value" and severely limits the ADC input range. A water resistance (Probes) pullup of more than about 150 k won't a activate the transistor at all (not reaching the Vbe threshold), and a value below about 75k (depending on the exact transistor gain) will fully illuminate the LED and give a zero output to the ADC. For comparison, a direct 30k pullup resistor with READADC10 can give good resolution with a pulldown resistance over a range of 1k - 1M ohms, and detect the presence of anything between about 100 ohms and 10 M.

However, the first method I would try is a "Touch" input pin, with fully insulated cable(s), to measure the change in capacitance caused by the level of the water. The Touch hardware makes an Analogue measurement which could be threshold-detected in exactly the same way as an ADC input (but can be a full 16-bit value) and of course is a pure a.c. measurement. There was recently a forum discussion on detecting the water level in a (deep) well; a few observations from there are:

Ultrasonic sensing generally can't be used because of echos from unwanted surfaces (tank, walls, etc.). Low frequency audio or even sub-sonic (resonance) looks interesting and appears to have been the solution adopted. The (normal) optical reflection at a water surface is only around 1.5%, so may be difficult to discriminate from the "base/foot" using for example an optical/laser (time of flight) rangefinder. Pressure sensors are of course very popular for modest depths such as in domestic appliances.

Cheers, Alan.
 
Last edited:

John West

Senior Member
Another thought to add to the mix.
I would use a FET or single-ended op amp circuit with as high an input resistance as practicable, (add small filter capacitors.) That limits current flow between the probes. You are likely getting some degree of electrolytic deposition occurring, so the less current flowing through the liquid the better.
 
Last edited:

julianE

Senior Member
Thank you all for the great ideas. I will test them for future use. I had considered using a FET but the capacitance (touch) method is something i did not consider. My application is to sense water rising in the pipes going to the main sewer. What happens is tree roots get into the pipe and block it causing water to backup and start rising in the drain in the basement. If i catch it early enough i can call someone to clear the pipes outside. The sensor is dry 99.9 percent of the time and there is no corrosion and the current draw is negligible so my extremely simple circuit is pretty much perfect. I only noticed corrosion when i was doing testing overnight with the probe in the water. BTW, the picaxe also sends a signal to a remote unit using cheap RF modules. My relatives like the idea too and are prone to getting water in the basement so i will be building more of these units. BTW the LED is for test purposes, the sensor sits at the end of 60 cm of wire, i slowly lower it into the pipe and when the LED lights i know i am at the steady water level, i raise it back just enough for the LED to go out and at that point it's dry. I have had it running for a week and it hasn't turned on once. For me the water issue happens at most once every 2 years but if the water floods the basement it's a real nuisance. On the other hand it's far more frequent for people I'm making units for so i'd like to keep corrosion to a minimum.

I really appreciate all the forum help. I hesitate to ask such a simple question but it has led to many wonderful answers. I attend many lectures at the university, every so often a really stupid question is asked and I am dumbfounded that someone would ask it. the presenter takes that vapid question and fashions an answer that is beautifully illuminating, I almost want to thank the person that asked.

This truly is the best forum on the internet.
 

papaof2

Senior Member
I did a similar alarm at the outside basement entrance of a relative's house. There is a drain at the bottom of the outside stairs leading down to that entrance, but especially in the Fall the drain can be blocked by leaves. As the water level of interest is anything greater than 1 inch (2.5cm), I used a magnetic reed switch with a magnet in a float (you'll find them on Ebay) to trigger a PICAXE which turns on a loud pulsing alarm. The next year after the device was installed, I got email that they had been awakened in the middle of the night by "beeping in the basement". The drain was cleared by the light of a flashlight and no flooding that year. I've gotten additional email about the "beeping in the basement" so it has worked well. Your application appears to need something with a wider range but the longest float switch I've seen is about 6 inches (15cm) long. As far as I know, the thing is still working 10+ years later - you usually hear about it if something does NOT work but hearing nothing is often a good sign ;-)
 

premelec

Senior Member
There are some small stainless float switches with magnet enclosed that could work for you - see attached pic from an Ebay listingFloatSwitch.jpg
 

tmfkam

Senior Member
When my Elektor Weekly Newsletter arrived this morning, it pointed to an article that suggests a capacitive sensor using a 4060 counter divider where the capacitor for the oscillator is made up of two external copper tape "plates" positioned either side of a plastic pipe. As water reaches the "plates" the frequency of oscillation changes and this is then detected (in the article) with an arduino.

This is very similar to the principle that Alan refers to above.

If you want to see how Elektor did this, the article is located here:

Some of the free articles made available to readers of the newsletter expire after a few days/weeks so the link may not be relevant in the future.
 

julianE

Senior Member
These cheapies work well, batteries last for years. I have one in my washer drain pipe to alert clogs & about to overflow.

I'm not sure I can make them that cheap so I ordered one. I'm thinking should be easy to interface to a picaxe and have it send a text when water detected.
 

julianE

Senior Member
When my Elektor Weekly Newsletter arrived this morning, it pointed to an article that suggests a capacitive sensor using a 4060 counter divider where the capacitor for the oscillator is made up of two external copper tape "plates" positioned either side of a plastic pipe. As water reaches the "plates" the frequency of oscillation changes and this is then detected (in the article) with an arduino.

This is very similar to the principle that Alan refers to above.

If you want to see how Elektor did this, the article is located here:

Some of the free articles made available to readers of the newsletter expire after a few days/weeks so the link may not be relevant in the future.
Very interesting article thanks for sharing.
 

premelec

Senior Member
@tmfkam Would be interesting to see how that works on 4 inch plastic drain with various water levels & plates...
@erco I have one of those on floor near my 10 yr warranty water heater now 30 yrs in service... ;-0
 

AllyCat

Senior Member
Hi,
If you want to see how Elektor did this, the article is located here:
ElektorWaterDetector.png


An oscillator can be created from a capacitance, a few resistors and logic gates (preferably CMOS), similar to the "bonus" feature of the 4060 counter/divider Integrated Circuit. Or by using a Comparator as contained in all X2 and M2 Picaxes (but not necessarily fully supported by the PE).

Even better, most PICaxes have "Touch Pad" Oscillator Hardware on all Analogue input pins, that can be configured for numerous frequencies, amplitudes, waveforms and power drain, etc.. The PICaxe TOUCH16 instruction combines this hardware with two internal counter functions to achieve ALL of that project (i.e. PCB + Arduino) using almost no additional hardware, and at orders of magnitude lower power consumption. :)

However, for an "Occasional Presence of Water Alarm" (as opposed to a "Water Level Detector"), a simple resistance (current flow) system, for example as in post #17, is probably more appropriate. However, I would make a few comments on that particular hardware: Firstly the "Sensor Pad" is unlikely to be stainless, let alone 316 grade, and I have a personal dislike of 9 volt (PP3 ?) batteries, expensive and less than 10% of the Ampere-Hours capacity of AA cells. Of course the 9 volts should be good for a loud alarm, but alternatively, 2 pins on a PICaxe can be configured as a (push-pull) "H-Bridge" to give 9 volts peak-peak from a 4.5 volt supply.

Furthermore, a PICaxe can be programmed to sleep for brief periods to economise on power consumption, but then self-test its power supply voltage (with no additional hardware) to give a warning (short "beeps" like a smoke alarm) or even an "alert" radio transmission, if the hardware is available. Potentially, a system that could offer full "protection" for many years with no regular maintenance at all. ;)

Cheers, Alan.
 

AllyCat

Senior Member
Hi,

The key is simply that the "Load" is not connected to Ground. For example, first the "-" terminal would be connected via pin1 to Ground and the "+" terminal to +Vdd via pin 2 (to give a peak of Vdd). Then pin 2 is driven to Ground and pin 1 to Vdd to give the equivalent of -Vdd on the "+" terminal, thus an effective peak-peak of 2 x Vdd.

There are numerous hardware possibilities, for example two HPWM output pins, SR-Latch Q and /Q pins, a Comparator output, the Data Signal Modulator (DSM) module, or simply code: LOW b.1 : HIGH b.2 : PAUSE period : HIGH b.1 : LOW b.2 : PAUSE .... etc. The principle is also used with the MP3 (SPE035) player and the PAM8403, etc.. which have the advantage of not needing a coupling capacitor.

Alternatively, if it's a "d.c." (self-energising) sounder, then a simple diode-capacitor "bootstrap" (e.g. activated from a PWM output) could be used to generate Vdd x 2, or higher voltages using a small inductor.

Cheers, Alan.
 

eclectic

Moderator
A "Blast from the past"


e
 

julianE

Senior Member
A quick update, I have the stainless steel wire and am testing it as soil moisture sensor, so far it's working great. I used to use the ebay moisture sensors that use printed circuit traces as a sensor, works well for a year or so and then the traces corrode. Next, I will make water sensors with the wire. Only issue i ran into is how to attach wire to the the stainless steel, my soldering iron isn't hot enough to solder it so I'm using a mechanical connection with screw terminal block.
 
Top