Eliminate noise from water sensor circuit

Thread Starter

peter65

Joined Dec 4, 2016
18
Good day all, This circuit is a water sensor I designed. Point A and B are the sensing terminal.When I tested this circuit on breadboard with short jumpers it worked very well but when I used long cable(5meter and above) to to test in a water tank, the circuit became very unstable so that even when without touching water it triggers the relay. I was noticing huge noise in the circuit. Pls can someone tell me what I need I to add to eliminate the instability and noise bcos the nature of the app demands very long wires...thanks in advance

IMG_20200812_100535.jpg
 

MrChips

Joined Oct 2, 2009
21,911
Audioguru will come along and say LM741 is a lousy opamp.
Also 15V is not enough for this opamp.

Instead of LM741, use an opamp in differential mode, or use an instrument amplifier. You want the two wires to be balanced twisted pair in order to take advantage of a differential amplifier's high common-mode rejection ratio (CMRR).
 

Thread Starter

peter65

Joined Dec 4, 2016
18
Audioguru will come along and say LM741 is a lousy opamp.
Also 15V is not enough for this opamp.

Instead of LM741, use an opamp in differential mode, or use an instrument amplifier. You want the two wires to be balanced twisted pair in order to take advantage of a differential amplifier's high common-mode rejection ratio (CMRR).
Thanks very much...Actually that is +5v supply. I've seeing much heard about this twisted pair stuff but I was actually thinking I'm missing some capacitor or some other noise reducing component
 

MrChips

Joined Oct 2, 2009
21,911
LM741 needs at least 20V to operate, +15V and -15V is best.
Scrap the LM741 and use a modern opamp.

Forget about capacitor filtering for now. That will come later.
Change the opamp. Use it in differential mode. Use twisted pair cables.
 

BobaMosfet

Joined Jul 1, 2009
1,209
Good day all, This circuit is a water sensor I designed. Point A and B are the sensing terminal.When I tested this circuit on breadboard with short jumpers it worked very well but when I used long cable(5meter and above) to to test in a water tank, the circuit became very unstable so that even when without touching water it triggers the relay. I was noticing huge noise in the circuit. Pls can someone tell me what I need I to add to eliminate the instability and noise bcos the nature of the app demands very long wires...thanks in advance

View attachment 214782
What is the diameter of your copper wire on A & B?
 

Thread Starter

peter65

Joined Dec 4, 2016
18
LM741 needs at least 20V to operate, +15V and -15V is best.
Scrap the LM741 and use a modern opamp.

Forget about capacitor filtering for now. That will come later.
Change the opamp. Use it in differential mode. Use twisted pair cables.
Ok...but sorry can I ask... 1- which other faithful opamp would u suggest?
2- why do you say differential mode is the best?. I used comparator mode bcos all i need is comparison of the two voltages(inverting and non inverting) and not amplifying anything
Pls...Forgive my curiousity. Thanks
 

Ian0

Joined Aug 7, 2020
535
You don't need an op-amp (even a modern one), you don't need twisted pairs, or differential amplifiers, you need a comparator. Old-as-the-hills LM393 will do the job (although you will need a pull-up resistor from the output to V+). How fast does the water level change? If it takes more than a few milliseconds, then put a big capacitor across the 500k resistor. 10uF multilayer ceramic should do - don't use an electrolytic as they are rather leaky.
And how about a bit of hysteresis? - resistor from the junction of the 1.5M/500k resistors to the + input, and another resistor, say 10M, from the output back to + input. You might have to experiment with the value of the first resistor - start with 100k.
Also, it's probably better if one of your probes is earth, not 5V. If your tank is metal, I bet it's earthed!
And when the copper probes finally dissolve, you'll replace them by stainless steel ones. Hope it's not potable water!
 

dl324

Joined Mar 30, 2015
11,587
Actually that is +5v supply.
5V is even worse. The common mode input range will be terrible with a 5V supply.
which other faithful opamp would u suggest?
You're using the opamp as a comparator. You should use a comparator instead. I think that's what the $0.65 sensors use.
clipimage.jpg
What is the coil current? 20k is probably too large for the base resistor.

EDIT: add sensor info.
 
Last edited:

sghioto

Joined Dec 31, 2017
1,473
555 circuit is good, but you have the input on the wrong pins.
It's wired correctly for the intended purpose. Pin 4 is the reset pin, minimum voltage of around 1 volt for normal operation. The voltage at pin 4 is 1.6 volts set by the voltage divider of R1 and R2. Any resistance 470K or less on the sensor terminals will drop the voltage on pin 4 below the 1 volt threshold and the output pin will go low. C1 is a noise filter for the sensor. TS didn't mention he needed hysteresis. Increasing the value of C1 will do the job.
SG
 
Last edited:

Ian0

Joined Aug 7, 2020
535
So, given the choice of a good circuit and a mediocre one using the same components, you'd choose the mediocre one?
True, TS didn't specifically mention hysteresis, all he wanted to do is eliminate the noise, and hysteresis is an excellent way of doing it.
Any resistance 470K or less on the sensor terminals will drop the voltage on pin 4 below the 1 volt threshold and the output pin will go low.
The threshold could be anywhere between 0.4V and 1.5V (Texas TLC555 Datasheet). So the resistance needed to trigger could be anywhere between 106k and 4.79M. Removing R1 substantially narrows the variation - now between 87k and 428k - still a wide margin.
The reset pin has no hysteresis - so any noise will result in the output switching abruptly from rail to rail. You don't even have the 741 slow slewrate to stop it.
Using pins 2 and 6 give you a much more accurate voltage threshold. +/-5% on the old bipolar type, +/-7% on a 7555; a rather wayward +/-17% on a TLC555, but still far superior to trying to use the reset input.
Then you have 1.66V of hysteresis: with R1 disconnected, it would require 500k to trigger the output, but it will not switch off until the resistance increases to 2M. Result: no jitter on the output, but it does require a judicious choice of R2 to make sure it will switch off. You can have too much of a good thing!
Variations in water purity can make the difference between it working or not - no wonder every piece of commercial equipment that needs to sense water level uses a float-switch.
 

sghioto

Joined Dec 31, 2017
1,473
Manufacturing tolerances really do exist, ignore them at your peril.
The component values were chosen with the chip I was actually using on the breadboard. I didn't just draw the circuit up without testing including the relay.
Why are you so offended by my circuit suggestion?
IF you are convinced your suggestions on the 555 version are better then post a working schematic, don't just talk about it.
 

dendad

Joined Feb 20, 2016
3,602
For an irrigation water detector, I used an Arduino Pro Mini as it also sent a text message with battery, solar, temperature.........

But, the water sensing used a PWM output at 50% and capacitivly coupled that to a stainless steel probe. Another probe was capacitivly coupled to a rectifier and the resultant DC signal read to detect the water.
It is best to use AC for your probe, not DC, else electrolysis will cause problems.

A reading is done with no PWM running, then turn on the PWM and read again. That way, most noise is ignored.
 
Top