06-15-2013 01:54 AM
Hi all,
I am working on an electronic water sensing mechanism.
In an underground water tank I need to sense various levels of water as the water level is consumed and refilled. Later I want to control the sump motor with logic when various conditions are met.
focusing on just electronic sensing mechanism there are many choices available
- biase a transistor with the help of water as conductor
- use Logic gates inputs to become HIGH/LOW when water touches probes.
several choices for gates, any gate can be used in general, even a NOT gate can do.
- Ultrasonic depth sensing.
- LDR based
- various other.
I am working with logic gates at teh moment but will transfer it to microcontroller later when I am satisfied with 'water sensing'
the problem with many techniques above are, their reliability changes with many environmental effects. water vapours, hydration, corrosion, electrolysis, temperature and many similar factors change parameters which can affect changes in sensing.
currently I am working with NAND CD4093. it has built in schmitt trigger so it can shape inputs.
I am prefereing to give oscillated inputs to this logic gate, so at least electrolysis can be prevented. probes will be usually dipped in water.
To perform oscillation in sensing probe I can use transistors ( ac biased), 555, opamp.
Q.1 which one would be better option for oscillating in this scenario?
Q.2 How can I simulate the properties of tap water in reservoir e.g. water conductance and other electrical properties in NI multisim?
currently I GND the inputs with a switch to give the effect of water touching the probes in NI MultisIM. How I can model the real
water properties effecting my probes
Q.3 any other idea to achieve the task?
waiting for reponse
regards
06-15-2013 05:03 AM
I've personally never worked really with water level measurements since highschool, but I've been working on several project were an analog measurement was needed.
I'm just going put an extra eye on this problem 🙂
First of all to prevent future faults and need for maintenance, I would recommend getting a proper water/fuel level sensor like the FPOW80G (just a quick Google search, there might be better sensors).
It gives out an analog signal, since it's a simple analog sensor there isn't much that can go wrong with it, and it's a water sensor so corrosion should be minimal.
This particular sensor measures the pressure so if you know the volume of the tank it's easy to convert the pressure to a corresponding level.
If the water level need to be kept at a constant level then the signal from the sensor can be used to control the speed of the pump.
If the tank is big and the level varies then you could use several sensors and convert the signal from them to digital signals and feed them to a controller.
Also since this sensor gives out just a voltage, it's simple to simulate that with just a voltage source and a variable resistor.
Solving it with just analog signals with one or more sensors:
You could use several opamps for different levels and trigger them at different pressures/water level, by presetting a voltage on the opamps so that they trigger/go high when the desire level is reached.
if there is several levels then the signal form the opamps can be used with timers to run the pump for a specific amount of time.
Solving it digitally one or more sensors:
You can feed the signal out from the sensor to a ADC either build a control circuit or program a micro controller to trigger the pump when the values are reached.
Like I said this isn't really my line of work, just giving my thought about how I might solve this problem.
Good luck 🙂
06-15-2013 05:31 AM
thanks for hints
Not only sensors, but whole controllers are readily available in market. I am trying to avoid and build my own.
Because, at a later stage I am going to build this logic algorithm using microcontroller which will control pumps and display current water levels while processing a set of conditions to be met for controller operation.
conditions example
<when water level in overhead tank falls below 1/4th> AND(logic) <water level in underground tank is touching down levels (almost empty)> Do'nt run pump, give beep alerts.
but this all implementation will comes later.
pressure sensing the way you pointed is good but analog.
I need to sense levels at 8 to 10 discrete levels of the tanks. For this digital logic are good. OP AMP can also be utilized if used as a LOGIC output only.
because digital logic inputs have a wide range of tolernace. Also it would be very easy to interface this logic 'sensing' with other controller stages.
yeah one more parameter that can introduce errors in sensing is length of cables from tank to circuit. I did'nt thought about it.
anyways thanks a lot for hints and keep watching.
06-15-2013 08:21 PM
sunnyimran,
Before anyone can give you any ideas about simulating the conductivity you need to provide much more information.
How conductive is the water? How much does the conductivity vary? How much does the temperature vary and how much does the conductivity vary with temperature? Do you have materials for probes which will not react with the ions in the water? Do you need to detect whether a particular probe is working, regardless of the water level?
Do you need simple binary results at the levels of a few probes or do you need a continuous measure of the water level? Are there waves in the water or splashing when filling or consuming water? How fast do you need to get level readings?
Lynn
06-16-2013 09:07 AM
How conductive is the water, I have no idea
tank is 10 foot depth, 6 foot length, 8 foot width
temperature range season to season varies between extreme low 5C to extreme high 45C
I do not need to detect if a particular probe is working or not
I need eight discrete points to be sensed at eight water levels, binary results would be better because I will utilize this sensing to a microcontroller based controller with many checks and conditions.
it does'nt matter if sensor reading is delayed a couple of seconds.
reading will be 24/7 monitored.
there is splashing and waves only at the time of refilling water. when water is stayed or consumed, it stays smooth
I believe to detect using logic gates, there is a big tolerance for error. because we need to sense only HI or LO at a particular point when water touches a sensor and it gives us margin in different physical factors of tank, volume of water etc. Only thing to consider would be conductance or resistance of water. But for my interest I would like to know are there other electrical properties exist in water like capaitance, battery effect, inductance or anything?
to provide input to logic gates we need a small amount of current in mA to pass through water. still I am persisting to have an oscillating voltages at probes so electrolysis would not occur. But how then we convert this oscillating voltage to non oscillating levels for input to logic gates?
If we use rectifier, before input, still it will rectify the -ve going pulse. +ve pulse will be the input and logic gate output will also be +ve pulses.
thanks for interest
regards
06-16-2013 12:35 PM
Thank you. With those answers it becomes easier to make recommendations. And most of the answers lead to easier solutions than some other answers would.
A capacitive probe might work well. The dielectric constant of water is ~79, compared to 1 for air and 1-4 for many common insulating materials. The capacitance of a parallel plate capacitor is proportional to the dielectric constant. So, in principle, the capacitance could change by a factor of 79 when the gap between the plates fills with water. In practice the change likely will be smaller, but could still be large enough for easy sensing. You could use a capacitive voltage divider with the value of the fixed capacitor chosen so that the output is below threshold when the sensor is in air and well above the threshold when it water. The detector circuit simply looks for pulses. When present you have water. When absent you have air. Another approach is to use the sensor capacitance to control the frequency of an oscillator. Measure the frequency to determine whether water is present or not.
For either type of detector the stray capacitance of the cables will be a problem. Encapsulating part of the circuit so it can be placed at the sensor is one possibility.
Using conductivity sensors is more straightforward if you did not have concerns about electrolysis and corrosion, and about the variable conductivity. What is the source of the water? Is anything added which will change the conductivity?
Using logic circuits with AC coupled signals can be tricky because the common logic families all use unipolar signals. So you need to AC couple both outputs from the driver and inputs to the detector and then provide suitable biasing. It certainly can be done but it is no longer a purely logic circuit.
Lynn
06-23-2013 12:43 AM
@johnsold wrote:
Thank you. With those answers it becomes easier to make recommendations. And most of the answers lead to easier solutions than some other answers would.
A capacitive probe might work well. The dielectric constant of water is ~79, compared to 1 for air and 1-4 for many common insulating materials. The capacitance of a parallel plate capacitor is proportional to the dielectric constant. So, in principle, the capacitance could change by a factor of 79 when the gap between the plates fills with water. In practice the change likely will be smaller, but could still be large enough for easy sensing. You could use a capacitive voltage divider with the value of the fixed capacitor chosen so that the output is below threshold when the sensor is in air and well above the threshold when it water. The detector circuit simply looks for pulses. When present you have water. When absent you have air. Another approach is to use the sensor capacitance to control the frequency of an oscillator. Measure the frequency to determine whether water is present or not.
For either type of detector the stray capacitance of the cables will be a problem. Encapsulating part of the circuit so it can be placed at the sensor is one possibility.
Using conductivity sensors is more straightforward if you did not have concerns about electrolysis and corrosion, and about the variable conductivity. What is the source of the water? Is anything added which will change the conductivity?
Using logic circuits with AC coupled signals can be tricky because the common logic families all use unipolar signals. So you need to AC couple both outputs from the driver and inputs to the detector and then provide suitable biasing. It certainly can be done but it is no longer a purely logic circuit.
Lynn
Dear Lynn
thanks for suggestions.
water is coming from domestic consumable water supply. it is pot-able tap-water.
To give it start I would use the resistive/conductive properties of water to set/reset logic but with AC coupled signals bi-polar oscillations. you are right that logic families use uni-polar signals so I need to try someting ( bias an AC coupled Tr ) before the input goes to gates. that would defeinitely make circuit lengthy. May be I can use a debouning circuit too. more complexity.
Since I wanna have oscillating signals as inputs, is there a way that I use OP-AMPs in place of logic gates but for sensing Logic High and Low only and provide unipolar output with Hi and low voltage levels only. I believe OP-AMP can take oscillating input very well and output can be set so only unipolar lovgic levels at output can be obtained.
please suggest on this
also I want to simulate the real-tank situations in multisim (as far as possible). So given dimensions of my tank, how I can simulate the conductivity of water in between probes in different scenarios like when water is low what would be conductivity than when water volume is high in the tank. So I can simulate the situations correctly for each input behaviour throughout tank refill -stay - consume cycle.
regards
06-23-2013 07:27 PM
Tap water has rather widely varying conductivity, but it always contains enough ions that the conductivity is non-zero. Another issue is the mineral deposits which tend to build up on the electrode surfaces over time. They may be much less conductive than the water.
I have been thinking about the capacitive sensor concept I mentioned earlier. A coaxial capacitor constructed from two pieces of pipe and a few spacers might work quite well. The capacitance of a coaxial structure is given by
C/h = (2*pi*epsilon_0*epsilon_r)/ln(D/d)
Where C/h is the capacitance per unit length, epsilon_0 is the permittivity of vacuum = 8.85 pF/m, epsilon_r is the relative permittivity, D is the inside diameter of the outer conductor and d is the outside diameter of the inner conductor. Since epsilon_0 is in SI units, I have done all the calculations for the example below in those units.
The relative permittivity of air and water are 1 and 80 respectively. The value for water varies with temperature.
For a sensor constructed of a tube with D = 25 mm enclosing a rod of diameter d = 12.5 mm and having a length of 3 m, the capacitance as a function of water depth h is:
h (m) 0 0.3 0.6 1.0 2.0 2.7 3.0
C (pF) 243 2138 4034 6561 12880 17300 19680
A schmitt trigger oscillator circuit requires only one inverter (with hysteresis), one resistor, and the capacitor. One side of the capacitor can be grounded, which may help minimize noise. I added C1 to eliminate the DC component across the sensor, C2. The circuit looks like this:
If C1 is 10 times larger than the largest value of C2, the capacitance ratio is 9.2:1 for a 10:1 variation in C2. The actual period of the oscillation depends on the hysteresis of the inverter. For a 74HC14 or 40106 type inverter the typical hysteresis is 2.2 V at Vcc = 5 V but can vary from 1 to 3.6 V across production runs. I did a series of calculations for R =100000 ohms, C1 = 200 nF and C2 varying from 20 to 20 nF. For the typical hysteresis the period is somewhat less than 2 times the time constant. If the hysteresis is such that the period is 2*RC, then the frequency would vary from 2520 Hz at 2 nF to 275 Hz at 20 nF. If you want to control the hysteresis, use a comparator and set the hysteresis with feedback resistors.
Lynn
06-24-2013 02:28 AM
Lynn thanks for this idea of sensing varying oscillations using capacitive properties of water.
It will take me some time to work on this and I will post the results.
By the way, the co-axial capacitor we will form using rods length under water, it will be some metal, copper pipe or some better. Will it not corrode over time and then frequency response will be changes slightly. although electrolysis will be eliminated because of oscillating effects.
Also if you can give some hints on how to process the frequencies obtained at the output of schmitt inverter in order to distunguish water level.
Now I have to ask something from my original idea:
I was thinking of OP-AMP as LOGIC producer, I realized OP-AMP is an analog device. Reason to utilize was that I needed some tolerance at inputs of a logic gate. Later I relaized that a schmitt inverter such as 74HC14 can provide tolerance at input because of built in schmitt.
Now if considering water conductivity to make a logic’s input to LO or HI I have following considerations:
- Use ACTIVE LOW OUTPUT SCHMITT INVERTER ( such as 74HC14)
NOTE: water conductivity at input of the inverter makes the input LO to make the output HI
- Use NAND with Schmitt inputs such as CD 4093 but make it a NOT gate by shorting the two inputs together
NOTE: water conductivity at input of the NAND makes the input LO to make the output HI
Q. What difference can it make in above two scenarios if I use inverter Vs if use NOT-GATE based on NAND both have Schmitt?
VS
Q. should use CMOS or TTL family? Which would be better suitable
Q. what supply rating devices would be better. These devices are available in 5V and higher ratings. Higher voltage rating device like 10V ( series 4000 and 74C00) their input will have more margin for voltage levels. So a slightly larger current we can pass through water probes so I think that would be better with contaminated probes.
Q. Also need to consider the length of wire from sensor probes to circuit is approx. 10m and it may pick noise in between. It will pass nearby the electrical water pump. I am thinking of using CAT5 ethernet cable for this purpose, it is readily available and has cross twisted pairs. I think therefor, AC signals would be better than DC because DC LO/HI can be fooled easily if my wire picks noise.
Q. In Multisim what is the difference between Vss and GND and Digital GND ? I used GND only and it works for all CMOS devices. is it necessary to use VSS also?
The capacitive probe idea I would try soon.
Thanks for all the support.
06-24-2013 08:27 AM
The coaxial capacitor would be made of metal. Copper pipe is one possibility. If the tank is made of metal, using tubing of the same metal would tend to minimize the possibility of galvanic corrosion. Both corrosion and mineral deposits may occur. I think the capacitive sensor will be less sensitive to those effects than a conductive sensor would be. In principal you could use insulated conductors for the sensor which would completely eliminate the corrosion effects. The disadvantage is that the insulation changes the capacitance. The calculations I did show that using insulated pipes for the sensor would result in significantly reduces sensitivity. Considering how cheap two pieces of pipe are, it woudl probably be easier to replace the sensor very 5 years than to try to protect it enough to make it last ten.
Your microcontroller can easily measure the frequency (or period) of the oscillator output. Or you could build some counter and timer circuits to do the job. Since you specified that you only need to know the level to one part in eight of the total depth, the requirements on the measurement are not very stringent. Near full depth I estimate that a change from 2.7 m to 3.0 m would change the frequency from 314 Hz to 279 Hz or about 10%.
Now to your Schmitt trigger circuit questions:
There is essentially no difference between the 74HC14 and the 4093 circuits. Because the 4093 uses two inputs you have twice the input capacitance and leakage currents. You can eliminate those by tying one of the 4093 inputs high and only connecting 1 to the sensor.
CMOS or TTL? For this application CMOS is the clear choice. TTL is a current input technology. You need to sink current (to ground) to pull an input low on a TTL device. CMOS requires no input current except for pA of leakage currents. Given the low conductivity which might occur in the water, TTL wold be a very unreliable choice.
Supply voltage? The larger currents are probably better for a conductivity probe. On the other hand, if the rest of the system is constrained to use 5 V (to be compatible with the microcontroller for example), the added level shifting required might make keeping everything at 5 V more convenient. You could make the area of the sensors larger to get more total current.
Cable type? CAT5 cable should work. You may still need to do some filtering or averaging to reduce the power line interference. Try to route the signal cable and the power wiring so they are not parallel and are as far apart as is practical. It requires more circuitry but using AC excitation for the conductivity sensor and synchronous detection can allow operation in the presence of substantial amounts of interference. Another option is to put the Schmitt trigger circuit at the tank and run the output back to the control board. Then the signal on the long cable is a high level, low impedance signal which is much more immune to noise problems. These comments apply generally to the capacitive sensor as well. A CAT5 cable has about 52 pF/m of capacitance and RG-58 coaxial cable has about 82 pF/m. Either of these would add an offset to the minimum capacitance of the sensor if the oscillator is remote from the sensor.
I do not have Multisim, so I cannot tell you how they have defined the supplies and grounds.
Lynn