The other classic fluid level sensor is the float-driven potentiometer as used in car fuel gauges. It's quite easy to cobble one together out of bent wire and bits of packing foam.
That's the only way I got rid of corrosion, vapor and false readings, after trying almost all techniques described by Andreas in this video. Instead a regular potentiometer (which can corrode too), I ended up using a AS5600 magnetic-position sensor with both sensor and corresponding magnetic embedded in epoxy resin.
There are immersion style capacitive based sensors that are simply a tube whose length can be adjusted for tank depth. The materials are offered in a range including corrosion resistant. Commonly used with petrochemicals.
I use mine to monitor my gasoline tank for my tractor out back by the hay bails, but I think birds or something keeps stealing the styrofoam off the end of the coat hanger. I keep adding a new wad of white styrofoam from the box I got my new dryer in, but someone keeps stealing it. Couldn't find anything modern so I used the old "coil-wiper" volume knob from an old vacuum tube radio my grandpa had plugged in out in the barn. It sounds a bit crackly when it turns if the wind sloshes the gasoline around, but at least it keeps a regular incandescent bulb brightly lit as long as there is gasoline in that tank. It's so nice when you don't need nothing fancy to get the job done!
This video is so awesome! About 8 years ago, I needed a sensor for an expensive semi transparent plastic tank. I did a lot of thinking, and purchased a lot of different sensors and made a lot of different trials with prototype tanks. In the end I decided that I only needed to know if the level was 3/4 full, and 1/4. I ended up using 3 temperature sensors. 2 glued to the outside of the tank. One for ambient temperature near the tank. Sensing the temperature difference between them was surprisingly accurate. When the level got low, I got a warning, and could turn on a pump with a timer, to fill the tank to approximately below 3/4, or stop at 3/4 if reached.
Very interesting approach! What happens when the liquid temperature equalizes with the ambient, or was that just not much of an issue in your case? Perhaps something similar could also be used to measure flow through a pipe by sampling two points on the pipe some distance apart along with the ambient temperature.
@@benhetland576 in my case equalizing of temperature was never a problem. I think it could be because it was mounted in an engine bay, so when it was operated the ambient would rise, but due to thermal mass and location, the water temperature did not increase significant during operation.
@@benhetland576 I don't think it would be as easy to do with a pipe? I also think the pipe material and temperature of the liquid is pretty important in that case. But I could be wrong 🙂
I worked for a company, the measured the amounts of screws in their bin with scales, knew right off when it was getting low. Works great for such things.
@@einars899 yes I know it from water pressure balancing systems in pipeworks. The balance vessel stands on 3 feet while there Is one weight sensor under one feet.
I used this approach in my van conversion. I was sick of the 1-2-3-4 light indicators for the fresh/gray water tanks so I fitted weight sensors under them and worked on the principal that 1L of water weighs 1Kg.
I've worked on a project where we needed to monitor water level, we used a float in the chamber with a magnet mounted in the housing. We then had an array of Hall effect sensors along the tank which were monitored to identify the position of the magnet. This was a nice contact free solution which avoided risk of fluid ingress into the electronic housing.
@@AndreasSpiess I would expect they were attached to the outside of the tank. The float on the inside of the tank is restricted so it can only travel vertically up and down the inside edge of the tank (and therefore always readable from the outside as it passes the nearest hall sensor). Nice idea @Jack Soldano
@Pete Mundy Basically this, we had a tank with a channel for the float to hold it in a specific position, the float would sit at water surface level and house the magnet. On the outside of the tank along the channel was a PCB Hall Effect Array with around 10mm spacing between the magnet and Hall effect sensors. This is not the most accurate solution but depending on your algorithm can give you around +/-2mm accuracy
Great memories about my industrial automation lessons back in time. May I add something : for measuring pressure in order to get a fluid level, you need (in most case) a second sensor perpendicular to the tank wall to measure the static pressure (unless an open tank, due to level and temperature variation, or just the appliance is an pressurized tank) and them substrat the static pressure to your measured dynamic pressure to get the relative pressure of your fluid level. The main point of that 4-20mA sensor you introduce is that if there is an open loop (wire cut somewhere) or a short circuit, you will notice it instantly (by getting 0 or ♾ Amps) and this is why sensors with this reading range are WIDELY used in industry. (Way much that any other kind of sensors, and for many appliance : temp, flow, angle, etc.)
You are right that you have to subtract the outside pressure. Some viewers use a second pressure sensor. I could imagine to use the weather forecast if you do not want to be very precise. I was not aware why the current loops start at 3mA and not at 0. Now I know. Thank you.
That's very interesting, I have a long term project to upgrade a small cabin in some fields belonging to my father in law. I'd like to make the water tank autonomous, filling/monitoring from a well, I was thinking of using float sensors or the passive sensor that was used on the coffee machine. But I quite like the idea of those pressure sensors, but now I have to think about static pressure?! Yoinks.
@@BobHannent I think for that small home appliance, using a constant value based on average atmospheric pressure for static pressure is fine ;) Measuring static pressure is mandatory in tanks where this static pressure is subject to significant changes
Very interesting :) I once made a simple water level sensor with a capacitive approach. It was just two parallel copper tape strips on a long plastic sheet, covered with tape for isolation. When submerged, the water changes the capacitance between the two copper strips, which can be measured by an MCU simply by toggling a digital IO and measuring how long it takes to charge and discharge the IO (libs are available, usually used for touch sensors). This way you can tell how much of the sensor is submerged.
Maybe the copper strips could be replaced by a regular 2-lead cable? Like one of those flat ones used with lamps on 230V AC, or and old telephone cable or antenna feeder cable with that little flat segment to create a distance between the two wires (anyone remember those?). They come ready made and sealed in almost any desirable length, so only the end needs to be sealed off.
i use this a similar setup for monitoring my two water tanks using speaker wire to measure the levels of a 3k gallons and a 5k water tanks .. most consistent thing I've found to measure the levels that doesn't include me sticking my head inside.
A couple of years ago i used two insulated wires as a capacitor in a ne555 resonant circuit. The liquid then serves as a dielectric and the change in frequency can be recorded very well with a microcontroller.
This is the same concept as used in the shorter sensor I had in the video. It is interesting that it also works for longer distances. Thank you for sharing that it worked.
I have attempted a similar scenario but with steel cables used for laundry with thick polymer insulation. Didn't work at all and never thought to try copper. Did you try it as a twin lead arrangement? As a signal transmission line? Not sure if I over engineered it or used inappropriate materials. I will revisit this project from my notes but would like some feedback to improve on my research.
@@xDR1TeK I used two configurations, two parallel cables and one cable in an aluminum tube. Both worked well and are very sensitive. A drop could be detected in a 1L container. That makes the absolute accuracy a bit problematic. It is important that the 555 sits directly on the "capacitor". Attempts with a feed line in coax were not really successful.
@@grosseruser I went all over the physics to calculate the dielectrics and permittivity along with conductance and inductance of the transmission line based on immersion and different intrinsic impedance for a transmission line. Too much, for so little. and yet the 555 wins again. :D
Great video, Andreas. I've created a level sensor for my house heating system tank using the TOF approach. Used a VL53L0X with a wemos D1 mini, one 18650 cell and a small solar panel. Measures were sent to a rpi running mosquito. Had issues with corrosion, so needed to encapsulate the sensor pretty well. Apart from that the thing is working now for over 5 years.
@@AndreasSpiessYou really covered this well Andreas and mentioned practical points. eg my heating oil tank has two sensors (because it's so important). A VL53L0X and a cute ultrasonic JSN-SR04T car bumper sensor (which can't read under 300mm). Even when they read 6 times a minute and I massively average the output the result is 'noisy' (eg maybe the liquid sloshes in the tank - maybe a video on signal conditioning is a future idea). @pedrobaco563 mentions corrosion - oh yes! On my sensors the oil vapour destroyed the plastic and silicone casing - yup silicone conformal goo is no good with oil. Allegedly polyurethane is oil resistant. My 3D printed housing HAS been good though though I can't recall if I used PLA or PETG. The project is written up should you need it. Roger F
Pressure can also be measured from the top, placing the sensor at the end of a tube that goes to the button of the tank. The tube inner diameter and the weight of the fluid determine the pressure
This doesn't normally work reliably long-term, since various effects tend to cause the fluid level to rise in the tube over time. The setup has been used in the past though by very slowly feeding gas into the tube (normally bottled nitrogen). The gas pushes the liquid right to the bottom edge of the tube where it bubbles out, giving a consistent effective tube length. If you only want periodic readings, you could use an aquarium pump, controlled by the micro, to provide the pressure.
@@jenskaa4044 Yep. There are a few applications where it's not a problem. I think washing machines often use this method. Just make sure you don't need accurate readings for more than an hour or two between emptyings.
If the pipe has a T at the top then a positive pressure device (air cylinder or small air pump) can be attached to the third part of the T, the first and second go to the sensor and subsurface pipe respectively. It was called a bubbler system and I've used it to measure seawater levels for months at a time. The and will bubble out of the bottom of the the and always maintain a pressure proportional to the depth of water, an advantage being that atmospheric air pressure is cancelled out.
This is a timely video for me. I live in California, in a town that was mostly destroyed by wildfire. My house was saved but the water treatment plant was damaged. They have repaired it enough that we have water but very low pressure. I have to pump water into a tank to supply our house with water. Right now I have a float switch in the top to tell me when the tank is full but now I am going to put a pressure sensor in the line coming out of the tank so I can monitor the level in the tank. Thanks for the video :)
Glad to read that you and your house survived this catastrophe! A pressure sensor is probably the easiest thing in your case. I forgot to mention htat you ahve to correct the values with hte current pressure (obtained by a weather service) if you ant to be precise.
@@AndreasSpiess I didn't think of that. I wonder if I could use the pressure sensor in conjunction with something like a BMP280 for barometric pressure. But, then I would have to do math :)
Hi! I am Jacques from Quebec. I had to build a liquid monitoring device to allow reading the level of the liquid so I used load cells sensors. These worked fantastic. Thanks for your very exciting video.
You are right. I should have included measuring weight in my video. Because both applications cannot be done like that (tank burried in earth and coffee machine has also waste water and waste grinded coffee which adds to the weight) I forgot it.
Perfect timing! I have a small decorative fountain that I brought in to store for Michigan's winter. I wanted to outfit it with a sensor to stop the pump if the water level dropped to prevent damage and alert Home Assistant. Now I have no excuse to forget. Once again thanks to the guy with the Swiss accent!
There is also another simple way with ESP32. I had to measure when plastic bottle with liquid is near empty. I just cut circle from one side Copper PCB with radius 15 mm and made short connection with one of capacitive touch pins of ESP32. PCB was put on outside surface of bottle near bottom. After setting threshold of readings, it works perfectly for my project.
Superb video (as usual). I use ultrasonic HC-SR04 sensor to measure water height as water fills a ground water tile drain pipe. This pipe is not perpendicular to the horizontal plane. As a result, finding a sensor that can measure height accurately with the 5" diameter pipe that fills with water at a 45 degree plane is problematic. Ultrasonic sensors are the only option in this case and work well to trigger / power a submersed pump to drain the pipe when water rises to a set height, below ground level (I use 5" / 12 cm) at preset maximum limit, which triggers a simple arduino GPIO power (using a 12V relay) ON command, for 45 seconds, then resets until the water rises again and triggers the 12V pump as required. Corrosion is a minor issue (the SR04 sensor is not in an enclosed atmospheric environment) which is reduced by making a 3D printed case to protect the SR04 circuit board. But the emitter and detector sensor cones do eventually show signs of oxidization and effect performance after 2 years. The reason the sensor lasts so long is because the median atmospheric temperature rarely deviates from 18 C. Because HC-SRO4's are so cheap (less than $12.00 for a box of 5), replacing them is cost effective for my particular performance requirements and durability. This setup wouldn't work for all-season outdoor environment. Anyone know of an Arduino shield board available with built-in power relay and 2 or 4 line display with horizontal GPIO pins? The only thing I would need to plug-in would be the SR04 cables. My setup is built using classic Arduino board with patch wires on a development board, display and kit parts only. It's not elegant or rugged, though I wish it was. It's ugly but works. I've been running this setup for 3 years with only one SR04 corrosion failure.
Good overview, thanks for another great video! I have very good experience with the last sensor you mentioned - pressure one with 4-20mA output. I’m measuring water level in the outside well. Level is in the range of 2-3 meters. And this sensor combined with interface board from Mikroelektronika (correct board: MIKROE-1387) is reliable and precise. I read the values via SPI, just a single 5V/3.3V power supply is needed for powering the board and also the sensor.
No, the sensor works on approx.16V. This voltage is provided by the interface board, as it contains DC/DC boost converter. And the board also contains the DAC with SPI interface. I made a mistake in my previous comment, the board used in this project is actually MIKROE-1387. Manufacturer has a datasheet and also schematics for the board on their web pages.
Ive used the inexpensive moisture sensors for automatic watering and sump pump applications. They are so cheap I dont mind replacing them annually when they corrode - especially outdoors or in salt water. One design practice I suggest is if you are pumping fluids is to include a purely analog override based on the raw sensor output when tank full, to switch off the pump if the controller crashes.
Great video Andreas, In my project I used the last sensor, which is the pressure sensor. Measuring the current was a bit tricky. A normal resistor will not work because the current range is limited to 20 mA and the ADC resolution is not enough. For this purpose I used the Ina219 current sensor board with a built-in shunt resistor. This delivered better results. It is important to use a stable 12 or 24 V power supply. Because any voltage changes in mV level has an effect on the results. I used software filter to deal with this issue.
I use a VL53L0X sensor for water level measurement. This sensor is mounted so that the highest water level is about 10 cm below the sensor. To avoid light influences from outside the sensor unit was mounted in a plastic tube. Attention to the diameter of the tube. The VL530X has an opening angle of 25-35 degrees. If the tube is too small, internal reflections will occur.
As long as the water is still and not moving this can work, but the moment the surfaces moves the laser can reflect away from the sensor, or even not be reflected at all (brewster angle). So while technically possible, not a very safe way to measure. Unless you place a floating reflector to the surface of the liquid and use that as a target.
@@SarahKchannel That's right, that's why the plastic tube goes to the bottom of the tank. In the lower end of the tube are holes so that the water can flow in and out. In the tube itself is a white plastic float as reflector. Ping pong balls are good for this.
@@juergenheisel7360 each medium, or fluid therefore, has a different refractive index. At certain angles a surfaces is either fully reflective or fully transmissive, or changes polarisation angles of the source. I am using the VL sensors in other applications and love them ! As long as the distance is not greater than 1-1.2m they do a good job.
@@SarahKchannel In my case, there are even extreme differences, once clear water, the other time with foam (washing machine). That's why I decided to use a white reflector to get the same measurement results and yes I can confirm the distance information.
Great video - shows the things that are needed to consider when someone asks to measure water level, - what do they really want to know is a second question which applies to all sensor questions.
Thanks for the primer on sensors! I have a water cistern I'd like to measure that has some exposure to the elements, and was trying to figure it out. This helps. (As for the coffee problem, though, I usually just make it for my wife. 😁) 👍
Your solution is much better than mine, of course. But then I would have to get up very early (she works in a hospital) and could not work the long evening hours ;-)
@@AndreasSpiess Fair point! It does help we get up at the same time. If anything, I'm the one that makes us wake up earlier. (Kinda funny, as I too prefer the evening hours.)
Thank you! I greatly appreciate videos like this that focus on mundane yet important stuff. I get sooooo tired of superficial (shallow dives) that basically exclaim, "Wow! Here's a bright shiny new object!!" I want to know how to actually get stuff done. Your videos tend to eschew the hype and focus on the "Here's how to get stuff done" aspect. Yeah. Sure. Of course it's often boring and tedious... but it's also crucial information.
Thanks, Andreas, for another useful video. I have been trying to measure household water consumption for the last several years. The pressure sensors (shown @ 9:30) yielded excellent real time information, but there were two problems: 1. Different locations of the sensors in the home network results in far different information, and 2. The relationship of pressure to flow is an exponential relationship in dynamic conditions. Each of these problems can be solved but then there a difference between the hot and cold-water systems. When the hot water tank fires it pressurized the system fouling some of the mathematics. It was getting too complicated for me. Between these two problems I have found that better real time information comes from a magnetometer mounted to the side of the municipal water meter. There is a ‘nutating’ magnet disk that rotates for each small amount of water that passes. By monitoring this I’m able to accurately count the magnetic pulses vs. time. Kevin Darrah has a wonderful presentation of the idea though I had to take it in a different direction because I’m battery powered. Most of time my monitor sleeps and wakes every 8 seconds looking for a change. If change is detected, then the device is on full-time and counting. After 20 minutes of observations, the data is bulk-uploaded to Thingspeak to save on batteries. That is the summary of the last 2 years of my life!
Measuring consumption obviously is very different to just a level. I also would have chosen your route. Or I would have tried the project which reads the municipal water counter's display with a camera and an ESP32...
@@AndreasSpiess A non-intrusive method I learned about many years ago uses two sensitive microphones on the outside of the pipe a fixed distance apart. The noise of the flowing liquid (eddies, bubbles, etc) is digitised and compared with the other microphone to find a statistical best match. The time difference between the two matching samples and the distance apart of the mics gives the flow rate.
I am using standard "arduino" ultrasonic sensor for measuring water level. Sensor itself is mounted 10-15cm from top level. Difference between empty and full tank is about 1m. The setup works mostly fine. Output has some noise, so i use averaging in software. Corrosion might damage the sensor one day, but it works continiously for like 3 years now.
I have used your video as inspiration to make a salt level sensor for our water softener , this uses larges blocks of salt where the height diminishes when being used by using a laser TOF and measuring every 6 hrs I can also check the connectivity as well as the levels itself. I create a simple stand to mount the sensor and used 4 wires to connect to a ESp32 with esphome currently using USB power from the wall, will create a USB powerbank version with deep sleep as well thank you for your insights !
Cool! This project is on my list since quite a while. But the level does not move fast. That is probably why it did not make it to the top priority ;-)
My favorite fluid sensor is a reflectivity sensor. I found one that looks like a clear led. It has an LED and a photo transistor in the same casing. When dry the light bounces if the outside of it's case and into the transistor, but when wet the similar density if the plastic and water let more light escape and the transistor turns off. I use these to detect the presence of water in buried conduits.
Another viewer also mentioned those sensors (from Honeywell). I was not aware that they exist. Do you have a cheaper source (These original sensors are quite expensive).
Thanks again for your work and the level sensor overview. In my house, I am using the float switch sensors to monitor the water tank of my dehumidifiers (Aldi) together with a 433MHz door/window sensor. Several XKC Y25 capacitive sensors are also in use in different configurations, I tried to use a bigger capacitive level sensor as a rain sensor, which failed. But it was usable as a touch sensor hidden behind the wooden board of a piece of furniture. For my oil tank I built a pneumatic level sensor using a BME280 as a pressure sensor and a small air pump. First as a proof of concept. But it is now for years in productive use, performing in the range of 0.1% deviation, which means
The Make journal featured this pneumatic system system in their last issue. They seem to also need a valve. But it is definitively something I want to look at. Do you have more information to share?
@@AndreasSpiess Part 1 @Andreas Spiess In theory valves are needed. But I need just e few measurements a day, so I rely on the natural leakage and block the measruements in between by SW. The theory of operation is well described in German Wikipedia "Pneumatische Füllstandsmessung"
@@AndreasSpiess Part 2 My tinker-solution is described in homematic-forum post 328133#p328133 ff. As you can see: tinkering and proof of concept. But as it happens sometimes, continues beeing in operation. And even the TÜV had no complaints. More important than a valve, is a pipe to the bottom of the tank. This already was built in. The tank was equipped with a "mechanical" solution by Afriso, which was not very reliable and not very precise. But I could use this pipe. This company and some others offer also electronical solutions nowadays. The pressure range of the BME280 fits well to the geometry of my tank. Otherwise a dedicated differntial pressure transducer would be required.
@@AndreasSpiess Yes, keep it as simple as possible and as precise as necessary :-) The system is kind of open to the liquid side and the air can escape, the oil returns into the pipe..
Thanks! I liked this subject, because I experimented this on my pool, with unfortunately not a success due to corrosion and accuracy. I appreciated the open collector explanation, and the various usages. I faced with one of them on my 3D printer with an inductive bed level sensor, which led me to fry the motherboard...
I had a similar issue with my coffee machine. I ended up using an IR sending a beam slighly up (around 30 deg) from the bottom. On the backside of thw pexi-glass tank I glued a bit of silver foil. Now, when the water is low, the beam is totally reflected from the water level towards the mirror back into the sensor besides the IR diode. Works a charm since many years.
Great Video as usual ;) You mentioned LIDAR and Ultrasonic. I recently learned that conventional radar is a commonly used strategy for measurement of solid and liquid levels in the industry. 😎
several years ago I thought of a pulley system with sensors that when countering the turns of the pulley indicates the distance of the rope or chain I think that if you put an object that can float at one end and a counterweight at the other end can work with that we can calculate the height of the liquid, the most scientific approach i think is use vibration frequency from the exterior of the tank, frequency will change depending on how full or empty is the tank (sorry my english i know is not good)
The chain systems seem to be used in the industry for example to measure the level of lakes. It for sure can be used by makers. The resonance method is probably a bit more complex to use.
My father in law has also an tank for watering the garden with an simple mechanical "display". On the top panel of tank he drill an hole. At tank below he fasten an plastic bare (cable channel) on an float (Styropor or canister). So if the plastic bare looks approx 2m outside of the top panel hole the tank is full, if the platic bare goes down the tank will be more empty. A small rack outside were some reed switches are fasten and the magnet on the plastic bare could also switch on or off a pump. The advantage is that reed relais are not inside liquid.
In a company where I worked, we had a problem how to measure liquid height in a small plastic container which was also under a bit of pressure. We tried many approaches, like capacitive reading with glueing copper strips on the outside wall of container, but it turned out that it is too sensitive to an environment and when liquid in tube that went out of container touched another container, values of capacity reading changed. Resistive measurements were also not good due to erosion and contamination. We couldn't measure pressure, as the air above liquid had different pressures. In the end we end up measuring container weight with a load cell. Not ideal but we couldn't find any better and cheap way of doing it without massively modifying container itself. In case we would make container itself, we would probably make it with potentiometer and a rod with floater, like in a car gas tank.
I've found an air pressure sensor like a MPX5010 is an inexpensive way to accurately measure levels, but you need to add a small air pump to pressure up the measuring tube until air escapes from the tube at the bottom of the vessel. This give you a balance pressure equal to the pressure of the water over the inlet of the measurement tube that you can measure and calibrate.
This method was described in other comments. Some use a pump, others not. The pump seems to be necessary if your level never drops to 0 because the system can lose the air pressure and the water fills the tube after a time.
@@alexrossouw7702 You certainly can, but it will be much less accurate as the pressure differential you're measuring is much, much smaller, especially in a smaller vessel like a brew kettle.
Hi. You can use a vertical tube with top cap and open bottom. The liquid level compress the air inside of the tube. To mesure the level, two options: 1.- a flex diaphragm that push a microswich 2.- analógic sensor that measure de air pressure inside of tube.
A few other viewers mentioned this method and a similar one with a pump. I assume your method needs a very tight system if you want to use it longterm?
@@AndreasSpiess Nothing difficult to obtain. PVC pipe, plastic, cooper, .... Tube must be well sealed with teflon, glue, solder, ... If air escapes when the tube is submerged, it does not work. Even so, it is a very cheap system and works without mechanical or electronic complications for many months or years. It is a system widely used in water treatment plants, even for dirty water, for years.
I engineered and prototyped (successfully) a resonance volume sensor for beer barrels, in the time when the Z80 processor was the only good and cheap option. The barrel was exposed to fine tuned sounds which allowed to compute the volume of the barrel, the air and the liquid separately. It was however too complex for the time and the company opted for standard barrels and weighing on the fly. The accuracy was not so much of a problem by then. Nowadays maybe, but I am not good in marketing... I am a maker 😊
Weighing small tanks is probably a reliable and simple solution. Another viewer also mentioned to measure resonance for the measurement. An interesting option. I wonder how narrow the measured "dip" would be?
It takes a bit more, but we used 'capacitance probe' sensors to measure water level in tanks. It had a thin rod centered in an outer tube that had many holes along it. The two were electrically isolated from one another. An oscillator circuit was used to put this in one leg of a 'bridge' (similar to a wheatstone bridge, but composed of capacitors). As the level rose/fell, the capacitance between the outer tube and inner rod would change, resulting in a signal across the bridge. The probe was made of stainless steel, so it did not corrode in the hot water. Probably a bit too complicated for most hobbyists, but just wanted to share. Another nice video, thanks.
Great video, Andreas, it pointed to the real difficulties I also encounter, as corrosion and cludge of mechanical switches. In my case I had to measure the level of a underground tank feeded from a 100m well. The only solutions that worked for me was a floater with a long cable that has internally a switch that opens when the horizontal angle exceeds some value. Also a pressure gauge 4-20mA at the bottom of the tank
Maybe the second part of your last sentence is cut? These mechanical switches are for sure quite robust as long as you do not need to measure aggressive fluids...
In racing you can find level switches like the Honeywell LLE Series used in fuel swirl pots and dry sump oil reservoir tanks. They use optical sensing at the tip of the unit based on changes or refraction. It is not uncommon for fuel to be weighed prior to being added to a race car rather than using volume measurement. Another thing we deal with in race cars is the slosh which makes measurement a real pain. We end up having to buffer the results of the measurement to a high degree.
I always wondered how even my car (I am a prudent Volvo driver;-) ) is able to get the right value. In your case it must be much more complicated... These Honeywell LLE sensors seem to be threshold level detectors. I can imagine that it would work if you place an LED and a phototransistor close to each other.
Very interesting. I had a similar problem to your colleague's; I need to measure the water level of a 30m deep water well and of an underground reservoir. I ended up using two water pressure sensors (one with a 5-20ma output and the other on rs485 modbus); they are managed by an Arduino mega and I get remotely the readings by SMS through a GSM module. Also, the Arduino drives the pump that extracts water from the well into the reservoir; and it's all configured through a Nextion touchscreen monitor
there are also optical level sensor that indicate the threshhold. The sensor has an infra-red emitter and detector aligned within an accurately shaped cone to give good optical coupling when the sensor is in air. This coupling is greatly reduced, when the sensor is immersed in liquid, as the infra-red light escapes through the liquid rather than being reflected back to the detector.
Others also mentioned these sensors. They seem to come from Honeywell (expensive) or Adafruit (a bit less expensive). Maybe somebody even find a cheap clone?
Great topic and info Andreas, brilliant as always. Thank you for creating this. Level sensing is a very popular subject and complex (with challenges) at times. In the industrial world, Radar for level is also very popular, with different frequencies and ranges available. Ultrasonic can also use different frequencies, depending on range. With Ultrasonic, keep in mind that the temperature will affect the accuracy of the signal, therefore sensors have temperature compensation internally. You can use a 'still well' to eliminate disturbances on the liquid surface affecting your signal, as well as air movement affecting the return echo signal. With pressure, you will find 'front-flush' sensors which are typically used in the food industry, this reduces the chance of contamination. Even optical sensors are used for level at times, infra-red light can be your friend. For your viewers who want more info on this topic, I would recommend doing a google search, all the leaders in the industrial electronics have various sensors for this application and a world of information to share with you.
Thank you for the additional information. The VL... TOF sensors use infrared light, BTW. Radar is also an interesting topic (a longtime topic on my list)
@@AndreasSpiess As a Swede I want to mention Acconner. The advantage is that the radar sensor does not have to be in contact with the fluid. It works with, for example, a plastic disc between the sensor and the fluid. The company mentions the sensor's low energy consumption. Such a property you usually appreciate. ua-cam.com/video/4OEXVjBmmFw/v-deo.html&ab_channel=Acconeer
My first custom water level sensor was for my home tank on roof. It was 1Mtr tall and i built it first 10 years back when i was in 1st year of engineering school with a floating led in a tube, an LDR on the top of it. I used to set the led brightness such that the change in resistance of LDR is linear for linear decrements of the distance between ldr and light source. This solution was good but i had to change the light source every year as there is salt scale builtup on led. I changed from this method to ultrasonic sensor ones which failed much faster. Explored pressure sensor method but that was expensive and sensor drifts over time due to scale builtup. Currently i am using a reed switch type float sensors (which needs to be replaced every once every two years)but working on a capacitence based sensor for precise level monitoring and not having to replace them.
I use one of those screw in style pressure sensors with a range of 0 to 300 PSI with my oscilloscope for engine diagnostic. Works great for engine compression tests and running engine back pressure tests.
I have been looking for a water level sensor, to detect the water level in a garden pond. This turns out to be a really difficult environment for such a measurement. The water is biologically active, coating any sensor in contact with the water in algae and limescale. While the pH of pond water is relatively stable, and close to pH 7.0, it can still be corrosive, due to the high oxygen content. A pressure sensor has the problem of silt build up on its surface, as well as the previous three. A float system only gives an indication of a maximum and/or minimum level. These too suffer from jamming, if there is a build up of lime scale of biological growth. The best uses a water proof reed switch and a floating magnet ring. The non contact surface water level sensors, suffer from water ripples, and in the case of LIDAR, reflected sunlight, thought this can be mitigated by mounting the sensor in an open ended tube. All surface sensors fail to give the real water level if the pond surface freezes in winter, with the danger that the pond water can drain away under the ice. I have experimented with an insulated capacitive probe that provides a continuous reading of water level. This works like a coax cable, but with a larger diameter tube and a plastic coated wire down the centre. The dielectric is the pond water. As the water level changes, the capacitance of the sensor changes by as much as a few hundred pF. Making this capacitor part of the tuning element of a Schmitt trigger RF oscillator, allows the water level to be measured as a change of oscillator frequency. Unfortunately my attempts to water proof the outer screen have not proved successful in the long term. The Brita water filter, has a water level sensor which is used to measure how many times the filter is used, and thus recommend when the filter cartridge needs changing. This uses a two wire contact probe to measure when water is in the water reservoir. It solves the corrosion problem by sensing the water level with a very low voltage AC square wave. The microprocessor circuit runs on a cr2032 battery. By using both low voltage and AC, the problem of Electrolysing the water, or the salts it might contain, is minimised to almost zero. I do not know what metal is used for the electrodes, but I guess it must be stainless steel. I have come across an inductive method of measuring water level. This uses two water proofed torrid rings mounted close to each other. The water is allowed to flow through the centre of both toroid rings. The coil mounted on one of the rings is energised with an AC signal, this is detected with a coil mounted on the other ring. The water linking the two coils acts as a shorting turn, coupling the two rings together forming a transformer. This arrangement is used in, not only detecting water level, but measuring its conductivity. FYI. I use a none contact capacitive sensor, similar to the one shown in your video, to measure the level of solution in my PCB acid etch tank. A microcontroller monitor system uses the level signal to cut the power to the tank heater and air pump, if the solution level falls, due to evaporation. This prevents the exposed glass immersion heater melting the plastic tank. The sensor is mounted several centimetres from the tank wall, to protect it from the acid. It still gives reliable readings at this distance.
I like the very nice collection of ideas and practical experiences and challenges there! This is real engineering, finding good compromizes that actually work.
@@benhetland576 the capacitive sensor is the most promising, particularly as it gives a measure of water depth. It has a number of advantages, in that the outer wall of the sensor can be the zero volt of the circuit, acting as an RF screen. It is relatively easy to mount the Schmitt feedback circuit close to the plastic tube and coupled to the electrodes with a short length of coax. This adds a small capacitive offset. . It is necessary to add some temperature correction to the oscillator, and provide it with a stable regulated supply rail, but this can be switched off between measurements to save energy. The capacitive change on a one meter long pipe is significant, between fully filled with water and empty (filled with air). I made my prototype out of uPVC water pipe, while it is easy to water proof the the centre electrode with plastic air line tube, trapping the outer aluminium foil screen between two lengths of concentric uPVC pipe proved to be very difficult, as is making a weather proof connection to the electrodes. The pipe needs to be open at both ends, with the central wire supported at both ends to keep it in position. In a pond environment, it is difficult to keep insects from making a nest in the tube, and water weed growing inside it. The top of the pipe can have a cap, but it must have a hole for air to get in and out, or the water will not rise up on the inside. What is required, is the outer electrode sealed between two flat sheets of plastic, and then these rolled into a tube. I could have used a metal outer pipe, but I did not want to introduce metal ions into the pond water, copper pipe would have been ideal for the outer, but copper salts are toxic to fish. One other sensor we tried was using two lengths of fibre optic cable, mounting the ends so when in water, the light emitted by one is refracted and can be captured by the other. This works well for clean water, but pond water quickly renders the ends opaque. The idea was inspired by the optical smoke detector. It has the advantage that the electronics it is completely galvanicly isolated from the water. By using a modulated light beam, it's possible to eliminate the effects of ambient light, plus the fibres can be mounted in a opened plastic tube or box to shade the sensor from ambient light.
@@nigeljohnson9820 Perhaps you could use some braided metal sheet/band to wrap around the plastic tube, then top that with a layer of epoxy resin to seal it off (and the resin will bond to the pipe through the braiding). The inner wire can just be a regular insulated wire. I guess you could also use a cap with a hole at the bottom (water) end too, but the insect and growth problem probably will manifest itself at some point regardless.
For a artisan well you can use echo acoustics, measure the echo time and barometric pressure and temperature to calculate the distance. The accuracy is surprisingly good. You need tables for speed of sound based on barometric pressure and temperature so the micro needs memory to hold the tables but the parts list is low, speaker, microphone and barometric sensor with temperature, the rest is just software.
As someone that works in industrial automation as a profession, great video, few other methods include some of your favorites, radar and guided radar. They are usually used on fluids that can have a vapor, since vapor / condensation can cause issues with the speed of sound with ultrasonics. Another very common visual level indicator is a MLI magnetic level indicator, its a tube connecting the bottom of the tank to the top, there are magnetic rollers which rotate to show the fluid level, the end user can strap hall effect sensors / reed switches to different levels for say a low a low low high high high contacts. Also for intrusive solutions like the moisture sensors you get what we call spiders, theyre a collection of vertical stainless steel electrodes, as the water levels rise making contact from level to level its measured, either capacitively or resistively. 90% of industrial automation uses 4-20mA current loops, but you also get oldschool 0-10V aswell as new stuff like Modbus Profibus Hart( old). A majority of the instruments i look at are flow, this is measured by alot of different means, differential pressure , mechanical , electromagnetic, ultrasonic, mass flow , Laser . The nuts thing is thats not an exhaustive list.
Nicely done! A flashback to my past. Open Collector outputs are used in many places in industrial I/O especially when the sensor is a long distance from the MCU as it reduces the power supply loading on the I/O point. The important point is to decouple the power supply from the sensor. Current loop systems have some concerns about short circuit protection. It can be a party-line with several devices consuming this data. Also, current loop is very often used to send serial data which may be fun to dive into. Nicely done.
Another informative video … thanks. A few years ago I prototyped a multi-level capacitive approach using adhesive copper tape on the outside of an aquarium and the Adafruit MPR121 12 channel sensing board. It worked quite well and I’m finally getting back to an aquarium automation project using that approach.
I've used a salvaged washing machine level sensor to monitor a Grey water sump, was only good for Maximum, minimum but perfect for turning on a submersible pump to water the garden in the hot Australian summer.
Hi Andreas, thank you for the water level measurements review. The radar sensors have the advantage over ultrasonic type in that they are not affected by the temperature of air, which in certain cases can be an error factor
As for the coffee pot, you could build a decorative (wife compatible) coffee pot stand with a load cell in it, this avoids connecting a sensor to the pot itself and also gives you the option of a variable level indicator.
@@AndreasSpiess Yes, that would be a problem, unless full waste trays are significantly lighter than the clean water capacity, which would be workable. I downloaded the manual but couldn't find the water capacity listed.
Oh and if you have a readily available low pressure air supply (like an aquarium pump for example), you can use pressure sensors in another way. Instead of putting the sensor at the bottom of the tank and subjecting it to the fluid, you can pass air very slowly through an orifice and down a tube that is open at the bottom of the tank. If you adjust the air flow so it just barely 'bubbles' out the bottom of the tube, the pressure in the tube right after your orifice will be proportional to the level in the tank and can be measured with any air-pressure sensor. The sensor never touches the liquid. But a loss of air supply will have the same effect as an empty tank, so consider that in your design.
A tube, a floating ball and a bank of opto-couplers. You can hit the tank and listen to the resonant frequency. Weigh it. Use a float and a potentiometer. A floating rod with a resonant coil around it. If the liquid is a different temperature to the ambient you could use a thermal camera. You could heat the tank and measure how fast it changes temperature. Anyway there's a few more ideas to be getting on with.
I use pressure sensors (MXP) for bore wells and tanks. These measure the difference between ambient and 'bottom' level pressure to indirectly measure the water level. Only downside, I use an air pump once per hour to drive any water out of the tube that runs to the bottom of the well or tank.
I think tis is a very good idea. There are a few discussions about this method in the comments. Using a differential sensor seems to be a very good option.
I found another interesting solution in the German magazin "c't Make, 6/21". Here the water level in a cistern for collecting rainwater is measured. A simple plastic tube is put from top of the cisterne to the bottom and air is pumped into the tube. As soon as the air escapes at the bottom of the tube, the pressure in the tube doesn't rise anymore and you can calculate the height of the water. A blood pressure meter can be altered for doing this and can be connected to a microcontroller. Since all the electronics is outside the cistern, there are no problems with moisture.
I am measuring marine tides the same way, only having a silicone tube with an open end placed from surface to a specific depth. One sensor reads ambient air pressure, one air pressure within the tube, combine both values for higher accuracies. My sensor is now living a couple of hundred meters off shore, without any issues for about a year now.
I used another solution that worked very well. I made a capacitive sensor with a pvc pipe covered with aluminum foil and a wire inside it, going from the top, looping at the bottom and coming up again to not have exposed end on the bottom. The foil and the wire formed a capacitor that changed its capacitance according to the water level. I used a slightly different configuration of the 555 astable config and this sensor was the timing capacitor of the circuit. Its frequency changed according to the water level. I used the pin 7 of the 555 as a open collector output of the sensor and an arduino to read it. I related the frequency with the water level and displayed on a single 7 segment display. As it was on my dad's kitchen and the sensor was wired there was no need to save power. Of course there is more energy efficient solutions but this system was reliable, stable and considerably accurate.
As an indirect method, to mesure water level can be used the 2x water meters with inbuild LoRaWAN controler or with impulse output. That approche gives accurate measurement to build balance. The water meter also can have built-in pressure sensor.
Good day. Searching also for a solution to measure my 3 meters deep rain water tank, i ended originally in mercury switches enclosed in plastic bottles and tied in a pipe every 30 cm i had a quite rough idea where the water level was. The mercury switches sealed in the plastic 0,5 liter water bottles lasted more than 5 years, yet I WANTED MORE ! I ended up in a pressure sensor mounted not in the bottom (i could not, since the tank is made out of concrete and is below ground level) but on top of the tank, taking advantage of the principle of Communicating vessels. A long tube that reaches up to 1 cm from the bottom of the tank and the other end goes to a (5 psi for 3 meters tank in my case) pressure sensor. I made proper calculations for surface to height / pressure difference, and voila !
Nice overview, Andreas, A couple of additional types: Some coffee-machines use: 1) Magnetic sensor (Hall-effect) with an encapsulated captive magnet that floats in the tank. (This is also an "indirect" sensor, as it also needs the water to have weight ;) A reed-switch could be used, but hall-switches are cheap enough. 2) Optical "brekingsindex" based-sensor: A total internal retro-reflector "feature" in designed-in into the plastic molding of the tank; LEDs+ PTs observe this reflector. If the tank gets filled, the total-internal reflection no longer works (as the RI of water is similar to that of plastic); the reflector only works when air (emptiness) is present behind the molded retroreflecting feature. A "better" contactless type imo would be one that observes resonance-frequency - if you treat the "cavity" above the water as a helmholtz resonator, the base-eigenfrequency is strongly dependent ton the water-level. A sounder (speaker+microphone combo) can easily detect this at a distance, and estimate height. Unlike ultrasonic ToF, as the frequencies involved are low, a moisture-blocking "shield" can be placed in front of the speaker/mic. This resonator may be restricted to an immersion-tube if you wish to be agnostic to the shape of the rest of the tank.
Interesting new concepts! If I remember right, our old coffee machine had a moving part in the tank. Other viewers also wrote about these optical sensors which work with refraction. Honeywell seems to sell them. But they are expensive. I wonder if there is a cheaper source. They are very good because they can be easily protected as you write. The resonance way sounds a little adventurous for me. Theoretically, it should work. But I do not know if the resonance is distinct and if there is only one. Did you use it and did it work?
@@AndreasSpiess The Senseo/Philips machines use a floating magnet, and (if I am not mistaken) the Krupps machines use the refractive-index mechanism. The latter is nothing more than an LED and a phototransistor (on the machine) and a molded retroreflector "prism" in the water-tank that gets positioned facing the optical components. I have used the resonance-concept for a different application (more like, injecting white noise, and looking for peaks; all this before optical ToF was hot). A friend of mine has used a mic/speaker arrangement on an ESP32 with a PVC pipe (in resonance-mode) to measure the level of his garden-pond. By placing the pipe at a shallow angle (instead of straight-down) he gets more dV for the same dh. Eigenfrequency-seekers are surprisingly easy to build - if you take the microphone's (or any sensor's) output, amplify+clip it, (i.e. amplitude-constantify) and feed it back to a speaker (any actuator), you tend to trigger the dominant eigenmode. Frequency-counting the clipped signal is straightforward. I can imagine though that it may not be nice to have a coffee-machine-tank whistling at your guests at random moments ;)
This Eigenfrequency sniffer is interestig! Thanks. The prism sensors were mentioned in other posts. But so far I did not find a cheap one. Adafruit has one for more than 20 dollars.
@@AndreasSpiess If you are interested, I have uploaded a video I made long back illustrating a prism-(total-internal) reflector implementation with a laser-pointer: ua-cam.com/video/esRmX1tBS5g/v-deo.html
Thanks Andreas. This is something I have been thinking about as would like to be able to measure the amount of heating oil (kerosene) in our outside tank. So this has given me some ideas.
Maybe you also read the comments on another sensor: A tube to the bottom of the tank and a pressure sensor (and sometimes a pump) on the top outside the tank. This seems to be a very good method. Maybe I will make a video about it in the future...
IR sensors with floating stuff can be handy as well. Note you should consider vapor for any top sensor as a critical issue. Depending on temperature and fluid, top sensors will quickly become unusable due to condensation on the sensor. You have to eat or ventilate them to keep them clean. After various attempts with Sonars, IR, Conductive sensors I ended up with these basic reed switches in plastic enclosure in serie, they give low precision but high reliability. Time of flight is also impacted by water surface, if this is moving or if fluid is filled from the top and cause lot of waves they'll have weird output requiring additional software processing.
Another one is linear capacitive sensing. They can be made with a couple of long conductors at a fixed distance and completely isolated. The fluid's dielectric is exploited to know the level by measuring the relative capacitance. I've made a video some years ago about a diy sensor that uses this principle. It was designed as a threshold sensor but the linear signal can be picked up to get the actual level. Being completely isolated they can be submerged with no risk of corrosion or contamination. They can also be sticked to the external lining of a plastic tank.
@@AndreasSpiess Thank you. With a NE555 you can definitely make a suitable circuit. I rather used a fast cmos though, as it performs better IMO: higher input resistance => better Q => higher sensitivity and larger range. The circuit layout is always critical. Greetings.
After many trials with ultrasound (not reliable due to humidity over the water and animals like spiders), pumping air in the water (pump and pressure sensor are available in cheap systems for reading blood pressure) which also was not reliable. In the end, I decided for a pressure sensor (available not only for 30psi online). I used a plastic pipe and fixed the sensor water tight with epoxy resin. The reciever is a Raspberry Pi via analog/digital converter. Works since years in my 2m deep water cistern in the garden.
No. The air in the (empty tube) was not a problem. The tube is sealed at the bottom in the water. But in the beginning some condensing humiditiy made disturbances at the connector after a year or so, resulting in misreadings. I had to clean it and avoid from condensing water.
Thanks for this great video, Andreas. Wanted always the same like you, a reliable water level sensor for my Gaggia coffee machine. Bought this capacitive sensor like shown in your video and was happy, that it worked also with just 3.3V. So the integration in my Sonoff S20 Socket was very simple. I use this socket for a couple of years now to remotly switch the machine on. Now I could use the spare GPIO for the sensor. In combination with Homebridge I get now the messages on my iPhone - very nice! :-)
Great video as always! But don’t forget the most important use case of a sensor like this… to monitor the water level for the Christmas tree! That is very important these days 😉
11:10 this recalibration is a bit dangerous because the output signal is still not guaranteed to be within 10 mA even if the pressure is always below the corresponding level. E.g. pressure spikes may occur when the liquid is moving. And some sensors output 22 mA as an indication that the piezoresistive element is damaged.
In instustrial enviroment there is a specification by NAMUR (Normungsausschuss Meß-und Regeltechnik) called NE43. It specifies 4-20mA not only for pressure sensors, but for any kind of measurement. 3,6mA means failure (low), 3,8 to 22,0 mA is linear to mearurement and 22.5mA means failure (high). Any other value is per definition invalid
1) I measured the level in a container that was semi-opaque by shining a laser pointer into the fluid (visually casting shadows on the opposite side which were lighter/darker above and below the level). Infrared can penetrate some containers that are opaque in the visible spectrum. 2) If the fluid is warmer or colder than the ambient temperature, a thermal camera works for levels that don't change too rapidly. (Can show stud locations in exterior walls too!) Both require a camera though, so are more expensive, need calibration, and more programming than just one GPIO.
Optical parallax distance sensors like the Sharp GP2Y0A21YK0F might be applicable in some cases. My application is measuring the depth of snow cover. For water tank level I used a cheap JSN-SR04T automotive sensor, but I had to add an aluminium cone to direct the beam and avoid picking up the fill plumbing and tank sides. It has been reliable for several years now.
I had the same issue with my coffee maker. I created a project with esp8266 as an alexa switch to have it refill the coffee maker with my voice. I started to use one of the water level sensors that you mention but then I ended up just having it refill for 10 seconds, which is about the time it takes to refill the fluid for one cup of coffee :)
Last summer I built a sensor for a closed water tank (50 liters) in our camper. The first approach was an ultrasonic sensor, waterproof, and capable to measure small distances. Did not work (to much condensation inside the tank while driving up an down). After a bit 'testing around' I ended up with cupper tape (6mm, aliexpress) , glued to the inner and outer side of a plastic tube (as used for electrical installations), protected with a epoxy layer. The signal was then read with one of the pins for touch sensors. After some work with signal attenuation and calibration the sensor works fine.
A very old type of fluid sensor is the Buchholz relay found in use in oil filled power transformers. This is a basic float type mechanical float switch, mounted below a small "conservator" tank at the highest point of the main tank of the transformer. It actually serves 3 purposes * Operates to identify low oil. * Will detect gas production due to an insipient fault in the transformer (the gas byproduct displaces the oil over time) * It operates for a disruptive fault in the transformer since the oil surge operates it It really is protection of last resort for the transformer.
Thank you for the info. I had to look it up in Wikipedia. A simple but effective solution for transformers. I asume the mounting placet on a "normal" tank would be important.
Industry also use magnetostrictive linear position sensors for fluid levels. They resist temperature and viscosity changes. Also, magnetic hall affect sensors can be used used as well. Radar chips are also becoming more affordable.
These magnetostrictive sensors seem to be high-tech. I never have seen such a sensor. Radar was also mentioned by a few other commenters. It is still more expensive, but travels through various materials.
Here is my idea. Place the water storage container on a set of springs. On one of the springs attach the center tap of the variable resistor. As the spring moves it moves the center tap. Just supply a battery, and microcontroller and a gsm module and your done.
I think the comments on this video have the highest S/N ratio that I've ever seen on a UA-cam video. Just full of all sorts of wonderful ideas and experiences! And the video was really good, too!
One useful method for imaging the inside of an object is tomography, any wave source that you can generate and detect that will penetrate the conditions you are working in will do. In a tank scenario you are only dealing with one dimensional tomography therefore it is computationally less intensive and a simple neural network running on a microprocessor should suffice, particularly if the sample rate is in minutes or hours. Obviously the neural network is pretrained on a physical model and then retrained on the actual conditions during the initial filling of the tank. It could be as cheap as piezoelectric actuators/sensors and an ESP32. The cost/value of the setup is in the embodied intelligence rather than the material configuration, this is always the most scalable and sustainable approach.
@@AndreasSpiess Three or four but perhaps only two simple piezo discs acting as transceivers. Not sure if you can multiplex a single one and have it read its own signal echo, worth researching. Add drivers for larger and or more solid tanks, whatever is required to get a detectable signal through the tank plus contents. See _"Ultrasound computed tomography for material inspection: Principles, design and applications"_ Measurement volume 146 (2019) You'd be detecting the moving air/contents interface but not actually imaging anything so just a single variable output.
Andreas, One way to sense the level in a tank is to use a "bell" shaped dome, open side down. You attach a hose to the top of the bell. Outside the tank, you have a "t" fitting. One branch of the T goes to the hose attached to the bell. The 2nd branch goes to a pressure sensor. The third branch of the T goes to a small air pump. With the dome anchored to the bottom of the tank, air is pumped, slowly, into the bell. Run the pump for a bit, stop the pump, read the pressure. Pump some more.stop the pump. Measure the pressure.If the pressure is unchanged,the height of the fluid is proportional to the depth and density. Successive readings take very little additional air. If the tank is being drained, no additional air may be needed. You must stop pumping and allow the pressure to equalize, between readings,or the resistance to flow of air down the hose will affect your reading. The tank must be vented and operating at ambient pressure and known temperature. I would not use this to measure flammable liquids. (Although, the first place I saw it was measuring the level of fuel oil in an underground tank! The pump was a miniature "bicycle type pump". The instructions read "operate the pump until the reading stabilizes. Read the level in "feet of oil".) A small aquarium pump, either bellows or piston type, would work for shallow depths of water.
Funny thing I was dealing with the same espresso machine issue and ended up with the exact same solution. :D Also, there is another path you haven't follow in which you use a weight sensor with HX711 module, that's pretty much the only option when you're dealing with hot liquides.
You are right. I forgot to mention weight as a possibility. For the coffee machine, however, it would not work because there is a waste water tank as well as a tank for the used (grinded) coffee beans which would randomly add to the weight.
For your coffee machine, you actually don't need any electronics, just a float valve connected via a hose/pipe to a water source (tap?), this is how your toilet knows when to start filling up after a flush and when to stop as the cistern is full if you are going to use a cistern float valve use a new one 😁
Good idea (another viewer even posted a video about how he did it ;-) But I am not sure if this solution would be approved by "government" here in the house (it would need a long pipe...
@@AndreasSpiess I used 6mm ice maker (also pneumatic) pipe through a pressure regulator down to 100kPa and bipassed the tank entirely. Never had to fill it again, and very little to go wrong. But your video is great anyway.
I like the idea of using a strain gauge (and an MCU to do the calculations) to measure the weight of the tank and contents (and working out the level by subtracting one from the other). It reduces the problem of content contamination and sensor corrosion. It just requires the tank to have some flex (or motion) in its mount, which can be quite simple on small tanks. I like the idea that the sensor is completely external - which is more difficult with a pressure sensor.
Great video, but your videos always are. I'm interested in the FM24-NP100 from #378. The concept is only good for plastic tanks but should avoid contact, corrosion and condensation problems. Mount it above the tank facing down so it can "see" through the top of the tank to the liquid surface. As you know, the sensor communicates via a UART so no ADC to deal with. Ignore the return from the top of the tank and so long as you know the height of the sensor above the floor of the tank, its easy math to read the level.
Capacity measurement also works for liquid level measurement. I did last year a lot experiments with a mpr121 and copper foil. Works good. If it only works inside or also outside the tank I have not tested yet. I laminated two cooper foil strip's near to eachother together in a long strip for the experiment.
Other methods: 1) Weigh the tank and its contents by mounting it on load cells. Can be very accurate, is unaffected by tricky tank internal geometry that makes the height of fluid:volume non-linear. Disadvantage is that any pipework connected to the tanks must be flexible enough not to affect the weighing. 2) Industrial storage tanks for oil use a variant of the car fuel tank idea: the float is mounted on a long wire or chain, and a mechanism at the top of the tank winds the chain on and off a drum as the float rises and falls. 3) For threshold sensing, devices like tuning forks are sometimes used: these are energised to vibrate and the vibration is damped when the liquid rises to the level where the tuning fork becomes partially or wholly submerged. Similar devices are used with powder-filled tanks (flour, sugar, etc) In this case the fork is powered to rotate using a small electric motor. When the material starts to cover the fork, the rotation is stopped. The devices use spring-loaded mounting plate that rotates when the torque increases, tripping a micro switch, and stopping the rotation. 5) Sometimes ultrasonic sensors are mounted at the bottom of tanks, and the sound travels through the liquid and reflects back down to the sensor from the top surface. These are less affected by floating foam or dense gases above the liquid than the 'mounted at the top' kind. However, they have the same disadvantage of pressure and other bottom-mounted types: the tank has to be drained to change the sensor. 6) Some tanks are fitted with external 'sight glasses' (a transparent tube linking the top to the bottom of the tank). The liquid sits at the same level in the external tube that it does inside the tank: any sensors can then be attached to the tube rather than the tank itself. Steam engine boilers often have these sight glasses. 7) The old 'teasmade' automatic tea-brewing alarm clocks had a simple level sensor on the kettle and/or teapot - an on/off version of the weighing idea. The teapot sat on a sprung platform, and when its weight increased as the water was poured in, it compressed the springs to the point where a microswitch was switched.
A lot of good and interesting information. Thank you. For sure I should have mentioned the weight method because, as you write, it has many advantages (I never thought about the flexible pipework!).
Never tried myself, but an ntc can be used as a level sensor exploiting self heating characteristics and the difference in thermal conductivity between air and water.
I just use stainless rods or cables. You need 1 ground and as many electrodes as you like at different heights. All the electrodes are pulled high with pull-up resisors. When the water connects the rods to ground, they go low. Connect them to a shift register. Shift in states, and do something with code. If you want low-tech you can do everything the same but use the electrodes to switch npn transistors that light LEDs.
Great overview! 👍 I am using a throw-in pressure sensor (4-20 mA) for an IBC container filled with rainwater. For measuring the current an INA219 does a much better job than the internal ADC (Wemos D1 Mini).
The other classic fluid level sensor is the float-driven potentiometer as used in car fuel gauges. It's quite easy to cobble one together out of bent wire and bits of packing foam.
Also a good idea if the dimensions of the tank allow it.
That's the only way I got rid of corrosion, vapor and false readings, after trying almost all techniques described by Andreas in this video. Instead a regular potentiometer (which can corrode too), I ended up using a AS5600 magnetic-position sensor with both sensor and corresponding magnetic embedded in epoxy resin.
There are immersion style capacitive based sensors that are simply a tube whose length can be adjusted for tank depth. The materials are offered in a range including corrosion resistant. Commonly used with petrochemicals.
@@rvendrame also consider that modern bio oils and fuels are a great playground for bacteria.
I use mine to monitor my gasoline tank for my tractor out back by the hay bails, but I think birds or something keeps stealing the styrofoam off the end of the coat hanger. I keep adding a new wad of white styrofoam from the box I got my new dryer in, but someone keeps stealing it. Couldn't find anything modern so I used the old "coil-wiper" volume knob from an old vacuum tube radio my grandpa had plugged in out in the barn. It sounds a bit crackly when it turns if the wind sloshes the gasoline around, but at least it keeps a regular incandescent bulb brightly lit as long as there is gasoline in that tank. It's so nice when you don't need nothing fancy to get the job done!
This video is so awesome!
About 8 years ago, I needed a sensor for an expensive semi transparent plastic tank.
I did a lot of thinking, and purchased a lot of different sensors and made a lot of different trials with prototype tanks.
In the end I decided that I only needed to know if the level was 3/4 full, and 1/4.
I ended up using 3 temperature sensors. 2 glued to the outside of the tank. One for ambient temperature near the tank.
Sensing the temperature difference between them was surprisingly accurate.
When the level got low, I got a warning, and could turn on a pump with a timer, to fill the tank to approximately below 3/4, or stop at 3/4 if reached.
This is innovative! Also an indirect way of measuring levels...
Very interesting approach! What happens when the liquid temperature equalizes with the ambient, or was that just not much of an issue in your case? Perhaps something similar could also be used to measure flow through a pipe by sampling two points on the pipe some distance apart along with the ambient temperature.
@@benhetland576 in my case equalizing of temperature was never a problem.
I think it could be because it was mounted in an engine bay, so when it was operated the ambient would rise, but due to thermal mass and location, the water temperature did not increase significant during operation.
@@benhetland576 I don't think it would be as easy to do with a pipe?
I also think the pipe material and temperature of the liquid is pretty important in that case.
But I could be wrong 🙂
This approach is used to detect leaking waterpipes in households. More specific leaking toilets.
You can also use a weight sensor. You can use the density of the fluid to measure the liquid.
Yes. This is a much used method in industry. It does not matter if the fluid is highly corrosive or very contaminated.
I worked for a company, the measured the amounts of screws in their bin with scales, knew right off when it was getting low. Works great for such things.
A good idea! Thank you.
@@einars899 yes I know it from water pressure balancing systems in pipeworks. The balance vessel stands on 3 feet while there Is one weight sensor under one feet.
I used this approach in my van conversion. I was sick of the 1-2-3-4 light indicators for the fresh/gray water tanks so I fitted weight sensors under them and worked on the principal that 1L of water weighs 1Kg.
I've worked on a project where we needed to monitor water level, we used a float in the chamber with a magnet mounted in the housing. We then had an array of Hall effect sensors along the tank which were monitored to identify the position of the magnet. This was a nice contact free solution which avoided risk of fluid ingress into the electronic housing.
Thank you for sharing. But I assume the hall sensors were somehow in contact with the fluid? Or were they outside the tank?
@@AndreasSpiess I would expect they were attached to the outside of the tank. The float on the inside of the tank is restricted so it can only travel vertically up and down the inside edge of the tank (and therefore always readable from the outside as it passes the nearest hall sensor). Nice idea @Jack Soldano
There's the old one of putting the float in a tube running parallel, either inside or outside the vessel.
Or putting the float on a wire.
@Pete Mundy Basically this, we had a tank with a channel for the float to hold it in a specific position, the float would sit at water surface level and house the magnet. On the outside of the tank along the channel was a PCB Hall Effect Array with around 10mm spacing between the magnet and Hall effect sensors. This is not the most accurate solution but depending on your algorithm can give you around +/-2mm accuracy
Great memories about my industrial automation lessons back in time.
May I add something : for measuring pressure in order to get a fluid level, you need (in most case) a second sensor perpendicular to the tank wall to measure the static pressure (unless an open tank, due to level and temperature variation, or just the appliance is an pressurized tank) and them substrat the static pressure to your measured dynamic pressure to get the relative pressure of your fluid level.
The main point of that 4-20mA sensor you introduce is that if there is an open loop (wire cut somewhere) or a short circuit, you will notice it instantly (by getting 0 or ♾ Amps) and this is why sensors with this reading range are WIDELY used in industry. (Way much that any other kind of sensors, and for many appliance : temp, flow, angle, etc.)
You are right that you have to subtract the outside pressure. Some viewers use a second pressure sensor. I could imagine to use the weather forecast if you do not want to be very precise.
I was not aware why the current loops start at 3mA and not at 0. Now I know. Thank you.
That's very interesting, I have a long term project to upgrade a small cabin in some fields belonging to my father in law.
I'd like to make the water tank autonomous, filling/monitoring from a well, I was thinking of using float sensors or the passive sensor that was used on the coffee machine.
But I quite like the idea of those pressure sensors, but now I have to think about static pressure?! Yoinks.
@@BobHannent I think for that small home appliance, using a constant value based on average atmospheric pressure for static pressure is fine ;)
Measuring static pressure is mandatory in tanks where this static pressure is subject to significant changes
Very interesting :) I once made a simple water level sensor with a capacitive approach. It was just two parallel copper tape strips on a long plastic sheet, covered with tape for isolation. When submerged, the water changes the capacitance between the two copper strips, which can be measured by an MCU simply by toggling a digital IO and measuring how long it takes to charge and discharge the IO (libs are available, usually used for touch sensors). This way you can tell how much of the sensor is submerged.
I did not know that this also works for deep tanks. One of the moisture sensors work that way.
Maybe the copper strips could be replaced by a regular 2-lead cable? Like one of those flat ones used with lamps on 230V AC, or and old telephone cable or antenna feeder cable with that little flat segment to create a distance between the two wires (anyone remember those?). They come ready made and sealed in almost any desirable length, so only the end needs to be sealed off.
i use this a similar setup for monitoring my two water tanks using speaker wire to measure the levels of a 3k gallons and a 5k water tanks .. most consistent thing I've found to measure the levels that doesn't include me sticking my head inside.
@@ExplorerOffgrid what did you choose to measure the capacitance of the wire - some dedicated IC or something else? How accurate are your readings?
@@benhetland576 it's often called ladder line, and is still used to feed low frequency antennas. Try a ham radio store
A couple of years ago i used two insulated wires as a capacitor in a ne555 resonant circuit. The liquid then serves as a dielectric and the change in frequency can be recorded very well with a microcontroller.
This is the same concept as used in the shorter sensor I had in the video. It is interesting that it also works for longer distances. Thank you for sharing that it worked.
I have attempted a similar scenario but with steel cables used for laundry with thick polymer insulation. Didn't work at all and never thought to try copper. Did you try it as a twin lead arrangement? As a signal transmission line? Not sure if I over engineered it or used inappropriate materials. I will revisit this project from my notes but would like some feedback to improve on my research.
@@xDR1TeK I used two configurations, two parallel cables and one cable in an aluminum tube. Both worked well and are very sensitive. A drop could be detected in a 1L container. That makes the absolute accuracy a bit problematic. It is important that the 555 sits directly on the "capacitor". Attempts with a feed line in coax were not really successful.
@@xDR1TeK I used a cmos 555, which can handle the high frequencies better with small capacities.
@@grosseruser I went all over the physics to calculate the dielectrics and permittivity along with conductance and inductance of the transmission line based on immersion and different intrinsic impedance for a transmission line. Too much, for so little. and yet the 555 wins again. :D
Great video, Andreas. I've created a level sensor for my house heating system tank using the TOF approach. Used a VL53L0X with a wemos D1 mini, one 18650 cell and a small solar panel. Measures were sent to a rpi running mosquito. Had issues with corrosion, so needed to encapsulate the sensor pretty well. Apart from that the thing is working now for over 5 years.
Thank you for sharing your experience!
@@AndreasSpiessYou really covered this well Andreas and mentioned practical points. eg my heating oil tank has two sensors (because it's so important). A VL53L0X and a cute ultrasonic JSN-SR04T car bumper sensor (which can't read under 300mm). Even when they read 6 times a minute and I massively average the output the result is 'noisy' (eg maybe the liquid sloshes in the tank - maybe a video on signal conditioning is a future idea). @pedrobaco563 mentions corrosion - oh yes! On my sensors the oil vapour destroyed the plastic and silicone casing - yup silicone conformal goo is no good with oil. Allegedly polyurethane is oil resistant. My 3D printed housing HAS been good though though I can't recall if I used PLA or PETG. The project is written up should you need it. Roger F
Pressure can also be measured from the top, placing the sensor at the end of a tube that goes to the button of the tank. The tube inner diameter and the weight of the fluid determine the pressure
This doesn't normally work reliably long-term, since various effects tend to cause the fluid level to rise in the tube over time. The setup has been used in the past though by very slowly feeding gas into the tube (normally bottled nitrogen). The gas pushes the liquid right to the bottom edge of the tube where it bubbles out, giving a consistent effective tube length. If you only want periodic readings, you could use an aquarium pump, controlled by the micro, to provide the pressure.
Others mentioned this type, too. But I fear it has to be air-tight for a very long time.
@@colinstamp9053 you might be right, but if you emptying the tank regularly, it will be "reset"
@@jenskaa4044 Yep. There are a few applications where it's not a problem. I think washing machines often use this method. Just make sure you don't need accurate readings for more than an hour or two between emptyings.
If the pipe has a T at the top then a positive pressure device (air cylinder or small air pump) can be attached to the third part of the T, the first and second go to the sensor and subsurface pipe respectively. It was called a bubbler system and I've used it to measure seawater levels for months at a time. The and will bubble out of the bottom of the the and always maintain a pressure proportional to the depth of water, an advantage being that atmospheric air pressure is cancelled out.
This is a timely video for me. I live in California, in a town that was mostly destroyed by wildfire. My house was saved but the water treatment plant was damaged. They have repaired it enough that we have water but very low pressure. I have to pump water into a tank to supply our house with water. Right now I have a float switch in the top to tell me when the tank is full but now I am going to put a pressure sensor in the line coming out of the tank so I can monitor the level in the tank. Thanks for the video :)
Glad to read that you and your house survived this catastrophe! A pressure sensor is probably the easiest thing in your case. I forgot to mention htat you ahve to correct the values with hte current pressure (obtained by a weather service) if you ant to be precise.
@@AndreasSpiess I didn't think of that. I wonder if I could use the pressure sensor in conjunction with something like a BMP280 for barometric pressure. But, then I would have to do math :)
Hello Andreas,
Thanks for all the knowledge that you share,
Greetings from México. 😊
My pleasure! Greetings back.
Hi! I am Jacques from Quebec. I had to build a liquid monitoring device to allow reading the level of the liquid so I used load cells sensors. These worked fantastic. Thanks for your very exciting video.
You are right. I should have included measuring weight in my video. Because both applications cannot be done like that (tank burried in earth and coffee machine has also waste water and waste grinded coffee which adds to the weight) I forgot it.
Perfect timing! I have a small decorative fountain that I brought in to store for Michigan's winter. I wanted to outfit it with a sensor to stop the pump if the water level dropped to prevent damage and alert Home Assistant. Now I have no excuse to forget. Once again thanks to the guy with the Swiss accent!
Good project for the cold winter where you live. I still remember my February trip to Chicago many many years ago ;-)
Hi Andreas ... as usual, your videos are a great source of inspiration and help. Thank you for continuing to post so frequently.
My pleasure! Now I will pause over Christmas and New Year...
There is also another simple way with ESP32. I had to measure when plastic bottle with liquid is near empty. I just cut circle from one side Copper PCB with radius 15 mm and made short connection with one of capacitive touch pins of ESP32. PCB was put on outside surface of bottle near bottom. After setting threshold of readings, it works perfectly for my project.
Good idea to use the built-in sensor of the ESP
Superb video (as usual). I use ultrasonic HC-SR04 sensor to measure water height as water fills a ground water tile drain pipe. This pipe is not perpendicular to the horizontal plane. As a result, finding a sensor that can measure height accurately with the 5" diameter pipe that fills with water at a 45 degree plane is problematic. Ultrasonic sensors are the only option in this case and work well to trigger / power a submersed pump to drain the pipe when water rises to a set height, below ground level (I use 5" / 12 cm) at preset maximum limit, which triggers a simple arduino GPIO power (using a 12V relay) ON command, for 45 seconds, then resets until the water rises again and triggers the 12V pump as required.
Corrosion is a minor issue (the SR04 sensor is not in an enclosed atmospheric environment) which is reduced by making a 3D printed case to protect the SR04 circuit board. But the emitter and detector sensor cones do eventually show signs of oxidization and effect performance after 2 years. The reason the sensor lasts so long is because the median atmospheric temperature rarely deviates from 18 C. Because HC-SRO4's are so cheap (less than $12.00 for a box of 5), replacing them is cost effective for my particular performance requirements and durability. This setup wouldn't work for all-season outdoor environment.
Anyone know of an Arduino shield board available with built-in power relay and 2 or 4 line display with horizontal GPIO pins? The only thing I would need to plug-in would be the SR04 cables. My setup is built using classic Arduino board with patch wires on a development board, display and kit parts only. It's not elegant or rugged, though I wish it was. It's ugly but works.
I've been running this setup for 3 years with only one SR04 corrosion failure.
Thank you for sharing your experience. A pack of 5 HC-SR04 just arrived in my lab. I also want to try them.
Good overview, thanks for another great video! I have very good experience with the last sensor you mentioned - pressure one with 4-20mA output. I’m measuring water level in the outside well. Level is in the range of 2-3 meters. And this sensor combined with interface board from Mikroelektronika (correct board: MIKROE-1387) is reliable and precise. I read the values via SPI, just a single 5V/3.3V power supply is needed for powering the board and also the sensor.
Good information. So your sensor also works down to 3.3 volts?
No, the sensor works on approx.16V. This voltage is provided by the interface board, as it contains DC/DC boost converter. And the board also contains the DAC with SPI interface. I made a mistake in my previous comment, the board used in this project is actually MIKROE-1387. Manufacturer has a datasheet and also schematics for the board on their web pages.
Ive used the inexpensive moisture sensors for automatic watering and sump pump applications. They are so cheap I dont mind replacing them annually when they corrode - especially outdoors or in salt water. One design practice I suggest is if you are pumping fluids is to include a purely analog override based on the raw sensor output when tank full, to switch off the pump if the controller crashes.
I agree: To have a plan B is always good practice.
Great video Andreas,
In my project I used the last sensor, which is the pressure sensor. Measuring the current was a bit tricky. A normal resistor will not work because the current range is limited to 20 mA and the ADC resolution is not enough. For this purpose I used the Ina219 current sensor board with a built-in shunt resistor. This delivered better results. It is important to use a stable 12 or 24 V power supply. Because any voltage changes in mV level has an effect on the results. I used software filter to deal with this issue.
Thank you for sharing your experience. The INA219 is also a good solution if its shunt resistor is changed to a higher value.
First time I got a relevant Ad. It was for Wago, who do make nice electrical connectors... Merci vielmals uss dem grosse Kanton im Norde!
I changed to UA-cam Premium because I prettty much replaced TV with UA-cam. What a relief ;-) Und: gern geschehen!
I use a VL53L0X sensor for water level measurement. This sensor is mounted so that the highest water level is about 10 cm below the sensor. To avoid light influences from outside the sensor unit was mounted in a plastic tube. Attention to the diameter of the tube. The VL530X has an opening angle of 25-35 degrees. If the tube is too small, internal reflections will occur.
As long as the water is still and not moving this can work, but the moment the surfaces moves the laser can reflect away from the sensor, or even not be reflected at all (brewster angle). So while technically possible, not a very safe way to measure. Unless you place a floating reflector to the surface of the liquid and use that as a target.
@@SarahKchannel That's right, that's why the plastic tube goes to the bottom of the tank. In the lower end of the tube are holes so that the water can flow in and out. In the tube itself is a white plastic float as reflector. Ping pong balls are good for this.
Good information! Others also mentioned the tube to avoid problems with sunlight. But not the diameter.
@@juergenheisel7360 each medium, or fluid therefore, has a different refractive index. At certain angles a surfaces is either fully reflective or fully transmissive, or changes polarisation angles of the source. I am using the VL sensors in other applications and love them ! As long as the distance is not greater than 1-1.2m they do a good job.
@@SarahKchannel In my case, there are even extreme differences, once clear water, the other time with foam (washing machine). That's why I decided to use a white reflector to get the same measurement results and yes I can confirm the distance information.
Great video - shows the things that are needed to consider when someone asks to measure water level, - what do they really want to know is a second question which applies to all sensor questions.
True.
Thanks for the primer on sensors! I have a water cistern I'd like to measure that has some exposure to the elements, and was trying to figure it out. This helps. (As for the coffee problem, though, I usually just make it for my wife. 😁) 👍
Your solution is much better than mine, of course. But then I would have to get up very early (she works in a hospital) and could not work the long evening hours ;-)
@@AndreasSpiess Fair point! It does help we get up at the same time. If anything, I'm the one that makes us wake up earlier. (Kinda funny, as I too prefer the evening hours.)
Thank you!
I greatly appreciate videos like this that focus on mundane yet important stuff.
I get sooooo tired of superficial (shallow dives) that basically exclaim, "Wow! Here's a bright shiny new object!!" I want to know how to actually get stuff done. Your videos tend to eschew the hype and focus on the "Here's how to get stuff done" aspect. Yeah. Sure. Of course it's often boring and tedious... but it's also crucial information.
Thanks, Andreas, for another useful video. I have been trying to measure household water consumption for the last several years. The pressure sensors (shown @ 9:30) yielded excellent real time information, but there were two problems: 1. Different locations of the sensors in the home network results in far different information, and 2. The relationship of pressure to flow is an exponential relationship in dynamic conditions. Each of these problems can be solved but then there a difference between the hot and cold-water systems. When the hot water tank fires it pressurized the system fouling some of the mathematics. It was getting too complicated for me. Between these two problems I have found that better real time information comes from a magnetometer mounted to the side of the municipal water meter. There is a ‘nutating’ magnet disk that rotates for each small amount of water that passes. By monitoring this I’m able to accurately count the magnetic pulses vs. time. Kevin Darrah has a wonderful presentation of the idea though I had to take it in a different direction because I’m battery powered. Most of time my monitor sleeps and wakes every 8 seconds looking for a change. If change is detected, then the device is on full-time and counting. After 20 minutes of observations, the data is bulk-uploaded to Thingspeak to save on batteries. That is the summary of the last 2 years of my life!
Measuring consumption obviously is very different to just a level. I also would have chosen your route. Or I would have tried the project which reads the municipal water counter's display with a camera and an ESP32...
just monitor the Flow not the pressure.
@@AndreasSpiess A non-intrusive method I learned about many years ago uses two sensitive microphones on the outside of the pipe a fixed distance apart. The noise of the flowing liquid (eddies, bubbles, etc) is digitised and compared with the other microphone to find a statistical best match. The time difference between the two matching samples and the distance apart of the mics gives the flow rate.
I am using standard "arduino" ultrasonic sensor for measuring water level. Sensor itself is mounted 10-15cm from top level. Difference between empty and full tank is about 1m. The setup works mostly fine. Output has some noise, so i use averaging in software.
Corrosion might damage the sensor one day, but it works continiously for like 3 years now.
Thank you for sharing your experience. I read that the normal ultrasonic sensors die much faster. So it seems you were lucky...
I have used your video as inspiration to make a salt level sensor for our water softener , this uses larges blocks of salt where the height diminishes when being used
by using a laser TOF and measuring every 6 hrs I can also check the connectivity as well as the levels itself.
I create a simple stand to mount the sensor and used 4 wires to connect to a ESp32 with esphome currently using USB power from the wall, will create a USB powerbank version with deep sleep as well
thank you for your insights !
Cool! This project is on my list since quite a while. But the level does not move fast. That is probably why it did not make it to the top priority ;-)
My favorite fluid sensor is a reflectivity sensor. I found one that looks like a clear led. It has an LED and a photo transistor in the same casing. When dry the light bounces if the outside of it's case and into the transistor, but when wet the similar density if the plastic and water let more light escape and the transistor turns off. I use these to detect the presence of water in buried conduits.
Another viewer also mentioned those sensors (from Honeywell). I was not aware that they exist. Do you have a cheaper source (These original sensors are quite expensive).
Thanks again for your work and the level sensor overview. In my house, I am using the float switch sensors to monitor the water tank of my dehumidifiers (Aldi) together with a 433MHz door/window sensor. Several XKC Y25 capacitive sensors are also in use in different configurations, I tried to use a bigger capacitive level sensor as a rain sensor, which failed. But it was usable as a touch sensor hidden behind the wooden board of a piece of furniture.
For my oil tank I built a pneumatic level sensor using a BME280 as a pressure sensor and a small air pump. First as a proof of concept. But it is now for years in productive use, performing in the range of 0.1% deviation, which means
The Make journal featured this pneumatic system system in their last issue. They seem to also need a valve. But it is definitively something I want to look at. Do you have more information to share?
@@AndreasSpiess Part 1 @Andreas Spiess In theory valves are needed. But I need just e few measurements a day, so I rely on the natural leakage and block the measruements in between by SW.
The theory of operation is well described in German Wikipedia "Pneumatische Füllstandsmessung"
@@AndreasSpiess Part 2 My tinker-solution is described in homematic-forum post 328133#p328133 ff. As you can see: tinkering and proof of concept. But as it happens sometimes, continues beeing in operation. And even the TÜV had no complaints.
More important than a valve, is a pipe to the bottom of the tank. This already was built in. The tank was equipped with a "mechanical" solution by Afriso, which was not very reliable and not very precise. But I could use this pipe. This company and some others offer also electronical solutions nowadays. The pressure range of the BME280 fits well to the geometry of my tank. Otherwise a dedicated differntial pressure transducer would be required.
Thank you for the link. I see the point that you used time as your "valve".
@@AndreasSpiess Yes, keep it as simple as possible and as precise as necessary :-) The system is kind of open to the liquid side and the air can escape, the oil returns into the pipe..
Thanks!
I liked this subject, because I experimented this on my pool, with unfortunately not a success due to corrosion and accuracy.
I appreciated the open collector explanation, and the various usages.
I faced with one of them on my 3D printer with an inductive bed level sensor, which led me to fry the motherboard...
Thank you for sharing your experience. I think corrosion is the biggest problem of those sensors.
I use ultra sonic sensor to measure the distance from water surface, work well after > 1 year
I had a similar issue with my coffee machine. I ended up using an IR sending a beam slighly up (around 30 deg) from the bottom. On the backside of thw pexi-glass tank I glued a bit of silver foil. Now, when the water is low, the beam is totally reflected from the water level towards the mirror back into the sensor besides the IR diode. Works a charm since many years.
Cool. Thanks for the tip
@@AndreasSpiess Well, thanks for YOUR tips :-) The bubble sensor in the other video seems to be more appropriate than my try wirth the TOF...
Just what I needed - I have a small tank with a sump pump in the basement that needs monitoring! Thanks Andreas 😃
Happy to help!
ok, I have to admit you got me suscribed to your channel with the 2 first mins.
Welcome aboard the channel!
Great Video as usual ;)
You mentioned LIDAR and Ultrasonic. I recently learned that conventional radar is a commonly used strategy for measurement of solid and liquid levels in the industry. 😎
I was not aware of that. But other viewers also mentioned it...
several years ago I thought of a pulley system with sensors that when countering the turns of the pulley indicates the distance of the rope or chain I think that if you put an object that can float at one end and a counterweight at the other end can work with that we can calculate the height of the liquid, the most scientific approach i think is use vibration frequency from the exterior of the tank, frequency will change depending on how full or empty is the tank (sorry my english i know is not good)
The chain systems seem to be used in the industry for example to measure the level of lakes. It for sure can be used by makers.
The resonance method is probably a bit more complex to use.
My father in law has also an tank for watering the garden with an simple mechanical "display".
On the top panel of tank he drill an hole. At tank below he fasten an plastic bare (cable channel) on an float (Styropor or canister).
So if the plastic bare looks approx 2m outside of the top panel hole the tank is full, if the platic bare goes down the tank will be more empty. A small rack outside were some reed switches are fasten and the magnet on the plastic bare could also switch on or off a pump.
The advantage is that reed relais are not inside liquid.
Your father in law's method is simple and does the trick if you are not a nerd like we are ;-)
In a company where I worked, we had a problem how to measure liquid height in a small plastic container which was also under a bit of pressure. We tried many approaches, like capacitive reading with glueing copper strips on the outside wall of container, but it turned out that it is too sensitive to an environment and when liquid in tube that went out of container touched another container, values of capacity reading changed. Resistive measurements were also not good due to erosion and contamination. We couldn't measure pressure, as the air above liquid had different pressures. In the end we end up measuring container weight with a load cell. Not ideal but we couldn't find any better and cheap way of doing it without massively modifying container itself. In case we would make container itself, we would probably make it with potentiometer and a rod with floater, like in a car gas tank.
Measuring weight is a very good way for many applications. I should have mentioned in my video...
Thanks. Your timing is perfect for me. Just about to add level sensors in my campervan. Lots of interesting work ahead.
Good project! Movement might complicate the things. I always wonder how my gas tank knows how much gas it still contains ;-)
@@AndreasSpiess float I think. Mine is resistive, I think there's a float operating a rheostat.
I've found an air pressure sensor like a MPX5010 is an inexpensive way to accurately measure levels, but you need to add a small air pump to pressure up the measuring tube until air escapes from the tube at the bottom of the vessel. This give you a balance pressure equal to the pressure of the water over the inlet of the measurement tube that you can measure and calibrate.
I'm sure you can take a static pressure measurements with no airpump needed, I have seen a tutorial on the matter
This method was described in other comments. Some use a pump, others not. The pump seems to be necessary if your level never drops to 0 because the system can lose the air pressure and the water fills the tube after a time.
@@alexrossouw7702 You certainly can, but it will be much less accurate as the pressure differential you're measuring is much, much smaller, especially in a smaller vessel like a brew kettle.
Hi. You can use a vertical tube with top cap and open bottom. The liquid level compress the air inside of the tube. To mesure the level, two options:
1.- a flex diaphragm that push a microswich
2.- analógic sensor that measure de air pressure inside of tube.
A few other viewers mentioned this method and a similar one with a pump. I assume your method needs a very tight system if you want to use it longterm?
@@AndreasSpiess Nothing difficult to obtain. PVC pipe, plastic, cooper, .... Tube must be well sealed with teflon, glue, solder, ... If air escapes when the tube is submerged, it does not work. Even so, it is a very cheap system and works without mechanical or electronic complications for many months or years. It is a system widely used in water treatment plants, even for dirty water, for years.
I engineered and prototyped (successfully) a resonance volume sensor for beer barrels, in the time when the Z80 processor was the only good and cheap option. The barrel was exposed to fine tuned sounds which allowed to compute the volume of the barrel, the air and the liquid separately. It was however too complex for the time and the company opted for standard barrels and weighing on the fly. The accuracy was not so much of a problem by then. Nowadays maybe, but I am not good in marketing... I am a maker 😊
Weighing small tanks is probably a reliable and simple solution. Another viewer also mentioned to measure resonance for the measurement. An interesting option. I wonder how narrow the measured "dip" would be?
@@AndreasSpiess The precision was very narrow, in the order of ± 10 ml for 50 l barrels.
It takes a bit more, but we used 'capacitance probe' sensors to measure water level in tanks. It had a thin rod centered in an outer tube that had many holes along it. The two were electrically isolated from one another. An oscillator circuit was used to put this in one leg of a 'bridge' (similar to a wheatstone bridge, but composed of capacitors). As the level rose/fell, the capacitance between the outer tube and inner rod would change, resulting in a signal across the bridge. The probe was made of stainless steel, so it did not corrode in the hot water. Probably a bit too complicated for most hobbyists, but just wanted to share. Another nice video, thanks.
The tube was already described in the comments. But it was only used as a capacitor for an oscillator, not in a bridge as you used it. Thanks!
Great video, Andreas, it pointed to the real difficulties I also encounter, as corrosion and cludge of mechanical switches. In my case I had to measure the level of a underground tank feeded from a 100m well. The only solutions that worked for me was a floater with a long cable that has internally a switch that opens when the horizontal angle exceeds some value. Also a pressure gauge 4-20mA at the bottom of the tank
Maybe the second part of your last sentence is cut?
These mechanical switches are for sure quite robust as long as you do not need to measure aggressive fluids...
In racing you can find level switches like the Honeywell LLE Series used in fuel swirl pots and dry sump oil reservoir tanks. They use optical sensing at the tip of the unit based on changes or refraction. It is not uncommon for fuel to be weighed prior to being added to a race car rather than using volume measurement. Another thing we deal with in race cars is the slosh which makes measurement a real pain. We end up having to buffer the results of the measurement to a high degree.
I always wondered how even my car (I am a prudent Volvo driver;-) ) is able to get the right value. In your case it must be much more complicated...
These Honeywell LLE sensors seem to be threshold level detectors. I can imagine that it would work if you place an LED and a phototransistor close to each other.
Very interesting. I had a similar problem to your colleague's; I need to measure the water level of a 30m deep water well and of an underground reservoir. I ended up using two water pressure sensors (one with a 5-20ma output and the other on rs485 modbus); they are managed by an Arduino mega and I get remotely the readings by SMS through a GSM module. Also, the Arduino drives the pump that extracts water from the well into the reservoir; and it's all configured through a Nextion touchscreen monitor
Thank you for sharing your experience. So I am confident that it can be done.
there are also optical level sensor that indicate the threshhold.
The sensor has an infra-red emitter and detector aligned within an accurately shaped cone to give good optical coupling
when the sensor is in air. This coupling is greatly reduced, when the sensor is immersed in liquid, as the infra-red light
escapes through the liquid rather than being reflected back to the detector.
Others also mentioned these sensors. They seem to come from Honeywell (expensive) or Adafruit (a bit less expensive). Maybe somebody even find a cheap clone?
Great topic and info Andreas, brilliant as always. Thank you for creating this. Level sensing is a very popular subject and complex (with challenges) at times. In the industrial world, Radar for level is also very popular, with different frequencies and ranges available. Ultrasonic can also use different frequencies, depending on range. With Ultrasonic, keep in mind that the temperature will affect the accuracy of the signal, therefore sensors have temperature compensation internally. You can use a 'still well' to eliminate disturbances on the liquid surface affecting your signal, as well as air movement affecting the return echo signal. With pressure, you will find 'front-flush' sensors which are typically used in the food industry, this reduces the chance of contamination. Even optical sensors are used for level at times, infra-red light can be your friend. For your viewers who want more info on this topic, I would recommend doing a google search, all the leaders in the industrial electronics have various sensors for this application and a world of information to share with you.
Thank you for the additional information. The VL... TOF sensors use infrared light, BTW. Radar is also an interesting topic (a longtime topic on my list)
@@AndreasSpiess As a Swede I want to mention Acconner. The advantage is that the radar sensor does not have to be in contact with the fluid. It works with, for example, a plastic disc between the sensor and the fluid. The company mentions the sensor's low energy consumption. Such a property you usually appreciate.
ua-cam.com/video/4OEXVjBmmFw/v-deo.html&ab_channel=Acconeer
My first custom water level sensor was for my home tank on roof. It was 1Mtr tall and i built it first 10 years back when i was in 1st year of engineering school with a floating led in a tube, an LDR on the top of it. I used to set the led brightness such that the change in resistance of LDR is linear for linear decrements of the distance between ldr and light source. This solution was good but i had to change the light source every year as there is salt scale builtup on led.
I changed from this method to ultrasonic sensor ones which failed much faster. Explored pressure sensor method but that was expensive and sensor drifts over time due to scale builtup. Currently i am using a reed switch type float sensors (which needs to be replaced every once every two years)but working on a capacitence based sensor for precise level monitoring and not having to replace them.
Very interesting. Thank you for sharing your experience!
I use one of those screw in style pressure sensors with a range of 0 to 300 PSI with my oscilloscope for engine diagnostic. Works great for engine compression tests and running engine back pressure tests.
Thanks for sharing your experience!
I have been looking for a water level sensor, to detect the water level in a garden pond. This turns out to be a really difficult environment for such a measurement. The water is biologically active, coating any sensor in contact with the water in algae and limescale. While the pH of pond water is relatively stable, and close to pH 7.0, it can still be corrosive, due to the high oxygen content. A pressure sensor has the problem of silt build up on its surface, as well as the previous three. A float system only gives an indication of a maximum and/or minimum level. These too suffer from jamming, if there is a build up of lime scale of biological growth.
The best uses a water proof reed switch and a floating magnet ring. The non contact surface water level sensors, suffer from water ripples, and in the case of LIDAR, reflected sunlight, thought this can be mitigated by mounting the sensor in an open ended tube. All surface sensors fail to give the real water level if the pond surface freezes in winter, with the danger that the pond water can drain away under the ice. I have experimented with an insulated capacitive probe that provides a continuous reading of water level. This works like a coax cable, but with a larger diameter tube and a plastic coated wire down the centre. The dielectric is the pond water. As the water level changes, the capacitance of the sensor changes by as much as a few hundred pF. Making this capacitor part of the tuning element of a Schmitt trigger RF oscillator, allows the water level to be measured as a change of oscillator frequency. Unfortunately my attempts to water proof the outer screen have not proved successful in the long term.
The Brita water filter, has a water level sensor which is used to measure how many times the filter is used, and thus recommend when the filter cartridge needs changing. This uses a two wire contact probe to measure when water is in the water reservoir. It solves the corrosion problem by sensing the water level with a very low voltage AC square wave. The microprocessor circuit runs on a cr2032 battery. By using both low voltage and AC, the problem of Electrolysing the water, or the salts it might contain, is minimised to almost zero. I do not know what metal is used for the electrodes, but I guess it must be stainless steel.
I have come across an inductive method of measuring water level. This uses two water proofed torrid rings mounted close to each other. The water is allowed to flow through the centre of both toroid rings. The coil mounted on one of the rings is energised with an AC signal, this is detected with a coil mounted on the other ring. The water linking the two coils acts as a shorting turn, coupling the two rings together forming a transformer. This arrangement is used in, not only detecting water level, but measuring its conductivity.
FYI. I use a none contact capacitive sensor, similar to the one shown in your video, to measure the level of solution in my PCB acid etch tank. A microcontroller monitor system uses the level signal to cut the power to the tank heater and air pump, if the solution level falls, due to evaporation. This prevents the exposed glass immersion heater melting the plastic tank. The sensor is mounted several centimetres from the tank wall, to protect it from the acid. It still gives reliable readings at this distance.
A lot of valuable experiences. Thank you!
I like the very nice collection of ideas and practical experiences and challenges there! This is real engineering, finding good compromizes that actually work.
@@benhetland576 the capacitive sensor is the most promising, particularly as it gives a measure of water depth. It has a number of advantages, in that the outer wall of the sensor can be the zero volt of the circuit, acting as an RF screen. It is relatively easy to mount the Schmitt feedback circuit close to the plastic tube and coupled to the electrodes with a short length of coax. This adds a small capacitive offset. .
It is necessary to add some temperature correction to the oscillator, and provide it with a stable regulated supply rail, but this can be switched off between measurements to save energy. The capacitive change on a one meter long pipe is significant, between fully filled with water and empty (filled with air).
I made my prototype out of uPVC water pipe, while it is easy to water proof the the centre electrode with plastic air line tube, trapping the outer aluminium foil screen between two lengths of concentric uPVC pipe proved to be very difficult, as is making a weather proof connection to the electrodes. The pipe needs to be open at both ends, with the central wire supported at both ends to keep it in position. In a pond environment, it is difficult to keep insects from making a nest in the tube, and water weed growing inside it. The top of the pipe can have a cap, but it must have a hole for air to get in and out, or the water will not rise up on the inside.
What is required, is the outer electrode sealed between two flat sheets of plastic, and then these rolled into a tube. I could have used a metal outer pipe, but I did not want to introduce metal ions into the pond water, copper pipe would have been ideal for the outer, but copper salts are toxic to fish.
One other sensor we tried was using two lengths of fibre optic cable, mounting the ends so when in water, the light emitted by one is refracted and can be captured by the other. This works well for clean water, but pond water quickly renders the ends opaque. The idea was inspired by the optical smoke detector. It has the advantage that the electronics it is completely galvanicly isolated from the water. By using a modulated light beam, it's possible to eliminate the effects of ambient light, plus the fibres can be mounted in a opened plastic tube or box to shade the sensor from ambient light.
@@nigeljohnson9820 Perhaps you could use some braided metal sheet/band to wrap around the plastic tube, then top that with a layer of epoxy resin to seal it off (and the resin will bond to the pipe through the braiding). The inner wire can just be a regular insulated wire. I guess you could also use a cap with a hole at the bottom (water) end too, but the insect and growth problem probably will manifest itself at some point regardless.
@@benhetland576pond fibre glass epoxies might work, but it's important not to put toxic chemical into the water..
Fantastic walkthrough of the possibilitys of sensors, love it!
Thanks for sharing your experience with all of us 👍😀
You are welcome! Glad you liked it.
For a artisan well you can use echo acoustics, measure the echo time and barometric pressure and temperature to calculate the distance. The accuracy is surprisingly good. You need tables for speed of sound based on barometric pressure and temperature so the micro needs memory to hold the tables but the parts list is low, speaker, microphone and barometric sensor with temperature, the rest is just software.
I’d love to see a video on this!
Isn't this how the ultrasonic sensors work? Or maybe I misunderstood something.
As someone that works in industrial automation as a profession, great video, few other methods include some of your favorites, radar and guided radar. They are usually used on fluids that can have a vapor, since vapor / condensation can cause issues with the speed of sound with ultrasonics. Another very common visual level indicator is a MLI magnetic level indicator, its a tube connecting the bottom of the tank to the top, there are magnetic rollers which rotate to show the fluid level, the end user can strap hall effect sensors / reed switches to different levels for say a low a low low high high high contacts. Also for intrusive solutions like the moisture sensors you get what we call spiders, theyre a collection of vertical stainless steel electrodes, as the water levels rise making contact from level to level its measured, either capacitively or resistively. 90% of industrial automation uses 4-20mA current loops, but you also get oldschool 0-10V aswell as new stuff like Modbus Profibus Hart( old).
A majority of the instruments i look at are flow, this is measured by alot of different means, differential pressure , mechanical , electromagnetic, ultrasonic, mass flow , Laser . The nuts thing is thats not an exhaustive list.
Thank you for the additional insight from a professional!
Ladies are always the best motivation.... be careful, if she mad at you ... cheers
She knows me for a long time :-)
Nicely done! A flashback to my past. Open Collector outputs are used in many places in industrial I/O especially when the sensor is a long distance from the MCU as it reduces the power supply loading on the I/O point. The important point is to decouple the power supply from the sensor. Current loop systems have some concerns about short circuit protection. It can be a party-line with several devices consuming this data. Also, current loop is very often used to send serial data which may be fun to dive into. Nicely done.
I thought I explain it because, as you mention, it was often used in the past and maybe no more known by younger people.
@@AndreasSpiess as always you communicate technical topics in an easy to digest fashion
Another informative video … thanks. A few years ago I prototyped a multi-level capacitive approach using adhesive copper tape on the outside of an aquarium and the Adafruit MPR121 12 channel sensing board. It worked quite well and I’m finally getting back to an aquarium automation project using that approach.
Good idea. Like that you even get more than just one or two level signals.
I've used a salvaged washing machine level sensor to monitor a Grey water sump, was only good for Maximum, minimum but perfect for turning on a submersible pump to water the garden in the hot Australian summer.
A good idea. And probably very corrosion resistant!
Hi Andreas, thank you for the water level measurements review.
The radar sensors have the advantage over ultrasonic type in that they are not affected by the temperature of air, which in certain cases can be an error factor
Thank you for the additional info. Good point!
As for the coffee pot, you could build a decorative (wife compatible) coffee pot stand with a load cell in it, this avoids connecting a sensor to the pot itself and also gives you the option of a variable level indicator.
Good idea. The only problem I see is that there are two other "sources of weight": The waste water and the grinded (waste) coffee.
@@AndreasSpiess Could multiple load cells detecting balance shift , solve that problem?
@@AndreasSpiess Yes, that would be a problem, unless full waste trays are significantly lighter than the clean water capacity, which would be workable. I downloaded the manual but couldn't find the water capacity listed.
Wouldn't it be easier to simply weigh the wife? When she gets light enough then she is probably thirsty and you know to fill the coffee machine.
@EKTORPTULLSTA. Maybe. And then my wife puts something on top of the machine ;-)
Oh and if you have a readily available low pressure air supply (like an aquarium pump for example), you can use pressure sensors in another way. Instead of putting the sensor at the bottom of the tank and subjecting it to the fluid, you can pass air very slowly through an orifice and down a tube that is open at the bottom of the tank. If you adjust the air flow so it just barely 'bubbles' out the bottom of the tube, the pressure in the tube right after your orifice will be proportional to the level in the tank and can be measured with any air-pressure sensor. The sensor never touches the liquid. But a loss of air supply will have the same effect as an empty tank, so consider that in your design.
This is a good idea. There are a few discussions about it in the comments. It seems to be very robust.
A tube, a floating ball and a bank of opto-couplers. You can hit the tank and listen to the resonant frequency. Weigh it. Use a float and a potentiometer. A floating rod with a resonant coil around it. If the liquid is a different temperature to the ambient you could use a thermal camera. You could heat the tank and measure how fast it changes temperature. Anyway there's a few more ideas to be getting on with.
A lot of innovative ideas! Thanks.
I use pressure sensors (MXP) for bore wells and tanks. These measure the difference between ambient and 'bottom' level pressure to indirectly measure the water level. Only downside, I use an air pump once per hour to drive any water out of the tube that runs to the bottom of the well or tank.
I think tis is a very good idea. There are a few discussions about this method in the comments. Using a differential sensor seems to be a very good option.
I found another interesting solution in the German magazin "c't Make, 6/21". Here the water level in a cistern for collecting rainwater is measured. A simple plastic tube is put from top of the cisterne to the bottom and air is pumped into the tube. As soon as the air escapes at the bottom of the tube, the pressure in the tube doesn't rise anymore and you can calculate the height of the water. A blood pressure meter can be altered for doing this and can be connected to a microcontroller. Since all the electronics is outside the cistern, there are no problems with moisture.
This is also used for fuel tanks on some locomotives.
I am measuring marine tides the same way, only having a silicone tube with an open end placed from surface to a specific depth. One sensor reads ambient air pressure, one air pressure within the tube, combine both values for higher accuracies.
My sensor is now living a couple of hundred meters off shore, without any issues for about a year now.
This method is widely used in industries with tall tanks and is called air purge level measurement.
Also called dip tubes technique
If you use 2 tubes at a known different depth you can also calculate density of the fluid
I used another solution that worked very well. I made a capacitive sensor with a pvc pipe covered with aluminum foil and a wire inside it, going from the top, looping at the bottom and coming up again to not have exposed end on the bottom. The foil and the wire formed a capacitor that changed its capacitance according to the water level. I used a slightly different configuration of the 555 astable config and this sensor was the timing capacitor of the circuit. Its frequency changed according to the water level. I used the pin 7 of the 555 as a open collector output of the sensor and an arduino to read it. I related the frequency with the water level and displayed on a single 7 segment display. As it was on my dad's kitchen and the sensor was wired there was no need to save power. Of course there is more energy efficient solutions but this system was reliable, stable and considerably accurate.
Similar methods were mentioned by other commenters. It is interesting for me that this method works also for longer distances. Thank you.
As an indirect method, to mesure water level can be used the 2x water meters with inbuild LoRaWAN controler or with impulse output. That approche gives accurate measurement to build balance. The water meter also can have built-in pressure sensor.
This method would even give more information on consumption...
Good day. Searching also for a solution to measure my 3 meters deep rain water tank, i ended originally in mercury switches enclosed in plastic bottles and tied in a pipe every 30 cm i had a quite rough idea where the water level was. The mercury switches sealed in the plastic 0,5 liter water bottles lasted more than 5 years, yet I WANTED MORE ! I ended up in a pressure sensor mounted not in the bottom (i could not, since the tank is made out of concrete and is below ground level) but on top of the tank, taking advantage of the principle of Communicating vessels. A long tube that reaches up to 1 cm from the bottom of the tank and the other end goes to a (5 psi for 3 meters tank in my case) pressure sensor. I made proper calculations for surface to height / pressure difference, and voila !
Thank you for sharing. Other viewers also described this method. Some even added a pump. It seems to work very good.
Nice overview, Andreas,
A couple of additional types:
Some coffee-machines use:
1) Magnetic sensor (Hall-effect) with an encapsulated captive magnet that floats in the tank. (This is also an "indirect" sensor, as it also needs the water to have weight ;) A reed-switch could be used, but hall-switches are cheap enough.
2) Optical "brekingsindex" based-sensor: A total internal retro-reflector "feature" in designed-in into the plastic molding of the tank; LEDs+ PTs observe this reflector. If the tank gets filled, the total-internal reflection no longer works (as the RI of water is similar to that of plastic); the reflector only works when air (emptiness) is present behind the molded retroreflecting feature.
A "better" contactless type imo would be one that observes resonance-frequency - if you treat the "cavity" above the water as a helmholtz resonator, the base-eigenfrequency is strongly dependent ton the water-level. A sounder (speaker+microphone combo) can easily detect this at a distance, and estimate height. Unlike ultrasonic ToF, as the frequencies involved are low, a moisture-blocking "shield" can be placed in front of the speaker/mic. This resonator may be restricted to an immersion-tube if you wish to be agnostic to the shape of the rest of the tank.
Interesting new concepts! If I remember right, our old coffee machine had a moving part in the tank.
Other viewers also wrote about these optical sensors which work with refraction. Honeywell seems to sell them. But they are expensive. I wonder if there is a cheaper source. They are very good because they can be easily protected as you write.
The resonance way sounds a little adventurous for me. Theoretically, it should work. But I do not know if the resonance is distinct and if there is only one. Did you use it and did it work?
@@AndreasSpiess The Senseo/Philips machines use a floating magnet, and (if I am not mistaken) the Krupps machines use the refractive-index mechanism. The latter is nothing more than an LED and a phototransistor (on the machine) and a molded retroreflector "prism" in the water-tank that gets positioned facing the optical components.
I have used the resonance-concept for a different application (more like, injecting white noise, and looking for peaks; all this before optical ToF was hot). A friend of mine has used a mic/speaker arrangement on an ESP32 with a PVC pipe (in resonance-mode) to measure the level of his garden-pond. By placing the pipe at a shallow angle (instead of straight-down) he gets more dV for the same dh.
Eigenfrequency-seekers are surprisingly easy to build - if you take the microphone's (or any sensor's) output, amplify+clip it, (i.e. amplitude-constantify) and feed it back to a speaker (any actuator), you tend to trigger the dominant eigenmode. Frequency-counting the clipped signal is straightforward.
I can imagine though that it may not be nice to have a coffee-machine-tank whistling at your guests at random moments ;)
This Eigenfrequency sniffer is interestig! Thanks. The prism sensors were mentioned in other posts. But so far I did not find a cheap one. Adafruit has one for more than 20 dollars.
@@AndreasSpiess If you are interested, I have uploaded a video I made long back illustrating a prism-(total-internal) reflector implementation with a laser-pointer: ua-cam.com/video/esRmX1tBS5g/v-deo.html
Merry Christmas to you and your family, Andreas.
Thank you. And happy holidays too!
Thanks Andreas. This is something I have been thinking about as would like to be able to measure the amount of heating oil (kerosene) in our outside tank. So this has given me some ideas.
Maybe you also read the comments on another sensor: A tube to the bottom of the tank and a pressure sensor (and sometimes a pump) on the top outside the tank. This seems to be a very good method. Maybe I will make a video about it in the future...
BRAVO! (bin weighing, level systems, strain gauge)
Thank you!
IR sensors with floating stuff can be handy as well. Note you should consider vapor for any top sensor as a critical issue. Depending on temperature and fluid, top sensors will quickly become unusable due to condensation on the sensor. You have to eat or ventilate them to keep them clean. After various attempts with Sonars, IR, Conductive sensors I ended up with these basic reed switches in plastic enclosure in serie, they give low precision but high reliability. Time of flight is also impacted by water surface, if this is moving or if fluid is filled from the top and cause lot of waves they'll have weird output requiring additional software processing.
Good information. Thank you for sharing!
Another one is linear capacitive sensing. They can be made with a couple of long conductors at a fixed distance and completely isolated. The fluid's dielectric is exploited to know the level by measuring the relative capacitance. I've made a video some years ago about a diy sensor that uses this principle. It was designed as a threshold sensor but the linear signal can be picked up to get the actual level. Being completely isolated they can be submerged with no risk of corrosion or contamination. They can also be sticked to the external lining of a plastic tank.
Good video! Maybe it even would be possible to use the electronics of the capacitive sensor I showed (using an NE555)?
@@AndreasSpiess Thank you. With a NE555 you can definitely make a suitable circuit. I rather used a fast cmos though, as it performs better IMO: higher input resistance => better Q => higher sensitivity and larger range. The circuit layout is always critical. Greetings.
After many trials with ultrasound (not reliable due to humidity over the water and animals like spiders), pumping air in the water (pump and pressure sensor are available in cheap systems for reading blood pressure) which also was not reliable. In the end, I decided for a pressure sensor (available not only for 30psi online). I used a plastic pipe and fixed the sensor water tight with epoxy resin. The reciever is a Raspberry Pi via analog/digital converter. Works since years in my 2m deep water cistern in the garden.
Thank you for sharing your experience. I thought, the air would disappear through the plastic tube over time. But not in your case.
No. The air in the (empty tube) was not a problem. The tube is sealed at the bottom in the water. But in the beginning some condensing humiditiy made disturbances at the connector after a year or so, resulting in misreadings. I had to clean it and avoid from condensing water.
Thanks for this great video, Andreas. Wanted always the same like you, a reliable water level sensor for my Gaggia coffee machine. Bought this capacitive sensor like shown in your video and was happy, that it worked also with just 3.3V. So the integration in my Sonoff S20 Socket was very simple. I use this socket for a couple of years now to remotly switch the machine on. Now I could use the spare GPIO for the sensor. In combination with Homebridge I get now the messages on my iPhone - very nice! :-)
Thank you for sharing your project!
You are a valuable human. 98 points awarded. Cheers.
Thank you!
Great video as always! But don’t forget the most important use case of a sensor like this… to monitor the water level for the Christmas tree! That is very important these days 😉
Great idea,
but please including pump and fire hose ;-)
Good idea if you do not have a plastic tree ;-)
11:10 this recalibration is a bit dangerous because the output signal is still not guaranteed to be within 10 mA even if the pressure is always below the corresponding level. E.g. pressure spikes may occur when the liquid is moving. And some sensors output 22 mA as an indication that the piezoresistive element is damaged.
Good point. You are right!
In instustrial enviroment there is a specification by NAMUR (Normungsausschuss Meß-und Regeltechnik) called NE43. It specifies 4-20mA not only for pressure sensors, but for any kind of measurement. 3,6mA means failure (low), 3,8 to 22,0 mA is linear to mearurement and 22.5mA means failure (high). Any other value is per definition invalid
1) I measured the level in a container that was semi-opaque by shining a laser pointer into the fluid (visually casting shadows on the opposite side which were lighter/darker above and below the level). Infrared can penetrate some containers that are opaque in the visible spectrum.
2) If the fluid is warmer or colder than the ambient temperature, a thermal camera works for levels that don't change too rapidly. (Can show stud locations in exterior walls too!)
Both require a camera though, so are more expensive, need calibration, and more programming than just one GPIO.
Good ideas. I assume they are also more for indoors as the changing sunlight also could have an influence...
The ultrasonic sensor I used for a watering can worked quite well.
Thank you for sharing your experience!
Love the Living with Significant others reference!
I do not understand :-(
@@AndreasSpiess The coffee maker responsibilities with your wife. 🤣
Optical parallax distance sensors like the Sharp GP2Y0A21YK0F might be applicable in some cases. My application is measuring the depth of snow cover. For water tank level I used a cheap JSN-SR04T automotive sensor, but I had to add an aluminium cone to direct the beam and avoid picking up the fill plumbing and tank sides. It has been reliable for several years now.
Good advice for the JSN-SR04T. Thank you! The GP2Y0A21YK0F has probably not enough range for many applications.
I had the same issue with my coffee maker. I created a project with esp8266 as an alexa switch to have it refill the coffee maker with my voice. I started to use one of the water level sensors that you mention but then I ended up just having it refill for 10 seconds, which is about the time it takes to refill the fluid for one cup of coffee :)
Good idea!
Last summer I built a sensor for a closed water tank (50 liters) in our camper. The first approach was an ultrasonic sensor, waterproof, and capable to measure small distances. Did not work (to much condensation inside the tank while driving up an down). After a bit 'testing around' I ended up with cupper tape (6mm, aliexpress) , glued to the inner and outer side of a plastic tube (as used for electrical installations), protected with a epoxy layer. The signal was then read with one of the pins for touch sensors. After some work with signal attenuation and calibration the sensor works fine.
Cool. Good information!
A very old type of fluid sensor is the Buchholz relay found in use in oil filled power transformers. This is a basic float type mechanical float switch, mounted below a small "conservator" tank at the highest point of the main tank of the transformer. It actually serves 3 purposes
* Operates to identify low oil.
* Will detect gas production due to an insipient fault in the transformer (the gas byproduct displaces the oil over time)
* It operates for a disruptive fault in the transformer since the oil surge operates it
It really is protection of last resort for the transformer.
Thank you for the info. I had to look it up in Wikipedia. A simple but effective solution for transformers. I asume the mounting placet on a "normal" tank would be important.
1:31 Is my favorite part: "which brings me into deep trouble as you can imagine" :)
:-)
Awesome just thinking how to make that for my rain water reservoir, keep going like that
I hope you will chose the right sensor!
Industry also use magnetostrictive linear position sensors for fluid levels. They resist temperature and viscosity changes.
Also, magnetic hall affect sensors can be used used as well. Radar chips are also becoming more affordable.
These magnetostrictive sensors seem to be high-tech. I never have seen such a sensor.
Radar was also mentioned by a few other commenters. It is still more expensive, but travels through various materials.
Here is my idea. Place the water storage container on a set of springs. On one of the springs attach the center tap of the variable resistor. As the spring moves it moves the center tap. Just supply
a battery, and microcontroller and a gsm module and your done.
You are right: Measuring the weight should have been included in my video because often it is a good (indirect) way of measuring the level of fluids.
I think the comments on this video have the highest S/N ratio that I've ever seen on a UA-cam video. Just full of all sorts of wonderful ideas and experiences! And the video was really good, too!
Indeed, we have a wonderful community with lots of knowledge!
One useful method for imaging the inside of an object is tomography, any wave source that you can generate and detect that will penetrate the conditions you are working in will do. In a tank scenario you are only dealing with one dimensional tomography therefore it is computationally less intensive and a simple neural network running on a microprocessor should suffice, particularly if the sample rate is in minutes or hours. Obviously the neural network is pretrained on a physical model and then retrained on the actual conditions during the initial filling of the tank. It could be as cheap as piezoelectric actuators/sensors and an ESP32. The cost/value of the setup is in the embodied intelligence rather than the material configuration, this is always the most scalable and sustainable approach.
This seems to be a rather complex way for that purpose. How much resolution would the receiver need? Only one signal or a matrix of sensors?
@@AndreasSpiess Three or four but perhaps only two simple piezo discs acting as transceivers. Not sure if you can multiplex a single one and have it read its own signal echo, worth researching. Add drivers for larger and or more solid tanks, whatever is required to get a detectable signal through the tank plus contents. See _"Ultrasound computed tomography for material inspection: Principles, design and applications"_ Measurement volume 146 (2019) You'd be detecting the moving air/contents interface but not actually imaging anything so just a single variable output.
Andreas,
One way to sense the level in a tank is to use a "bell" shaped dome, open side down. You attach a hose to the top of the bell.
Outside the tank, you have a "t" fitting. One branch of the T goes to the hose attached to the bell. The 2nd branch goes to a pressure sensor. The third branch of the T goes to a small air pump.
With the dome anchored to the bottom of the tank, air is pumped, slowly, into the bell. Run the pump for a bit, stop the pump, read the pressure. Pump some more.stop the pump. Measure the pressure.If the pressure is unchanged,the height of the fluid is proportional to the depth and density.
Successive readings take very little additional air. If the tank is being drained, no additional air may be needed.
You must stop pumping and allow the pressure to equalize, between readings,or the resistance to flow of air down the hose will affect your reading.
The tank must be vented and operating at ambient pressure and known temperature.
I would not use this to measure flammable liquids. (Although, the first place I saw it was measuring the level of fuel oil in an underground tank! The pump was a miniature "bicycle type pump". The instructions read "operate the pump until the reading stabilizes. Read the level in "feet of oil".)
A small aquarium pump, either bellows or piston type, would work for shallow depths of water.
Maybe you watch my newest video about the topic. There I used a similar system with a pump...
Funny thing I was dealing with the same espresso machine issue and ended up with the exact same solution. :D
Also, there is another path you haven't follow in which you use a weight sensor with HX711 module, that's pretty much the only option when you're dealing with hot liquides.
You are right. I forgot to mention weight as a possibility. For the coffee machine, however, it would not work because there is a waste water tank as well as a tank for the used (grinded) coffee beans which would randomly add to the weight.
For your coffee machine, you actually don't need any electronics, just a float valve connected via a hose/pipe to a water source (tap?), this is how your toilet knows when to start filling up after a flush and when to stop as the cistern is full if you are going to use a cistern float valve use a new one 😁
Good idea (another viewer even posted a video about how he did it ;-) But I am not sure if this solution would be approved by "government" here in the house (it would need a long pipe...
@@AndreasSpiess I used 6mm ice maker (also pneumatic) pipe through a pressure regulator down to 100kPa and bipassed the tank entirely. Never had to fill it again, and very little to go wrong. But your video is great anyway.
I like the idea of using a strain gauge (and an MCU to do the calculations) to measure the weight of the tank and contents (and working out the level by subtracting one from the other). It reduces the problem of content contamination and sensor corrosion. It just requires the tank to have some flex (or motion) in its mount, which can be quite simple on small tanks. I like the idea that the sensor is completely external - which is more difficult with a pressure sensor.
I agree and I should have included this method because of the many advantages.
@@AndreasSpiess It's a great video regardless. Stay safe out there 😀
Great video, but your videos always are. I'm interested in the FM24-NP100 from #378. The concept is only good for plastic tanks but should avoid contact, corrosion and condensation problems. Mount it above the tank facing down so it can "see" through the top of the tank to the liquid surface. As you know, the sensor communicates via a UART so no ADC to deal with. Ignore the return from the top of the tank and so long as you know the height of the sensor above the floor of the tank, its easy math to read the level.
Radars were mentioned by a few other viewers. They seem to be quite common in commercial applications. But they are not cheap...
@@AndreasSpiess Agreed. Maybe they come down in price with time.
Capacity measurement also works for liquid level measurement. I did last year a lot experiments with a mpr121 and copper foil. Works good. If it only works inside or also outside the tank I have not tested yet. I laminated two cooper foil strip's near to eachother together in a long strip for the experiment.
I agree.
Other methods: 1) Weigh the tank and its contents by mounting it on load cells. Can be very accurate, is unaffected by tricky tank internal geometry that makes the height of fluid:volume non-linear. Disadvantage is that any pipework connected to the tanks must be flexible enough not to affect the weighing. 2) Industrial storage tanks for oil use a variant of the car fuel tank idea: the float is mounted on a long wire or chain, and a mechanism at the top of the tank winds the chain on and off a drum as the float rises and falls. 3) For threshold sensing, devices like tuning forks are sometimes used: these are energised to vibrate and the vibration is damped when the liquid rises to the level where the tuning fork becomes partially or wholly submerged. Similar devices are used with powder-filled tanks (flour, sugar, etc) In this case the fork is powered to rotate using a small electric motor. When the material starts to cover the fork, the rotation is stopped. The devices use spring-loaded mounting plate that rotates when the torque increases, tripping a micro switch, and stopping the rotation. 5) Sometimes ultrasonic sensors are mounted at the bottom of tanks, and the sound travels through the liquid and reflects back down to the sensor from the top surface. These are less affected by floating foam or dense gases above the liquid than the 'mounted at the top' kind. However, they have the same disadvantage of pressure and other bottom-mounted types: the tank has to be drained to change the sensor. 6) Some tanks are fitted with external 'sight glasses' (a transparent tube linking the top to the bottom of the tank). The liquid sits at the same level in the external tube that it does inside the tank: any sensors can then be attached to the tube rather than the tank itself. Steam engine boilers often have these sight glasses. 7) The old 'teasmade' automatic tea-brewing alarm clocks had a simple level sensor on the kettle and/or teapot - an on/off version of the weighing idea. The teapot sat on a sprung platform, and when its weight increased as the water was poured in, it compressed the springs to the point where a microswitch was switched.
A lot of good and interesting information. Thank you. For sure I should have mentioned the weight method because, as you write, it has many advantages (I never thought about the flexible pipework!).
Never tried myself, but an ntc can be used as a level sensor exploiting self heating characteristics and the difference in thermal conductivity between air and water.
In interesting possibility for a threshold level sensor!
I just use stainless rods or cables. You need 1 ground and as many electrodes as you like at different heights. All the electrodes are pulled high with pull-up resisors. When the water connects the rods to ground, they go low. Connect them to a shift register. Shift in states, and do something with code.
If you want low-tech you can do everything the same but use the electrodes to switch npn transistors that light LEDs.
Thank you for sharing. Similar to the cheap sensor I showed, but much more durable!
Great overview! 👍
I am using a throw-in pressure sensor (4-20 mA) for an IBC container filled with rainwater. For measuring the current an INA219 does a much better job than the internal ADC (Wemos D1 Mini).
Thank you for sharing your experience. Indeed, the INA219 is a good chip for such a purpose.