Electronics > Beginners
understanding zener and high side switching
Ian.M:
Here's a LTspice sim of a rearrangement of the squarewave sensor drive idea to eliminate DC bias at the electrodes. A practical implementation could use a MCU with a PWM ouput and an analog comparator input, or for a standalone implementation, a dual comparator, one half as the 50% duty cycle squarewave oscillator, and the other as the threshold detector on the charge pump output.
hsn93:
--- Quote from: Hero999 on December 18, 2018, 09:47:54 am ---Why not simply use 3.3V for the water detection electrodes?
If you're that worried about corrosion, then use AC, rather than DC. Make one electrode 0V and send a square-wave to the other one, via a capacitor and high value resistor. Monitor the voltage on the electrode and if the square-wave falls to 0V, that means it's detected water.
--- End quote ---
--- Quote from: Hero999 on December 18, 2018, 12:30:52 pm ---hsn93,
This is overcomplicated. I don't see why there's a requirement for 24V. Just connect one of the electrodes to an output on the MCU, via a resistor. A small capacitor to filter out any noise is also a good idea.
The values of R1 and C1 are experimental.
--- Quote from: nick_d on December 18, 2018, 12:09:41 pm ---If you want to sense the resistance of something, a good way is to charge a capacitor through it and see how long it takes to charge. Therefore I suggest to use 2 pins of your MCU. One for each side of the sensing probe. Configure one as an output and the other as an input. Ideally make the output a timer PWM pin and the input a timer input capture pin. Put a capacitor from the input to ground. Then as another (high-ranking) poster suggested, output a square wave. Measure the phase delay of the square wave coming back (treat as infinite if no square wave comes back).
cheers, Nick
--- End quote ---
It can be done with one MCU pin, toggled from high to charge capacitor, to input with a high impedance, when the voltage on the capacitor is monitored. When the electrodes are dry, the capacitor should be charged for a long time, only discharging slowly via internal leakage and the MCU input. When electrodes are wet, the capacitor will discharge fairly quickly, through the water.
--- End quote ---
hello Hero999, thank you.. i think its good idea to measure with two pins, once im sure there is water i can pull both pins to ground eliminating the potentional between electrodes. having water to the sensor is abnormal and when it happens it will need intervention from service. thats why i dont need to measure the water all the time and can do it once every 5 minute and then pull two pins to ground.
the thing is that im always afraid to expose mcu pins to outside board thats why i was putting the 24V with a high resistance on series.
but i guess its safe? i will just put 3v3 zener on both pins to ground and should be ok (i assume :-+).
BTW, that link from analog devices doesn't work but i will search for it from the keywords. thanks.
--- Quote from: spec on December 18, 2018, 10:54:05 am ---Hi hsn93
You haven't asked this, but I seem to remember that stainless steel as a resistive water level sensor has problems and other materials are more appropriate.
There are a number of ways to detect water level, but the best compromise, in my opinion, is to use insulated terminals and capacitive sensing. If you are interested in this approach we can discuss- the circuitry is well proven, simple, and low cost.
--- End quote ---
hello, I'm always interested to learn, what are the other materials. the thing is that this sensor is going to be for abnormal situation so i thought a cheap way to do it (im not expert). so would that simple circuitry be simple for me also..
--- Quote from: Ian.M on December 18, 2018, 01:16:32 pm ---To prevent electrolytic corrosion, neither electrode may have a DC path to ground, so both must be isolated by a transformer or capacitors, or the whole sensing circuit must be galvanically isolated, and use balanced AC excitation.
Even if DC bias is time or current limited, it *will* cause electrolytic corrosion of the electrodes. The only question is: how much? If the electrode surface area is large enough and the average current low enough, you probably be able to get sufficient electrode life to be practical.
However there is another problem with stainless electrodes - pitting aka: crevice corrosion, as it has two different electrode potentials depending on whether or not its surface chromium oxide layer is present. In an aerobic environment, the chromium oxide layer maintains itself and protects the iron component of the alloy from rusting. In an anerobic environment, the chromium oxide layer becomes depleted then the iron is free to rust. It only takes a little inter-granular corrosion due to electrolytic action (e.g. due to DC bias or dissimilar metals with an electrical connection, immersed anywhere in the system) , providing a microscopic pit or crevice, a bit of lime scale obscuring the pit and some trace organics to tip the balance towards an anerobic environment at which point the stainless eats itself, forming an electrochemical cell between the anodic crevice and the cathodic exposed surface, preferentially eroding the metal in the pit or crevice. I've personally seen a stainless pump shaft eroded by crevice corrosion that over the course of one winter without use, lost a chunk of metal about the size of a large split pea from under a lip seal leaving a sharp edged pit , leading to immediate failure in the spring the first time the shaft moved.
You'll probably get away with DC bias if the electrodes are rarely immersed, and are mounted protruding downwards from a very smooth surfaced PTFE or HDPE plate, with no supports or other parts touching the electrodes except at their mounting plate so biofilm buildup between the electrodes is limited. Ideally the mounting plate should *NEVER* be immersed.
--- End quote ---
very informative thank you. I'm having the sensor rarely immersed. but once it is. (i don't know how much it will stay immersed) since this needs intervention from service team. so what if i put both outputs to ground once the water is detected. (yes its planned to have the two electrodes between PTFE in distance of 20mm).. although I'm weak at chemical and corrosion but I've seen way before so i thought i will need some plastic that will not be affected by waste water.
--- Quote from: Ian.M on December 18, 2018, 02:03:28 pm ---Here's a LTspice sim of a rearrangement of the squarewave sensor drive idea to eliminate DC bias at the electrodes. A practical implementation could use a MCU with a PWM ouput and an analog comparator input, or for a standalone implementation, a dual comparator, one half as the 50% duty cycle squarewave oscillator, and the other as the threshold detector on the charge pump output.
--- End quote ---
thank you i will look and study. capacitors dc coupling was always a question mark for me im not good with analog. so i have to study that effect of c1 and c2 and imagine what will happen (basics but im newbie)..
a question, having c1 and c2 with high Voltage rating will be protected input, outputs (with zeners after them)? (galvanic isolated) ?
================================================
hello everybody thanks for your valued replies it teach me a lot.
from different comments i get that:
-capacitive sensing is more correct way to do it.
-water conductive method is not very good because of corrosion. (to use AC is ok)
-my application has (vibration and waste water feces / or tab water).
-having water to the electrodes is abnormal situation in my application.
-thats why i though to remove the potential difference by having HI-Z on the output of one electrodes (once i detect the water). (do i still need to have AC?)
Ian.M:
You cant get much *worse* than 'black' water (i.e. sewage) for corrosion. The odds of stainless sensing electrodes surviving in the head-space of a black water tank aren't very good - its almost guaranteed to be anerobic, with 100% humidity and condensation, and there is high probability of corrosive gasses and biofilm buildup, leading to corrosion of even unpowered stainless electrodes.
How I'd tackle that woud be with a relatively large diameter HDPE dip tube, from the tank top down to a few inch below the required detection level, capped off above the tank top. The cap would have a Goretex vent separating it from a sealed sensing chamber with a differential pressure sensor (to ambient) and an air inlet from a small electric air pump. Every five minutes, run the air pump briefly until the chamber pressure plateaus, then stop the pump and monitor the pressure. If it rapidly decays back to ambient, the dip tube isn't immersed. When immersed, the pressure it decays to depends on the depth the end of the tube is immersed to. Set a suitable detention threshold for the final level you need. Clogging of the dip tube, Goretex vent or main tank vent will show up as anomalous excessive pressure.
Zero999:
--- Quote from: hsn93 on December 18, 2018, 02:10:30 pm ---hello Hero999, thank you.. i think its good idea to measure with two pins, once im sure there is water i can pull both pins to ground eliminating the potentional between electrodes. having water to the sensor is abnormal and when it happens it will need intervention from service. thats why i dont need to measure the water all the time and can do it once every 5 minute and then pull two pins to ground.
the thing is that im always afraid to expose mcu pins to outside board thats why i was putting the 24V with a high resistance on series.
but i guess its safe? i will just put 3v3 zener on both pins to ground and should be ok (i assume :-+).
BTW, that link from analog devices doesn't work but i will search for it from the keywords. thanks.
--- End quote ---
Another resistor can be added in series with the input to protect it against high voltages.
By the way, there will be a time delay between seeing the voltage on the capacitor and the output going high, as it will take time for the capacitor to charge, so the code needs to account for this.
I don't know why the link didn't work. It works for me. Could it be the firewall? It's not the forum corrupting the link, as I've tested it again. Try Googling for "Liquid Level Sensing Using Capacitive-to-Digital Converters"
https://www.google.com/search?client=firefox-b&q=Liquid+Level+Sensing+Using+Capacitive-to-Digital+Converters
hsn93:
hello, everybody,
thank you for your replies i will have to study capacitive sensing in details.
although my application is for sanitation vacuum system and the sensing here is for detecting the Bowl water level if it gets full then its a failure mode
the sensor is attached to the bowl and the system is exposed to extreme vibration.
im using optical sensor but thats for leakage under the bowl. for this one i needed somthing cheap "it can be replacable as a spare part" so i was considering water conductivity.
i didnt care a lot about electrodes as i know this is a situation that shouldnt occure in normal mode (its a failure of the system for some reason).
but i wanted to shutdown the electrodes potential while i was using 24V.
after seeing the replies from different experts i can see that its ok to use the electrodes for my application (increase the distance maybe 40mm if the vibration is extreme but i dont think so as it will be mounted on some height and water shouldnt reach to it.)
thank you all for your kind replies. any further information is welcomed im going to study them. :-+ :-+
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version