which sensor to use for salt water level - Page 1
Forum section: electronics / beginners

author: mchrdk
author_rank: Newbie
timestamp: August 17, 2014, 12:09:32 am
content: Hi All,Long time fan of the eevblog, i have been reading the forum for a while, while a lot of the answers here goes a lot over my head i thought i would like to ask the hivemind for a question that has been bugging me for a while.i have a saltwater aquarium and want to measure the water level of the aquarium, theres a lot of water levels that i would like to measure:the main tank.the overflow chamber.the sump.the return champer of the sump.i have a aquarium computer set up to alarm me when something goes wrong, right now the alarm points are:temperaturephlight leveland a bad solution to salinity.right now im looking into getting data on the water levels, mostly for statistics and alarming, but also for automating water changes.i have tried the following sensors:ultra sonic sensors, they corrode in the salt environment within a month.float sensors, algae and animals love ´em, they sit on them making them not trig when they should, and they make bad sensors for statistic data, they only trig when the water level goes up to it, or down below it.ir sensors tcrt5000L, i haven't been able to make this work reliably, the return fluctuates a lot and the range is very limited.i have been thinking about using the Etape sensor, but it will cost me around 50 dollars shipped per sensor, and i would need 4 of them(and its pretty ugly to have in the main tank)do any of you have an idea of what sensor i could use, preferably one that could measure the water level from above the water.Thanks for the help!Michael

author: miguelvp
author_rank: Super Contributor
timestamp: August 17, 2014, 12:17:22 am
content: Wouldn't a DMM measuring resistance at a marked distance be a good sensor?Edit: nevermind, bad Idea since it will probably create hydrogen/oxygen and cause some electrolytic effect from the anode to the cathode and depending what is on the anode and cathode it might contaminate the water.

author: mchrdk
author_rank: Newbie
timestamp: August 17, 2014, 12:20:22 am
content: hm, can you elaborate on that?

author: Richard Crowley
author_rank: Super Contributor
timestamp: August 17, 2014, 12:27:20 am
content: Are these all in clear (transparent) enclosures (glass tank, plastic overflow chamber, clear poly tubing, etc.)?I would experiment with reflective LED/sensor devices to see if you can discern between the reflectivity of air on the other side vs. water.Putting any kind of metal electrode into the salt water seems to be just asking for trouble with rapid corrosion and decay.

author: Cside
author_rank: Regular Contributor
timestamp: August 17, 2014, 12:33:44 am
content: I wonder if there is a pressure-based sensor. Sitting on the tank bed. What do car fuel tanks use?

author: mchrdk
author_rank: Newbie
timestamp: August 17, 2014, 12:36:34 am
content: after thinking about it, i think i understand what you mean about resistance measurement, it would require me to put a probe into the aquarium, i think it would corrode pretty quickly.all the tanks are made of glass, but algae and other things will make it hard to read from the other side of the glass, and since the light is changing with sunlight, and the LED lights going on and off on an interval, i think it would be hard to get reliable data, but i sure love the way you're thinking, its out side the box(haha)there is a way to do it with pressure, with a pressure sensor, a one way valve and an air pump, but as far as i can see, you need to get the airpump running at least 10-20 seconds before measuring. Its a complicated setup with many failure points.Im not sure how fuel tank gauges get their data, i will look into it

author: miguelvp
author_rank: Super Contributor
timestamp: August 17, 2014, 12:37:50 am
content: Quote from: mchrdk on August 17, 2014, 12:20:22 amhttp://www.waterboards.ca.gov/water_issues/programs/swamp/docs/cwt/guidance/3130en.pdfBut not sure on the range you need (might be immeasurable for very small salinity measurements)Also the distance between the probes will change the reading so you will need a jig that makes the distance the same.But the way DMM measure resistance is by applying voltage. So it will have an electrolytic effect in salt water. Not only releasing minute amounts of oxygen and hydrogen but making the materials in the probes detach from the positive and the negative depending on the composition. This is how electroplating works, but it does leave residues in the water so I wouldn't not use it for long periods.Maybe collecting samples and measuring outside of the main tank, like some tubing that takes the sample via a valve. And a second drain valve to dispose of the sample after the measurement?Still you will have to experiment to see if the digital multi-meter is accurate enough to measure the conductivity changes for the salt levels that you are interested in.

author: mchrdk
author_rank: Newbie
timestamp: August 17, 2014, 12:43:52 am
content: ahh, thats for salinity,i have that covered with a probe that indeed measures connectivity/resistance.i bought a probe dedicated to that, it has been running for a while with no issues.

author: Richard Crowley
author_rank: Super Contributor
timestamp: August 17, 2014, 12:59:37 am
content: I have seen systems where they ran a dry (air-filled) tube down to the bottom of the tank and used the resulting air pressure (out at the dry end of the tube) to measure the water pressure (which would be proportional to water level at a known volume/area.) But that may not provide enough delta pressure to be useful for small volume vessels.An optical method could auto-compensate for slow algae growth, assuming you are running analog signals into a microcontroller, etc.Putting a floating magnet inside a perforated tube would protect it from animals (and algae, given sufficient clearance). And you could put hall sensors outside the vessel to sense the height of the magnetic float.There are also methods of thermally connecting resistors at intervals up the side if the vessel. You could heat each resistor and then measure how long it takes to cool back down. That wold indicate whether there is water there (to more quickly sink the heat away).

author: mchrdk
author_rank: Newbie
timestamp: August 17, 2014, 01:09:15 am
content: the float sensors i have are all installed the way you are saying there, but algae growth are still messing with me :/its a very interesting thought with the thermal measurement, do you know of any ready built sensors like that?i will try to figure out a way to build it, at least as a proof of concept.man, i don't regret asking you guys, you have already made a lot of points i haven't been able to think of myself.

author: miguelvp
author_rank: Super Contributor
timestamp: August 17, 2014, 01:11:22 am
content: I should have read past the "bad solution to salinity".So a water kettle shows how full it is by using a smaller column pipe. If you could measure the capacitance in that column wouldn't it change with volume?Maybe some rigid membrane connected to a tube on the bottom that is rigid enough so it's not too bulgie but can push into a pressure sensitive element?Or a piston that makes a device rotate based on pressure and you can read the accelerometer position?Or shinning light straight to the glass wall, the pressure of the water will change the diffraction of the light bouncing between the walls and capturing it with a camera. (kind of what camera based touch screens do with IR led strips).Actually just a webcam with some simple computer vision will do and less complicatedThere has to be many ways to determine volume that doesn't require direct contact to the water.Also don't forget sound, the volume will affect the resonance.Edit: kind of a soft mallet that strikes the tank and capture the sound to determine the volume (not sure how annoying it will be to the fish)

author: IanB
author_rank: Super Contributor
timestamp: August 17, 2014, 01:37:11 am
content: The common industrial way of measuring levels is to use hydrostatic pressure. A pressure transducer is exposed to the pressure of the liquid at the bottom of the tank and it produces a signal proportional to the pressure. Since the pressure is proportional to the height of liquid above the transducer, this allows the level to be measured.The pressure transducer can either be fitted to a hole through the side of the tank, or if this is not convenient (e.g. risk of leaks) the transducer could be placed at the bottom of a pipe or tube that is inserted down inside the tank. The pipe would be sealed at the bottom where the pressure transducer is and open to the air at the top. The wires from the transducer would be brought up inside the tube.Nothing touches the liquid except the outside of the pressure transducer (which can be protected with a plastic diaphragm if the liquid is corrosive).

author: rs20
author_rank: Super Contributor
timestamp: August 17, 2014, 01:50:11 am
content: You can buy cheap ready-to-go ultrasonic distance sensors that you can set up to fire down at the water's surface, accurate to at least 1cm I believe.Quote from: Richard Crowley on August 17, 2014, 12:59:37 amThis is a really cool and elegant technique which avoids the need for the pressure transducer to be tolerant to water -- and a barometer chip which can measure a 1m change in elevation in air ($3 on ebay) can measure a 1mm change in water depth, so I think the delta pressure is plenty sufficient.Quote from: mchrdk on August 17, 2014, 12:36:34 amI don't know why you think you need a one-way valve; and fish tanks already have an air pump to bubble air through the water, right? So this idea boils down to what you already have + a $3 sensor in a pressure-sealed box.Quote from: miguelvp on August 17, 2014, 12:17:22 amMeasuring conductivity is fine as long as you use AC (which you can enforce by having a capacitor in series with your immersed sensor), and use a relatively cromulent metal wire.By the way, look up "Endress + Hauser" on YouTube. They're a big company that does all sorts of fluid flow rate and pressure measurement gear for industry -- and they have these videos that explain the techniques they use. The number of different methods they describe is kind of mind-boggling, and might be a source of inspiration for you.

author: IanB
author_rank: Super Contributor
timestamp: August 17, 2014, 02:00:39 am
content: Quote from: rs20 on August 17, 2014, 01:50:11 amIt's also a really horrible and unreliable technique that should never be used. There are two problems: if there is any kind of micro-leak at the top of the tube then the water level will rise up the tube and cause the measurements to be wrong; secondly the air in the tube will dissolve in the water and the water level will rise up the tube regardless of leaks, giving a measurement drift as before.QuoteThis method is much more reliable. With a constant (slow) bubbling of air out the bottom of the tube the pressure at the top of the tube will be proportional to the water depth. Therefore measure the air pressure and you know the depth. However, you need an open ended tube (no sparger), and a slow air flow to eliminate flow friction effects. As a result this could not be combined with an existing air bubbler without compromising accuracy.

author: rs20
author_rank: Super Contributor
timestamp: August 17, 2014, 03:10:39 am
content: Quote from: IanB on August 17, 2014, 02:00:39 amI had assumed a pump was implied, to handle these issues. I agree that trying this without a pump would be a bad idea.Quote from: IanB on August 17, 2014, 02:00:39 amWould accuracy be compromised by 1mm or by a metre? It would be interesting to quantify these effects -- the pressure gradient in even a small body of water is quite dramatic, and I've got no good intuition how uncertain/variable the pressure drop in the sparger would be.In any case, even if you did need a separate open-ended tube and slow air flow, this could be achieved by teeing off from the same pump with a small tube (think pneumatic flow-limiting "resistor"). So we're still talking just a tee, some tubing, and a $3 sensor, and great reliability.

author: theatrus
author_rank: Frequent Contributor
timestamp: August 17, 2014, 03:29:16 am
content: I use a very coarse system of two IR level sensors - water is either there or it's not. Even with this setup, if the water level is not cycling the salt buildup on the dry sensor (or in bright environments) coralline buildup messes with it.Floats are really reliable, if you can find a way to keep the algae in check. No sensor is infallible sadly.

author: theatrus
author_rank: Frequent Contributor
timestamp: August 17, 2014, 03:31:13 am
content: Also, air bubblers, unless you have an old style protein skimmer, are never use in a salt system. Bubbles remain tiny and foam like crazy in salt.

author: SL4P
author_rank: Super Contributor
timestamp: August 17, 2014, 04:38:31 am
content: A low-cost plastic float switch ?http://www.altronics.com.au/p/s1160a-200v-1.0a-horizontal-float-switch/http://www.altronics.com.au/p/s1163a-200v-1a-vertical-float-switch/

author: AndreasF
author_rank: Frequent Contributor
timestamp: August 17, 2014, 07:34:18 am
content: What about capacitive sensing?

author: PepeK
author_rank: Regular Contributor
timestamp: August 17, 2014, 07:56:33 am
content: A pipe or hose sensing an air pressure could be ok - the air pressure sensor can be installed far enough from the sea water, which causes problems.Or you can connect the sea water tank with a demineralized water tank by a hose / pipe filled with air and use any technology on the 'clear water side'.

author: rs20
author_rank: Super Contributor
timestamp: August 17, 2014, 08:29:02 am
content: Quote from: AndreasF on August 17, 2014, 07:34:18 amSo, that video isn't directly relevant because the water in a fish tank isn't going to be much of an insulator, so it isn't going to function (purely) as a dielectric if you introduce it between two plates. However, if you add a thin layer of insulation over the plates, the addition of water will nevertheless greatly increase the capacitance, because you're reducing the gap from gap-between-plates to thickness-of-insulator (think of the electrolyte in an electrolytic cap -- heck, maybe you could actually use aluminium/aluminium oxide).However, keeping the salinity of the water from interfering could be very difficult, so this may work best as a binary water-is-over-the-sensor-or-not detector (see).

author: tautech
author_rank: Super Contributor
timestamp: August 17, 2014, 09:16:00 am
content: Try this:Attached .docEditDoc edited

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2014, 12:30:43 pm
content: Quote from: tautech on August 17, 2014, 09:16:00 amThe problem with that is it involves a DC path for the current to flow though, which will cause electrolytic action and corrosion.Use AC, rather than DC, that way there is no net flow of ions and less corrosion.

author: David Hess
author_rank: Super Contributor
timestamp: August 17, 2014, 12:49:11 pm
content: Quote from: rs20 on August 17, 2014, 08:29:02 amThe capacitive sensor is insulated from the fluid and can be as simple as a transmission line inside a glass tube making it easy to clean if neccessary. It is more of a dielectric sensor then and compensating for a lossy dielectric like water or salt water is not a problem but signal conditioning is not trivial of course.

author: sigxcpu
author_rank: Regular Contributor
timestamp: August 17, 2014, 06:10:36 pm
content: I did a capacitive sensor using two 1m parallel rods of Al inserted in a plastic tube (galvanic isolation from the water). I measure the capacitance bitbanging two pins on the MCU counting how many times I need to charge this Cx to fill another bigger capacitor (0.1u).I didn't test it in real life (1m water) but it provides pretty repetable results with ~30cm of water.

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: August 17, 2014, 09:46:40 pm
content: Quote from: Richard Crowley on August 17, 2014, 12:59:37 amI would +1 that.There is a version of air pressure sensor that works pretty well on large tanks < 10 m high. It is based on measuring a pressure of air in a tube or more specifically a vacuum in a tube inserted into a tank upside down. This method requires read-out of outside barometric pressure as well. Differential pressure sensor (one side is out another in a tube) positioned on top of glass tube (Honeywell makes many of those) will work perfectly for any kind of water.For fish tank I would probably use 4 (or 2) load cell solution by vandalizing cheap "stay fit" scale and placing sensors below the tank. It can be calibrated accordingly and nothing need to be in a tank itself.

author: tautech
author_rank: Super Contributor
timestamp: August 17, 2014, 10:36:14 pm
content: Quote from: Hero999 on August 17, 2014, 12:30:43 pmComments accepted, but with this elaboration: (added to doc)Due to resistor values, current will be uAAny corrosion will not affect circuit operation as the salts/oxides conduct.Only 1 probe is constantly immersed.Probes can be sourced as Stainless welding wire and therefore cheap if replacement needed.Sensing circuit is very cheap to build, I suggest you rats nest it for a trial and evaluation.

author: Zero999
author_rank: Super Contributor
timestamp: August 21, 2014, 07:49:51 pm
content: Yes it'll work until the wire corrodes completely.The correct way to do it is to use AC, so there's no net flow of ions.