Nice project, two simple suggestions. One, put a drip loop in that wire that runs to the box holding the PCB so water doesn't travel down in to it. It may not be wet now, but with high humidity and changing temps it will condensate on the wire and travel down. Two, I work with the industrial ultrasonic level sensors and there is a minimum distance they need to be away from the side, based on the depth of the tank to reliably detect the lower levels. Since as the sound wave travels out, it gets wider and the reflected sound is also wider. So we usually mount the sensors in the middle of the tank, like you did, but not up against the side of the wall there. It seems yours is working now with high water levels, but if you end up with erratic readings once the level goes down, try and move the sensor more to the middle of your opening. So the sensor isn't against a flat surface on one side like that.
In projects where the microcontroller operates continuously, I always implement two safeguards: - A hardware watchdog timer on the microcontroller itself. - Node-RED logic on the home assistant system to monitor sensor data publishing frequency. These combined measures (hardware and software watchdogs) improve system reliability by automatically restarting the microcontroller if it malfunctions and by alerting me if sensor data updates become infrequent, potentially indicating an issue.
I know that it is important to use click bait in order to get engagement but it is impossible to search your most recent videos effectively. I have watched you ever since the ebike battery and enjoy your vids but I'm scared this change will make it much harder to find information in the future. Can you at least add one or two words to the title about the project?
Those wires for the ultrasonic transducer are actually transmission lines not just DC signal line therefore you can't spice them but have to replace the entire length of cable. The joints in the wires caused by spices cause reflections in the signals which can cause all of the erroneous readings. You can use any random coax as a replacement but you have to replace the entire length you just can't splice them
If he replaces the tiny thin stuff with RG-59 or something, yes there are impedance matched splices available, but they still cause reflections that may affect the function. and if replacing the coax, why not just just the full length required then? And there are no splices for the thin stuff...
The signal strength in TV broadcasts is orders of magnitude larger than what is in these tiny sensors. Splices do affect TV (you can easily measure this effect and consistently guess the number of splices and length of cable with practice, some meters actually have this function built in), just not enough to matter for signals as strong as TV until you add 10 or 20 splices.
Sorry, I didnt understood very well. If I replace everything with a regular 4 or 6mm cable it would work? Or it need to be a special cable? What about the solder at the cable/pcb/connector. It would affect the signal?
@@dollymix5 Short answer is yes, but I can see some caveats to that in this case because you probably can't get all the way to the sensor component itself with how it's molded together and would still have a splice, just closer to the component. I don't know if that splice closer to the component and then no splice on the other end until you connect to the board would be "clean" enough, but it could be worth a try if you really wanted to. I stand by my other comment though, that the under water pressure sensor would be the way to "upgrade" this setup. Mostly because that sensor is more robust and I think it has a better chance of still working 10 years from now.
I've worked for a company that sells cisterns - 0:48 - i can tell you, right now - you want an ultrasound distance measurement - easy-peasy to figure out the current/remaining volume level! Especially with rain water, there's gonna be lots of contamination and "growth" in your tank, so conductive sticks won't work long-term - those tend to "get eaten". (fine-mesh rain water filters are a thing, as you're undoubtedly aware)
You could use a capacitive tank sensor to remove the risks of corrosion but you'd still be stuck with the variable properties of rain water that can alter readings. I have mostly seen these types of sensors used in generator fuel reservoirs, judging by the building automation projectd i habe been involved with until now.
An alternative solution, I'm sure there are many, is to have reed switches interspersed with resistors along a pole. A float, containing a magnet moves up and down with the water level. Extremely reliable.
I use two of these for my irrigation system, using a 555 time in flip flop mode. 555 is nice because I can run off of a wide voltage range, and the relay it triggers is 12v.
Personally - old School - a stick in a tube with a float on one end. How far the stick travels up the tube tells me the current water level. EDIT: The 'stick' is a length of PVC pipe and the Float was obtained from an old toilet cistern.
@@Bob.Jenkinshaha I use the same for my sump tank😂 I do have a buzzer at the bottom limit, so when the pole goes below a certain height it triggers a small momentary limit switch to sound the buzzer so I know that my sump is low and not to power the pump!
Pressure is the way to go for measuring water height in a tank. We had ultrasonic sensors that constantly failed at work and switched to using a pressure sensor about 5 years ago and have been working great (in salt water also)!
@@yannick7230 cheap, reliable, small, simple, low power, designed for pitch black environments. i use it for measuring salt level in water softener. i guess pressure sensor would be better if liquid is constantly moving, but it would require an airtight container. ultrasonic is better when there are too many light sources , since TOF sensor works best in darkness.
A former employer once told me about the prices he charged. "It's not about the parts, it's about the smarts." The price of the IC is nothing compared to knowing how to use it is everything.
That reminds me of a story I heard many years ago. One day there was a problem with some of the equipment and a consultant was brought in to address the problem. He takes a few looks and bangs one of the machines on the side with a hammer. The equipment then proceeds to start work. He wasn't being paid gobs of money to hit it with a hammer, he was being paid to know where to hit the machine with the hammer and that hitting it with a hammer would work.
the cable of the sensor looked like a coaxial cable, high frequency can be a bitch sometimes, also since you don'tt know the impedance of the coax it is pretty difficult to extend.
@@greatscottlab Buy another JST for dirt cheap and use the cable from that one to extend. Increase the ping time to at least 30 microseconds; the module seems to prefer this for some reason.
Isn't the type of coax cable printed on it? But if not, I think greatscott has a VNA, he could measure it (or even use his signal generator and oscilloscope). After that coax cables can only be extended with the right impedance plugs and of course the right impedance extension cable. That soldering experiment with the STP cable will generate a lot of reflections at the connection.
It probably benefits a lot from having the right impedance cable without any splices. Maybe even the resistance part of the wire plays an important part, in order to get the right amount of power into the transducer and the amplitude of the return signal is in the range where the return signal amplifier has it's working point. For someone with that much test and measurement equipment i would have expected a bit more of an analytic and scientific aproach than just blindly trying a few different cables and give up. One thing that might be a bit strange is that the signal frequency is probably below 50kHz because it's ultrasonic, so well below the usual RF frequency where normal coax cable impedance is specified. If you look at a frequency/impedance plot and the phase angle between voltage and current, cables like RG-58 are getting very unlinear below 100kHz. So that might play into cable selection here as well.
Few weeks ago I had a similar need to monitor water level in a well. I considered ultrasonics and some other ideas and decided that the simplest solution for me is a capacitive linear sensor made with old polyethylene flat tv antena cable (symetric and unshielded, used half a century ago). I have connected the cable directly to ground and one of gpio pins on esp32 (s2). Flashed with ESPHome and used its capacitive buttons function for the measurement. I have added a proper readout on Home Assistant panel together with a graph. Worked flawlesly from the start. I got a data stream that I could scale to water height in cm. The response seemed very linear and stable. Flat ribbon cable I have used for initial testing worked too (I have connected wire 1,2,3 to gpio, 4,5,6 unused, 7,8,9 to esp's gnd). I prefered polyethylene because I had doubts about pvc insulation changing its proprieties while being kept under water all the time.
In my teens (now 60) I helped my dad fix a water level sensor in his motorhome. They used a very simple (and reliable) system that had brass bolts at different levels in the water tank and a simple display with little lights (5 bolts 5 lights) that at the push of a button would show the water level, it was about as simple as you can get.
I bet that is still working. I would be blown away if this still works after 45 or so years. This is still very cool and has more functionality but there's nothing like old school solid, simple and reliable solutions to get the job done. 😊
Nonelectronic option: Put three tubes into the tank at different depths that poke out of the ground: near bottom, middle, top. Place floaty thingy into the tubes, that have very light sticks mounted on them, that also poke out of the ground. Make sure that the floaties can only move up and down a few centimeters. Done. When everything is closed, you have all three sticks poking up with a full tank, two sticks with a half full tank, one stick with a less than half full tank and no stick with a near-empty or empty tank. Low tech, lasts for decades, no software compatibility required, costs maybe 10 bucks in total materials. But yours is cool too, especially if one values a full integration into one's home system.
An easily analog/digital approach is to take a thin narrow bar of the same length as the depth of your tank. Twist it 270 degrees. Then take 2 guide rods and take a cork float and drill two holes such that the guide rods pass through. Mount the spiral plate between the guide rods. Cut a slot in the cork float that matches the the profile of the spiral plate. As the float raises the spiral plate gets twisted. You can mount a potentiometer or a pointer on top. This system has been used on fuel tanks a very long time. Look up snowmobile fuel tank gauge for examples.
Thank you! I instantly bought all the components when i saw your video to set up a sensor for my home heating oil tank. I altered your code to suit my tank depth, and all i have to do now is design my own 3d mount and install it. I've run out of oil too many times, and it's an absolute pain to bleed the system. I need to disconnect the pipe at the burner and use a pump to vacuum the oil to break the air lock.
I faintly remember a scene from "waterworld" where they had a scroungy hobo-looking dude in the cistern on a ship, and he would tell people the water level. But it's a long time ago.
He was floating inside the petrol storage tank as I recall. Not too realistic as he'd be instantly overcome by fumes. And then was blown up inside it if memory serves
@@imaginitivity7853 It was crude oil so no fumes (it was an old oil tanker). He was a prisoner and floated on a little boat and got spat on. He longed for death
I am shoked that you guys used words like "faintly remember" and "if memory serves". Are you all not ashamed that you haven't re-watched this masterpiece more recently?
My idea was to make a float similar to the one that controls the water in toilets, but instead of it controlling a valve it would turn the shaft of a potentiometer (used as a voltage divider). Buffer the middle pin voltage of the potentiometer via an op amp, buffer it once more on the other side of the cable as well, and have a galvanometer showing the water level. Yes, I'm a very, very analog guy.
This was my initial thought also, but with an accelerometer to measure the angle of the rod that the float is connected to. Ultimately the ultrasonic sensor is a far better option. No moving parts, small space requirement.
I Have been using the same ultrasonic sensor for 2 years. In my experience it works very well, depending on the application you will need to apply some sort of signal processing. Once in a while condensation might be an issue but I just clean the sensor. By the way, the first transmissor comes in RS485 and works very well at big distances with 24V power. I have a couple of tanks with these RS485 transmitters since 1 year and so far everything is ok with no maintenance need.
I would love some more details on that flexible water resistant junction box! I've never seen one like that before, and a wide variety of uses immediately come to mind.
I did exactly this for my own water reservoir. We are having a heavy drought here in Mexico City and we are close to day 0. So I needed a precise way to measure the amount of water and give warnings when the reservoir gets too low. I added to my project a SD card logger with a RTC so I can do projections in case of extreme conditions.
We are using an option that you did not mention. It is effectively a buoy with a rope and measured the distance. Its so simple but effective & easiers to deal with the whole water aspect, I can recommend it
@@esuomi you could built a draw line encoder, or built a linear encoder where you have leds on one side and photocells on the other and the rope blocks the leds
I designed one of these for a friend. All it needed was the wiring, 5 float microswitches, some relays, and some KEDs. The whole lot came in at about 30 euro. The most expensive bit was the cable.
Well-done! :) I did almost exactly the same thing some years ago with my water tank. Luckily, I didn't have to extend the sensor cable and used a D1Mini running tasmota-sensors as the micro-controller.
@@greatscottlab As I was watching, I was saying.."He's using the same sensor!! He's using the same control-board! Ahh crap, he used a different ESP!" :)
I had exactly the same idea for the underground water tank. Since I had spare Shelly Uni, I used that and hooked it up to the pressure sensor you've shown. Works great as well.
Great project, measuring water level is always challenging especially with corrosion due to humidity or direct contact to water. Having a graphical gauge displayed would complete this project beautifully!!
Wunderbar! Erst letztes Semester im Elektrotechnik-Studium genau dasselbe Projekt als Belegarbeit umgesetzt :D Kann mir aus Deinem Video Anreize mitnehmen, was ich noch verbessern kann.
Analog bubblers are pretty cool. You would use a 5psi analog input. Then connect that to a small air pump (even a hand pump) weight run an air tube to the bottom of the tank. The water pressure in the tube is the height of the water.
I did a similar project in HA for my drinking water tank (Height 2.8m x 3 m x 2m) and I have faced a lot of problems. In my case the sensor is AJ_SR04M which is quite different than yours. First problem was the reflections from the ultrasonic cone, any obstruction within that cone was generating errors, solved with repositioning of the sensor. Second issue was the range, after the surface distance of 1m it was returning rubbish readings, Problem solved with keeping power supply separated from esp32 and feeding the sensor with 3A. For the last nine months is working flawlessly!
If you end up having trouble with the ultrasonic sensor, look up nxp pressure sensors. They're fairly reasonably priced and give you a 0-10kpa range which is about as perfect as you can get for just less than 1m in water height. To use it hook up the sensor to a tube (so that the tube is sealed) and lower the tube into the tank, oriented so the end faces down. Hydrostatic pressure will push on the air in the tube which your sensor can then read. That will give you enough accuracy to measure the water level almost to the mm, or nearest 10L. The sensor also doesnt have to be in the tank, you can run the tube that distance instead of the wire, making waterproofing a lot easier.
I also got a water reservoir at my house and tried different things. In the end I used the hydrostatic sensor you showed and it works fine. Yes it was about 25€ when i bought it but I did not have to mess around a lot. Simply putting the signal in the analog pin of an esp. Running a little web server and calibrating it one time (full and empty). The rest was a little math.
I had a similar problem many years ago, in that I had to measure the water level in a tank, with the added caveat that a pump would be sporadically filling the tank up and causing surface turbulence. I also tried waterproof single transducers, and had the same issue with minimum distance, and one from maxsonar couldn't cope with the surface turbulence and gave false readings. In the end I used an A02YYUW waterproof distance sensor that has two transducers and it works great.
I can see that the cable you were trying to extend was coaxial cable. Coax is used for high frequencies and to ensure low loss, which is perfect for RF. You probably could have extended that cable with a grossly higher specked cable like common RG6 (cable TV wire). But you might have needed to add another conductor beyond the center signal, and the ground shield, if you need power and ground as well. Ive seen coax wire out there that has an external moulded third wire attached to the coax!! I'm pretty sure that it's used for giving power and getting signal back from analog surveillance cameras. Would have been perfect for this !
Following some pages which also tried to exend the range of the sensor, the HF transformer on the PCB is tuned to the cable lengh. Guess with such cable length/difference RC specs the hole resonance loop on the board needs are total rebuild?
@@mrwho30 I see, makes sense!! In RF radio applications, an SWR meter can help measure the standing wave charactistics given a specific antenna, cable, and receiver/transmitter, at any frequency. It helps the operator visualize and tune the impedence to be most efficient (reduce power loss) and is always based on matching some fractional wave length of the frequency you are targeting. That way the operator knows they are getting the highest gain possible with energy spent or received. A similar mismatch was probably happening on that wire , just because it is so high frequency, which is why they use co-axial cable. Not only do the waves have to line up to reduce deconstructive interference within the cable, but we have to make sure the signal doesn't dissipate to outside sources as happens with (normal) electrical conductor cables. How Cool is it that great Scott's fail helps us all link concepts together at a high level!! Thank for sharing your fails!!!!! 🥳
I did one for my dad when i was young. Just a stick with wires of different length with exposed copper at the ends and a ground wire at the bottom. 10 or so op-amps as comparstors and leds arranged in a line. A 9v battery and a pushbutton to energise the circuit when he wanted to know if the submersible pump still worked.
Perfect timing. I was about to replace my old "starter" ultrasonic sensor I added to my water softener lid with a better one, this one seems to be a great match!
Hi, i built something similar 3 years ago for my fountain. You forgot one important thing. Your sensorvalues will change a lot when the temperature changes, because the speed of sound changes - even in the same level oft water. So, the differences between day and night were more then 40cm. So I added a waterproof DS18B20 temperature sensor and take the temperature into account in the calculation. Now the value varies by max. 2 cm. I send my data via MQTT. Its solar-powered and it goes to deepsleep between measurements. I use HT pipes for the housing. Photos follow in request.
In undertaking such projects, it's not just about the cost; gaining knowledge and experience, as well as the joy of creating, are also very important. The pleasure found in creating something cannot be matched by simply buying it. Knowledge in human societies grows through innovation and critical thinking, not by purchasing everything we need!
This was exactly the video I was looking for, I wanted a reliable water level sensor but I was concerned about wrong readings due to the ultrasound reflecting on the sides of the tank. And I definitely agree on DIY being the winner, being an electronics hobbyist, this is the obvious route to choose as I enjoy the process too and can diagnose easily if something goes wrong.
I used to work for a telemetry company working with well depth and soil moisture sensors and flow meter loggers etc, electronics under ground or in water vapor environments needs to be designed and installed correctly to work properly. I would run a pvc tube down to the bottom of your tank down the power cable conduit and have a air source and pressure transducer in the work shop panel. Keeping the electronic s dry and safe.
I did the exact setup on 3 tanks and im pretty confident to say that "dont proceed with ultrasonic sensors". Especially in these high moisture environments. It surely needs lot of tinkering once in a while and ultimately you switch to some other sensor.
I did implement the same at my home a few years back, the only disadvantage was the minimum distance. When the distance between the sensor and water level is below 20cm, there'll be inconsistencies in readout.
Cool hacking there :). I like the DIN rail mounted box, it should keep the electronics warm, dry and comfy. Speaking of which, I really love your Hager distribution box. Clean and elegant. The legendary German quality! At some point I did a repair job on my friend's old VW LT28 camper, where he needed the wiring and plumbing fixed and ready for a trip around Europe. I don't remember the exact manufacturer and model of the system controller in that thing, but it featured a water level meter that used four screws in the tank's wall as probes placed along the height, plus an additional ground probe. It must have been either a resistive or capacitive sensor, though it could only quantize the volume to five levels: empty, 1/4, half, 3/4, full.
The issue is to have sensors in a friendly environment. The way I do it is by having a thin silicone tube fixed to the bottom and the other end inside. With a small mini compressor the tube is periodically filled with air and the pressure is a direct reflection of the water (or oil) level. The barometric pressure sensor is inside the building.
I used the cheap 2 transducer ultrasonic sensor in my home oil tank. The arduino micro with 10 leds showing tank level was about 15 meters away using 4 conductor telephone wire. It was still very accurate for me. I recently bought a pre made version that can warn you that the tank is low with an app, so i replaced it.
PGA460 is the go to IC for ultrasonic measurement. TI has good development boards that can calibrate your transducers. With the right calibration, you can reduce the dead time from the transducer. Dead time = time it takes to excite the transducer to produce a signal and then read it. When the distance is too little to measure with the speed of sound, then the ultrasonic signal already passed the transducer before it could read it. Therefor bistatic setup (two transducers, one receiver and other as transmitter) are necessary for short distance measurement. You could also increase the frequency (depending on the transducer) or use high frequency transducers to achieve accurate short distance measurements. Code for arduino is available for the PGA460 and already used in the automotive industry. Datasheet is also very on point, so no weird "black magic shenanigans" .
If you mount the sensor inside the top of a tube with a float that moves with the fluid level you can improve the accuracy. That's what we did at UGA for some of the large scale runoff test.
Wow , i kove people like you ,just self reflect and observe and make noticabke improvements better then anyone thinks is even possible . Passion is a powerful thing to help accomplish things . Good work on your speaking too man. As an american i was very mad because your videos are amazing but i had a lot of trouble following your perfectly explained videos but the change . Is great to me , now the accent that i hear i kinda like it , i think its got a perfect balance , dont go sounding any more american though
I also did a DIY ESPHome water level sensor for my potable water tank. I have that same ultrasonic sensor, but I determined that the "full" line on my tank is well within the blind spot of the sensor for any reasonable mounting location. Also, the water inlet is very near where I'd have to install the sensor, so it would get erroneous readings whenever the pump in the well was running. I ended up using a 24V 4-20 mA version of that hefty steel pressure sensor. It was a bit cheaper because 4-20 mA is an industrial automation standard, but it was still pretty expensive. I've found that as I have it currently set up, and with the geometry of my tank, it's precise to within about 10 liters. I've never tried to calibrate it, so it's probably not terribly accurate, but that doesn't really matter since the intake at the bottom leaves about 200 liters (give or take some sediment) in the bottom when it runs dry, so as long as it's within a hundred liters or so of the true value, that's good enough for me. I could probably improve the precision and the signal-to-noise ratio a bit by choosing a different current sense resistor and using a dedicated ADC instead of the one in the ESP32, but I haven't experimented with that. It does what I need it to, so I've left it alone. I even mounted the ESP and the 24V PSU on a DIN rail on the wall next to the water tank, despite being in the US where we don't really use DIN rails outside of industrial settings.
Ultrasonic level sensors, laser based level sensors, radar based level sensors are all commercially available. As are mechanic ones like high, 50%, low level floats, or floating scales. Also a visual indicator could be made with a plastic float on a rod in a tube that rises and falls in a transparent above ground tube with a scale indicating level.
All the most reliable industrial stuff I've come across are pressure sensors. A pipe with a closed and open end submerged and measure the changing air pressure.
Our house is on a buried stream, so water wells up into our basement. I too had a need for a water lever sensor and my solution was also cheap. Cut a piece of styrofoam packaging to loosely fit a pvc gutter downpipe (squarish plastic pipe). Because sump well is only about 0.7 meters, and I want to detect the top part, I only measure about 0.3 meter. That said, cut a slot into the pvc pipe so you can attach a pin to the styrofoam block. Two paint sticks make a simple linkage to a potentiometer at the top. An arduino analog pin completes the project. I also went with an RV pump as my submersible pumps seemed to disintegrate over time. There's some extra stuff, like a raspberry pi and relay board to run the pump and irrigation valves. Very very diy.
Just like you said, some people don't have the time to DIY these certain things and are happy to pay a premium for prebuilt systems. Or it is also that some people dislike having to deal with issues. I personally enjoy DIYing most of the things because it is fun and can also save some hefty money on certain products.
I really like the solution, the only thing i might have done differently is that i would added an E-ink display at the distrobution board for local readout of the waterlevels and place the water level in the center of the tank to avoid reflections at lower waterlevels
One thing i want to do for my rain tank is a LED UV lamp to get cleaner water. All i can find is $€£ expansive. My tropical plants are getting sick of the rain water (i think some type of fungi) and i can not use tap water (hard water).
its good to see... finally u worked in a Level Controller. Make sure that sensor grade of IP. and also add a automatic valve in water IN when the Tank fills.
Hi! Have you considered using a VL53L0X (or L1X) ToF sensor? I have used them in concrete basement water tanks and work reliably (most of the time). You can easily integrate them in a waterproof enclosure. Just be sure to only use the optional cover panel, in order to avoid refraction and laser Rx/Tx interference. These sensors were connected to an esp8266 and programmed to send measurements with mqtt (every 30 min). The problem I face is that when the tank truck comes to fill up the water tanks, their pump is strong and water fills in with pressure which sprays the sensor (sensor is top mounted at the tank's hatch door). For the next ~12 hours I get wrong measurements, till the accumulated water blobs are gone (on the sensor cover panel). This sensor measures accurately and consistently the distance to the water surface - when water surface is calm, measurement variate in the range of mm, 1 cm at max. Just for reference the height I am measuring is from 25cm to ~190cm. I am using them for the past 3 years, and generally moisture does not build up in the sensor's cover panel, even though proactively I clean them twice a year. Another advantage is that electronics are not exposed to tank's moisture conditions.
I think the project turned out pretty well. We can also measure the water level with a hand-made strip (supported by a stick) capacitive sensor. Making a 1 meter capacitor can be difficult (Two conductors will be placed close together and nicely insulated). But it is very useful in small water tanks. There are examples made with Arduino on the internet.
I always prefer to make rather than buy although sometimes it is cheaper and prettier to buy something. I have just made a temperature recorder with web access and a local large display for my wood fired oven, great fun!
in terms of slow response time water level sensors i'm a fan of using what i call a float column, not sure what its real name would be but its essentially a bunch of float switches in a tube with a filter on both ends. as for connection i use two main methods: wire them all in parallel with resistors of specific value that you could then use ohms law to determine how many are on and by extension how high the water level is, or wire them all in parallel with individual wires for each. additional options for each switch include using floating wires to trigger mosfets instead of floats, linear variable resistor with spring reset, pressure plates, etc. in your use case i'd imagine you could get by with just a handful of thresholds. you can make that type of sensor from literal trash (unless you use mosfets) so its pretty much free, but you'd probably spend a bit longer on the assembly. less time on the troubleshooting/ software though given the simplicity.
The fact that I made a project similar to yours just 2 weeks ago. But i chose a different way to measure water level. I used hx710b sensor (~2$) and ESPHome supports it as HX711. The seller calls it as a " liquid pressure sensor" but i think it would cause leak over time. Instead of water i used it to measure pressure of air at the bottom of the tank. After some of calibration, it appeared to very accurate, maybe to every 1/10 litter. Now I just wait to see is the sensor drift over time or not.
That is exactly how it is done on washing machines. Either a pressure switch for three levels (empty, level 1, level2) or probably on some more modern models a full on pressure sensor.
So one thing I want to point out - your sensor didn't really cost 37 Euros. Your sensor should include cost the broken transducer as well (only 4 Euros - so not much - but I've made much more expensive mistakes when DIYing) but I think it makes a good point - when DIYing something you shouldn't discount the cost of prototyping and mistakes. One thing you're paying for in the "buy" designs are the mistakes and lessons the company learned along the way to make their design reliable and consumer friendly.
Love these kinds of videos, please keep the series going for other random small projects you do. I needed a temperature sensor for my room, i was going to get a smart sensor, but remembered i had a dht11 from an arduino kit and esp8266 lying around. Installed ESPHome, wired it up and saved £10!
you will need coax with the same characteristic impedance to extend the sensor mate, otherwise you will end up with a resonant transmission line and reflections, nice video 👍
I think that the problem you encountered when trying to lengthen the cable on the sensor is not the cable but the system. I've used sensors from Micro epsilon in the past and both their eddy current and capacitive sensors have to have the cable between the sensor and the signal conditioning amplifier 'tuned' as can suffer problems from reflected waves at the high frequencies used in the sensor head. The sensors we were using had a resultion of 0.5 micron and worked faultlessly in the engine testing environment.
The cheapest easiest BUY i can think of is a $6 zigbee water leak sensor. It triggers when wet or submersed. You could install 3 at different levels, or as many as you would like. $18 for wireless low, medium, high read out in home assistant.
the most basic option I can think of for this would be a fuel pump assembly, it works on ohms to detect the level and that's transferred to a gauge which then displays the level based on the ohms received by the fuel pump assembly, how it detects the level is... with a floater and a pressure switch that's attached to a spring so that it can lower when the liquid lowers. I'm not saying drop a fuel pump into your rainwater tank, that's basically asking for trouble, but having something run on what would be considered a whiff of watts from 12v or lower, can basically be ran by... a solar panel and maybe even a lithium battery housed under the solar panel, using a meter that's got a glowing hand should reduce the power needed as you can see the level in the dark then. Total cost would be cheap, maintenance would be low and the functionality would be high as it would basically only be doing what it needs to do.
Gosh, this is the first time I've thought to myself: "I could have helped". I work as a student trainee in a German company that manufactures level probes, depending on the model with a simple analog output of 0-5 V. Price range 25-80 €. I also had to install a level probe in a water column as a demonstration model and read it out with an Arduino and LCD at the bottom.
I'm using such a "car weatherproof ultrasonic transducer" for exactly this purpose for several years now. It works well when the water level is still, but when rain-water is pouring into the (also for me 10000l) container the measurements are quite irregular, so I added a lot of averaging. Mine uses an attiny85 powered by an 18650 and sending its findings over a simple 433MHz transmitter to my ESP8266-based 433MHz to wifi gateway which also receives via 433MHz signals flagging access to my letterbox, ringing of the doorbell and various other things. The attiny85 and sensor run more than a year on a single 18650 charge, waking up every 15 minutes to take numerous samples and send through the results and the battery level. Ah yeah ... what's also a pain is ... cobwebs ...
I had similar proble, but I used a pressure sensor with 4-20mA standard output. It is water proof (obviously), the length of cable could be up to 200m, and its output is standard (and used by any PLC). I prefer standards and durable solutions
You can modify water leak sensor which is cheaper for this project application. You don't need to know the exact water level, just turn on the pump if it's reach a certain point. Water leak sensor is just probe that measure resistance between two points. Water have different resistance than air.
There's probably a cheaper way using 2 pulleys (to measure the distance), 2 motors (to bring the weights up and down) and 4 stop switches on a pair of weighted strings (one with a denser-than water, the other one with lighter than water): the first string (with the dense weight) goes to the bottom and measures the total distance, the second one measures the current distance to the lighter weight. both strings go on a pulley to trigger the stop switch when they stop going down. The operation starts by bringing both weights to the top where they trigger the stop switches, the the "total depth" line goes down and triggers the "no-gravity" stop switch (release), then the "light" weight goes down and triggers its stop switch. The difference between the number of turns of pulleys. Also, you could also simply measure the distance between a ping pong ball and the sensor in a PVC pipe going to the bottom if you know exactly the distance of your pipe, so you don't need to measure that with the weighted line and you can do "on demand" measurements without keeping the system active at all times. $37 sounds very expensive...
Just last week, I did the exact same project for my parents, they asked me if there is any option to make a water level display for our cistern. I looked online for finished products and came to the conclusion DIY is the better option. A water level meter integrated into homeassist with an ESP8266 using a pressure sensor.
I have an air conditioner in my apartment but it is built into the building and only has an on or off switch and just continuously pumps out air at a given temperature. This was annoying because it takes a long time to get up to temperature and if I want it warm/cool when I wake up I have to leave it running all night. It also seems to cost the same regardless of the temperature it is set to. So I built a device that sits on the control unit, I set AC to max heat or cold and have the device turn it on or off based on temperature and time of day, as well as using an IR remote to turn it on/off manually. It works great but cost me over $2000 to make because I was starting from nothing, I needed to buy all the tools, I needed heaps of electronic parts to learn from (though turned out I never fried anything), and got a heap of stuff I thought I needed but didn't. Parts and materials for the final product were probably under $50 but if you don't have any tools, materials, or experience then it can end up actually costing a hell of a lot more. However in the end I was happy paying so much to have the tools and the skills and knowledge to be able to use them for future projects. For a one off it probably isn't worth doing a DIY project.
for signal wiring you need coaxial type cable but not a single copper core, rather multiple smaller ones. Examle, the laptop psu cables are the best choise for thickness for you.
Love your videos but sometimes I just think that you overcomplicate these things for yourself. I've just built something similar (pir / gate reed switch / bolt microswitches / doorbell speaker and siren) into a similar wiska box and using ESPHome too. But my new favourite way of doing this is using an ETH01 board + a POE 5V splitter. The 5v is broken out to power everything (and stepped up to 12v for the siren - although I could easily have got a 12v splitter and gone down to 5v/3.3v) then everything is powered from the switch. Works a treat. I've epoxied in a siren and a speaker to the Wiska box and the doorbell plays a doorbell sound via the DFPlayer mini and also alerts Home Assistant which then triggers the doorbell sound in my loft and in my shed at the back of the garden... it's also triggered via the ring doorbell at the front door... all 3 of these systems are the same POE-> ETH01 and they work FLAWLESSLY! never had even a slight issue with any of them in well over 2 years... I really mean this as constructive feedback - would love to see you try something similar and see what you come up with as I do get many many ideas from your videos - I am a 51 year old former Electronics Engineer so have many years experience designing my own circuits and have no problem building something from scratch but the ease of using these prebuilt modules (and the price) cannot often be beaten...
I started off like this. But after a year the ultrasonic started giving garbage. Now use the pressure sensor and a shelly uni. Also for your wall tablet big number card, in hacs makes it look pretty 😀
I am doing the EXACT same sh**, with the EXACT same hardware and EXACT same software (Home Assistant), and I had the EXACT same thought that you when it comes to liquid sensor suitable for my application. The only difference here is that I am doing it for my domestic fuel tank to know when to reorder some to never run out during the winter ! And in a near future, I will implement a full auto system to order some fuel when à certain threshold is reached. Thanks for confirming my way of thinking and the effort I made with this project that it's so niche that DIY is best XD
Nah. The original wire is a coax cable and he just used a regular multi core cable. It would of worked if he had used a coax cable of the correct impedance.
Those waterproof transducers sensors are notorously unrealiable though. I bought a bunch for the same usecase and it just spat out wrong values most of the time while the normal SR04 gave proper values. Ig the quality of the product and where you buy it from makes a huge difference.
"The guy with the swiss accent" had a nice idea: Get a cheap blood pressure device for use on your wrist. ( < $10) Attach a tube to the output. Dich the other end of the tube to the bottom of the tank. Open the valve, wait a bit and measure pressure. Then shut the valve and start the pump to push out all water from the tube. Shut off the pump and wait a little. Read pressure again. Eh voilá: the difference between pressure by valve open and valve closed is your level inside the tank. Cons : All sensitive tech can be mounted outside the tank. Tube will withstand lots of hazards. And is cheap to replace. Negs: Noise and current draw of the pump
Cool project. But the simplest and most practical way to see the water level is a float in the water connected to a thin pipe that goes out on the top, then you can see on the pipe on top how much water is in the tank. And of course then use small wifi camera to monitor the pipe and have a monitor inside. Or skip the pipe and the float and just have the camera in the tank... :D :D
Nice project, two simple suggestions. One, put a drip loop in that wire that runs to the box holding the PCB so water doesn't travel down in to it. It may not be wet now, but with high humidity and changing temps it will condensate on the wire and travel down.
Two, I work with the industrial ultrasonic level sensors and there is a minimum distance they need to be away from the side, based on the depth of the tank to reliably detect the lower levels. Since as the sound wave travels out, it gets wider and the reflected sound is also wider. So we usually mount the sensors in the middle of the tank, like you did, but not up against the side of the wall there. It seems yours is working now with high water levels, but if you end up with erratic readings once the level goes down, try and move the sensor more to the middle of your opening. So the sensor isn't against a flat surface on one side like that.
In projects where the microcontroller operates continuously, I always implement two safeguards:
- A hardware watchdog timer on the microcontroller itself.
- Node-RED logic on the home assistant system to monitor sensor data publishing frequency.
These combined measures (hardware and software watchdogs) improve system reliability by automatically restarting the microcontroller if it malfunctions and by alerting me if sensor data updates become infrequent, potentially indicating an issue.
I know that it is important to use click bait in order to get engagement but it is impossible to search your most recent videos effectively. I have watched you ever since the ebike battery and enjoy your vids but I'm scared this change will make it much harder to find information in the future. Can you at least add one or two words to the title about the project?
Do not worry. After a week I usually add something to the title of the video. Here I will probably add "Water Level Sensor"
@@greatscottlab thank you, good vid 👍
Thanks, I occasionally use your videos as a template and keywords truly help find things. @@greatscottlab
if you want morea accurate titles, the Dearrow browser extention does an awesome job of it ( if someone updated the title ofc)
@@denis2381 what if I told you you didn't have to watch his free content if you didn't like it
Those wires for the ultrasonic transducer are actually transmission lines not just DC signal line therefore you can't spice them but have to replace the entire length of cable. The joints in the wires caused by spices cause reflections in the signals which can cause all of the erroneous readings. You can use any random coax as a replacement but you have to replace the entire length you just can't splice them
But if its just "coax" there are connectors& plugs extenders etc? Like oldschool tv coax ?
If he replaces the tiny thin stuff with RG-59 or something, yes there are impedance matched splices available, but they still cause reflections that may affect the function. and if replacing the coax, why not just just the full length required then? And there are no splices for the thin stuff...
The signal strength in TV broadcasts is orders of magnitude larger than what is in these tiny sensors. Splices do affect TV (you can easily measure this effect and consistently guess the number of splices and length of cable with practice, some meters actually have this function built in), just not enough to matter for signals as strong as TV until you add 10 or 20 splices.
Sorry, I didnt understood very well.
If I replace everything with a regular 4 or 6mm cable it would work? Or it need to be a special cable? What about the solder at the cable/pcb/connector. It would affect the signal?
@@dollymix5 Short answer is yes, but I can see some caveats to that in this case because you probably can't get all the way to the sensor component itself with how it's molded together and would still have a splice, just closer to the component. I don't know if that splice closer to the component and then no splice on the other end until you connect to the board would be "clean" enough, but it could be worth a try if you really wanted to. I stand by my other comment though, that the under water pressure sensor would be the way to "upgrade" this setup. Mostly because that sensor is more robust and I think it has a better chance of still working 10 years from now.
I've worked for a company that sells cisterns - 0:48 - i can tell you, right now - you want an ultrasound distance measurement - easy-peasy to figure out the current/remaining volume level! Especially with rain water, there's gonna be lots of contamination and "growth" in your tank, so conductive sticks won't work long-term - those tend to "get eaten". (fine-mesh rain water filters are a thing, as you're undoubtedly aware)
Thanks for the feedback :-)
You could use a capacitive tank sensor to remove the risks of corrosion but you'd still be stuck with the variable properties of rain water that can alter readings. I have mostly seen these types of sensors used in generator fuel reservoirs, judging by the building automation projectd i habe been involved with until now.
Time of flight sensor > ultrasonic sensor.
@@moeburnI can't imagine ToF would work well to measure the surface of a body of water given that they don't work well with reflective objects.
@@widgity See ST AN5851 for some considerations on this.
An alternative solution, I'm sure there are many, is to have reed switches interspersed with resistors along a pole. A float, containing a magnet moves up and down with the water level. Extremely reliable.
Sounds good
I use two of these for my irrigation system, using a 555 time in flip flop mode. 555 is nice because I can run off of a wide voltage range, and the relay it triggers is 12v.
@@greatscottlab it's what they used in the mud pits in the oilfield
Personally - old School - a stick in a tube with a float on one end. How far the stick travels up the tube tells me the current water level. EDIT: The 'stick' is a length of PVC pipe and the Float was obtained from an old toilet cistern.
@@Bob.Jenkinshaha I use the same for my sump tank😂 I do have a buzzer at the bottom limit, so when the pole goes below a certain height it triggers a small momentary limit switch to sound the buzzer so I know that my sump is low and not to power the pump!
Pressure is the way to go for measuring water height in a tank. We had ultrasonic sensors that constantly failed at work and switched to using a pressure sensor about 5 years ago and have been working great (in salt water also)!
I will see how it will perform in the future :-)
I am replying to all the comments that do not know that Time of Flight sensor is the best for measuring water height in a tank.
@@moeburn What are the advantages of the time of flight sensor in this use?
Yes that'd be my goto as well. If it works in washing machines it's gotta be reliable
@@yannick7230 cheap, reliable, small, simple, low power, designed for pitch black environments. i use it for measuring salt level in water softener. i guess pressure sensor would be better if liquid is constantly moving, but it would require an airtight container. ultrasonic is better when there are too many light sources , since TOF sensor works best in darkness.
A former employer once told me about the prices he charged. "It's not about the parts, it's about the smarts." The price of the IC is nothing compared to knowing how to use it is everything.
That reminds me of a story I heard many years ago. One day there was a problem with some of the equipment and a consultant was brought in to address the problem. He takes a few looks and bangs one of the machines on the side with a hammer. The equipment then proceeds to start work. He wasn't being paid gobs of money to hit it with a hammer, he was being paid to know where to hit the machine with the hammer and that hitting it with a hammer would work.
yup. people charge money to do things they know.
as my uncle said to me, if you're good at something don't do it for free. (i'm IT guy)
the cable of the sensor looked like a coaxial cable, high frequency can be a bitch sometimes, also since you don'tt know the impedance of the coax it is pretty difficult to extend.
Yeah. I searched online for a solution but it seems like no one managed to find one yet.
@@greatscottlab Buy another JST for dirt cheap and use the cable from that one to extend. Increase the ping time to at least 30 microseconds; the module seems to prefer this for some reason.
Use two arduinos and connect those by a long cable 👍
Isn't the type of coax cable printed on it? But if not, I think greatscott has a VNA, he could measure it (or even use his signal generator and oscilloscope). After that coax cables can only be extended with the right impedance plugs and of course the right impedance extension cable. That soldering experiment with the STP cable will generate a lot of reflections at the connection.
It probably benefits a lot from having the right impedance cable without any splices. Maybe even the resistance part of the wire plays an important part, in order to get the right amount of power into the transducer and the amplitude of the return signal is in the range where the return signal amplifier has it's working point.
For someone with that much test and measurement equipment i would have expected a bit more of an analytic and scientific aproach than just blindly trying a few different cables and give up.
One thing that might be a bit strange is that the signal frequency is probably below 50kHz because it's ultrasonic, so well below the usual RF frequency where normal coax cable impedance is specified. If you look at a frequency/impedance plot and the phase angle between voltage and current, cables like RG-58 are getting very unlinear below 100kHz. So that might play into cable selection here as well.
Few weeks ago I had a similar need to monitor water level in a well. I considered ultrasonics and some other ideas and decided that the simplest solution for me is a capacitive linear sensor made with old polyethylene flat tv antena cable (symetric and unshielded, used half a century ago). I have connected the cable directly to ground and one of gpio pins on esp32 (s2). Flashed with ESPHome and used its capacitive buttons function for the measurement. I have added a proper readout on Home Assistant panel together with a graph. Worked flawlesly from the start. I got a data stream that I could scale to water height in cm. The response seemed very linear and stable.
Flat ribbon cable I have used for initial testing worked too (I have connected wire 1,2,3 to gpio, 4,5,6 unused, 7,8,9 to esp's gnd). I prefered polyethylene because I had doubts about pvc insulation changing its proprieties while being kept under water all the time.
In my teens (now 60) I helped my dad fix a water level sensor in his motorhome. They used a very simple (and reliable) system that had brass bolts at different levels in the water tank and a simple display with little lights (5 bolts 5 lights) that at the push of a button would show the water level, it was about as simple as you can get.
I bet that is still working. I would be blown away if this still works after 45 or so years. This is still very cool and has more functionality but there's nothing like old school solid, simple and reliable solutions to get the job done. 😊
First thought that came to me was adapting a fuel tank sender unit. It’s essentially a float on an arm that pivots adjusting a variable resistor.
Nonelectronic option: Put three tubes into the tank at different depths that poke out of the ground: near bottom, middle, top. Place floaty thingy into the tubes, that have very light sticks mounted on them, that also poke out of the ground. Make sure that the floaties can only move up and down a few centimeters. Done. When everything is closed, you have all three sticks poking up with a full tank, two sticks with a half full tank, one stick with a less than half full tank and no stick with a near-empty or empty tank. Low tech, lasts for decades, no software compatibility required, costs maybe 10 bucks in total materials.
But yours is cool too, especially if one values a full integration into one's home system.
An easily analog/digital approach is to take a thin narrow bar of the same length as the depth of your tank. Twist it 270 degrees. Then take 2 guide rods and take a cork float and drill two holes such that the guide rods pass through. Mount the spiral plate between the guide rods. Cut a slot in the cork float that matches the the profile of the spiral plate.
As the float raises the spiral plate gets twisted. You can mount a potentiometer or a pointer on top.
This system has been used on fuel tanks a very long time.
Look up snowmobile fuel tank gauge for examples.
5:40
I was waiting all things to collapse after you took out the screw😂😂😂
Oh boy
Nothing beats the satisfaction of doing it yourself . Being cost effective is the most important. Looking forward to the next video
Thank you! I instantly bought all the components when i saw your video to set up a sensor for my home heating oil tank. I altered your code to suit my tank depth, and all i have to do now is design my own 3d mount and install it.
I've run out of oil too many times, and it's an absolute pain to bleed the system. I need to disconnect the pipe at the burner and use a pump to vacuum the oil to break the air lock.
I faintly remember a scene from "waterworld" where they had a scroungy hobo-looking dude in the cistern on a ship, and he would tell people the water level. But it's a long time ago.
That sounds like a fun job :-)
He was floating inside the petrol storage tank as I recall. Not too realistic as he'd be instantly overcome by fumes. And then was blown up inside it if memory serves
@@imaginitivity7853 It was crude oil so no fumes (it was an old oil tanker). He was a prisoner and floated on a little boat and got spat on. He longed for death
@@jacksonblack9408 I still think you'd asphyxiate in a crude oil tank.
I am shoked that you guys used words like "faintly remember" and "if memory serves".
Are you all not ashamed that you haven't re-watched this masterpiece more recently?
My idea was to make a float similar to the one that controls the water in toilets, but instead of it controlling a valve it would turn the shaft of a potentiometer (used as a voltage divider). Buffer the middle pin voltage of the potentiometer via an op amp, buffer it once more on the other side of the cable as well, and have a galvanometer showing the water level. Yes, I'm a very, very analog guy.
This is how it’s done in the gas tank of some cars.
so basically a gas float from a car?
I like it.
This was my initial thought also, but with an accelerometer to measure the angle of the rod that the float is connected to. Ultimately the ultrasonic sensor is a far better option. No moving parts, small space requirement.
I absolutely love that your getting into more smart home stuff, definately want to see more videos on DIY smart home creations!
I Have been using the same ultrasonic sensor for 2 years. In my experience it works very well, depending on the application you will need to apply some sort of signal processing. Once in a while condensation might be an issue but I just clean the sensor. By the way, the first transmissor comes in RS485 and works very well at big distances with 24V power. I have a couple of tanks with these RS485 transmitters since 1 year and so far everything is ok with no maintenance need.
I would love some more details on that flexible water resistant junction box! I've never seen one like that before, and a wide variety of uses immediately come to mind.
It is very common for electrical installation here in Germany. I tried linking a similar one in the video description.
You could use an acoustic meter. The emptier the container is, the deeper is the sound resonance. Contactless and precise.
I did exactly this for my own water reservoir. We are having a heavy drought here in Mexico City and we are close to day 0. So I needed a precise way to measure the amount of water and give warnings when the reservoir gets too low. I added to my project a SD card logger with a RTC so I can do projections in case of extreme conditions.
We are using an option that you did not mention.
It is effectively a buoy with a rope and measured the distance.
Its so simple but effective & easiers to deal with the whole water aspect, I can recommend it
A buoy is the most practical solution, that's how water tanks close their intake as well
Sounds like a reliable analog solution :-)
@@esuomiwith a smart placed switch.
@@esuomi you could built a draw line encoder, or built a linear encoder where you have leds on one side and photocells on the other and the rope blocks the leds
Time of Flight sensor like VL6180X is cheaper, easier and smaller than all of these solutions.
6:16 I love that you included that meme in the video 😂
It is one of my favorites :-)
Im coming back to this video because Im now living on a property with water tanks, and we need an ability to see how full it is, so its time to DIY!
I designed one of these for a friend. All it needed was the wiring, 5 float microswitches, some relays, and some KEDs. The whole lot came in at about 30 euro. The most expensive bit was the cable.
Well-done! :) I did almost exactly the same thing some years ago with my water tank. Luckily, I didn't have to extend the sensor cable and used a D1Mini running tasmota-sensors as the micro-controller.
Nice work!
@@greatscottlab As I was watching, I was saying.."He's using the same sensor!! He's using the same control-board! Ahh crap, he used a different ESP!" :)
I had exactly the same idea for the underground water tank. Since I had spare Shelly Uni, I used that and hooked it up to the pressure sensor you've shown. Works great as well.
I've done the same thing, it works great if you have a decent wifi...
Great project, measuring water level is always challenging especially with corrosion due to humidity or direct contact to water. Having a graphical gauge displayed would complete this project beautifully!!
Wunderbar! Erst letztes Semester im Elektrotechnik-Studium genau dasselbe Projekt als Belegarbeit umgesetzt :D Kann mir aus Deinem Video Anreize mitnehmen, was ich noch verbessern kann.
Analog bubblers are pretty cool. You would use a 5psi analog input. Then connect that to a small air pump (even a hand pump) weight run an air tube to the bottom of the tank. The water pressure in the tube is the height of the water.
I did a similar project in HA for my drinking water tank (Height 2.8m x 3 m x 2m) and I have faced a lot of problems. In my case the sensor is AJ_SR04M which is quite different than yours. First problem was the reflections from the ultrasonic cone, any obstruction within that cone was generating errors, solved with repositioning of the sensor. Second issue was the range, after the surface distance of 1m it was returning rubbish readings, Problem solved with keeping power supply separated from esp32 and feeding the sensor with 3A. For the last nine months is working flawlessly!
If you end up having trouble with the ultrasonic sensor, look up nxp pressure sensors.
They're fairly reasonably priced and give you a 0-10kpa range which is about as perfect as you can get for just less than 1m in water height.
To use it hook up the sensor to a tube (so that the tube is sealed) and lower the tube into the tank, oriented so the end faces down.
Hydrostatic pressure will push on the air in the tube which your sensor can then read.
That will give you enough accuracy to measure the water level almost to the mm, or nearest 10L.
The sensor also doesnt have to be in the tank, you can run the tube that distance instead of the wire, making waterproofing a lot easier.
I also got a water reservoir at my house and tried different things. In the end I used the hydrostatic sensor you showed and it works fine. Yes it was about 25€ when i bought it but I did not have to mess around a lot. Simply putting the signal in the analog pin of an esp. Running a little web server and calibrating it one time (full and empty). The rest was a little math.
I had a similar problem many years ago, in that I had to measure the water level in a tank, with the added caveat that a pump would be sporadically filling the tank up and causing surface turbulence. I also tried waterproof single transducers, and had the same issue with minimum distance, and one from maxsonar couldn't cope with the surface turbulence and gave false readings. In the end I used an A02YYUW waterproof distance sensor that has two transducers and it works great.
I can see that the cable you were trying to extend was coaxial cable. Coax is used for high frequencies and to ensure low loss, which is perfect for RF. You probably could have extended that cable with a grossly higher specked cable like common RG6 (cable TV wire). But you might have needed to add another conductor beyond the center signal, and the ground shield, if you need power and ground as well. Ive seen coax wire out there that has an external moulded third wire attached to the coax!! I'm pretty sure that it's used for giving power and getting signal back from analog surveillance cameras. Would have been perfect for this !
Following some pages which also tried to exend the range of the sensor, the HF transformer on the PCB is tuned to the cable lengh.
Guess with such cable length/difference RC specs the hole resonance loop on the board needs are total rebuild?
@@mrwho30 I see, makes sense!! In RF radio applications, an SWR meter can help measure the standing wave charactistics given a specific antenna, cable, and receiver/transmitter, at any frequency. It helps the operator visualize and tune the impedence to be most efficient (reduce power loss) and is always based on matching some fractional wave length of the frequency you are targeting. That way the operator knows they are getting the highest gain possible with energy spent or received. A similar mismatch was probably happening on that wire , just because it is so high frequency, which is why they use co-axial cable. Not only do the waves have to line up to reduce deconstructive interference within the cable, but we have to make sure the signal doesn't dissipate to outside sources as happens with (normal) electrical conductor cables. How Cool is it that great Scott's fail helps us all link concepts together at a high level!! Thank for sharing your fails!!!!! 🥳
My water tank has a float sensor which has a Reed switch inside. Working flawlessly for couple of years.
I did one for my dad when i was young. Just a stick with wires of different length with exposed copper at the ends and a ground wire at the bottom. 10 or so op-amps as comparstors and leds arranged in a line.
A 9v battery and a pushbutton to energise the circuit when he wanted to know if the submersible pump still worked.
Perfect timing. I was about to replace my old "starter" ultrasonic sensor I added to my water softener lid with a better one, this one seems to be a great match!
Hi,
i built something similar 3 years ago for my fountain. You forgot one important thing. Your sensorvalues will change a lot when the temperature changes, because the speed of sound changes - even in the same level oft water.
So, the differences between day and night were more then 40cm.
So I added a waterproof DS18B20 temperature sensor and take the temperature into account in the calculation. Now the value varies by max. 2 cm.
I send my data via MQTT. Its solar-powered and it goes to deepsleep between measurements.
I use HT pipes for the housing. Photos follow in request.
In undertaking such projects, it's not just about the cost; gaining knowledge and experience, as well as the joy of creating, are also very important. The pleasure found in creating something cannot be matched by simply buying it. Knowledge in human societies grows through innovation and critical thinking, not by purchasing everything we need!
This was exactly the video I was looking for, I wanted a reliable water level sensor but I was concerned about wrong readings due to the ultrasound reflecting on the sides of the tank.
And I definitely agree on DIY being the winner, being an electronics hobbyist, this is the obvious route to choose as I enjoy the process too and can diagnose easily if something goes wrong.
I used to work for a telemetry company working with well depth and soil moisture sensors and flow meter loggers etc, electronics under ground or in water vapor environments needs to be designed and installed correctly to work properly. I would run a pvc tube down to the bottom of your tank down the power cable conduit and have a air source and pressure transducer in the work shop panel. Keeping the electronic s dry and safe.
I did the exact setup on 3 tanks and im pretty confident to say that "dont proceed with ultrasonic sensors". Especially in these high moisture environments. It surely needs lot of tinkering once in a while and ultimately you switch to some other sensor.
They are really common in commercial hot water tanks or "tea boilers". You can get a very simple, very cheap high and low water level sensors.
I did implement the same at my home a few years back, the only disadvantage was the minimum distance. When the distance between the sensor and water level is below 20cm, there'll be inconsistencies in readout.
Cool hacking there :). I like the DIN rail mounted box, it should keep the electronics warm, dry and comfy. Speaking of which, I really love your Hager distribution box. Clean and elegant. The legendary German quality!
At some point I did a repair job on my friend's old VW LT28 camper, where he needed the wiring and plumbing fixed and ready for a trip around Europe. I don't remember the exact manufacturer and model of the system controller in that thing, but it featured a water level meter that used four screws in the tank's wall as probes placed along the height, plus an additional ground probe. It must have been either a resistive or capacitive sensor, though it could only quantize the volume to five levels: empty, 1/4, half, 3/4, full.
The issue is to have sensors in a friendly environment. The way I do it is by having a thin silicone tube fixed to the bottom and the other end inside. With a small mini compressor the tube is periodically filled with air and the pressure is a direct reflection of the water (or oil) level. The barometric pressure sensor is inside the building.
I used the cheap 2 transducer ultrasonic sensor in my home oil tank. The arduino micro with 10 leds showing tank level was about 15 meters away using 4 conductor telephone wire. It was still very accurate for me. I recently bought a pre made version that can warn you that the tank is low with an app, so i replaced it.
PGA460 is the go to IC for ultrasonic measurement. TI has good development boards that can calibrate your transducers. With the right calibration, you can reduce the dead time from the transducer. Dead time = time it takes to excite the transducer to produce a signal and then read it. When the distance is too little to measure with the speed of sound, then the ultrasonic signal already passed the transducer before it could read it. Therefor bistatic setup (two transducers, one receiver and other as transmitter) are necessary for short distance measurement. You could also increase the frequency (depending on the transducer) or use high frequency transducers to achieve accurate short distance measurements.
Code for arduino is available for the PGA460 and already used in the automotive industry. Datasheet is also very on point, so no weird "black magic shenanigans" .
Andreas Spiess has ones made a sensor using blood pressure measuring machine.
If you mount the sensor inside the top of a tube with a float that moves with the fluid level you can improve the accuracy. That's what we did at UGA for some of the large scale runoff test.
Wow , i kove people like you ,just self reflect and observe and make noticabke improvements better then anyone thinks is even possible . Passion is a powerful thing to help accomplish things . Good work on your speaking too man. As an american i was very mad because your videos are amazing but i had a lot of trouble following your perfectly explained videos but the change . Is great to me , now the accent that i hear i kinda like it , i think its got a perfect balance , dont go sounding any more american though
I also did a DIY ESPHome water level sensor for my potable water tank. I have that same ultrasonic sensor, but I determined that the "full" line on my tank is well within the blind spot of the sensor for any reasonable mounting location. Also, the water inlet is very near where I'd have to install the sensor, so it would get erroneous readings whenever the pump in the well was running.
I ended up using a 24V 4-20 mA version of that hefty steel pressure sensor. It was a bit cheaper because 4-20 mA is an industrial automation standard, but it was still pretty expensive.
I've found that as I have it currently set up, and with the geometry of my tank, it's precise to within about 10 liters. I've never tried to calibrate it, so it's probably not terribly accurate, but that doesn't really matter since the intake at the bottom leaves about 200 liters (give or take some sediment) in the bottom when it runs dry, so as long as it's within a hundred liters or so of the true value, that's good enough for me. I could probably improve the precision and the signal-to-noise ratio a bit by choosing a different current sense resistor and using a dedicated ADC instead of the one in the ESP32, but I haven't experimented with that. It does what I need it to, so I've left it alone.
I even mounted the ESP and the 24V PSU on a DIN rail on the wall next to the water tank, despite being in the US where we don't really use DIN rails outside of industrial settings.
Ultrasonic level sensors, laser based level sensors, radar based level sensors are all commercially available. As are mechanic ones like high, 50%, low level floats, or floating scales. Also a visual indicator could be made with a plastic float on a rod in a tube that rises and falls in a transparent above ground tube with a scale indicating level.
I like it when you say “stay creative and I’ll see you next time”
All the most reliable industrial stuff I've come across are pressure sensors.
A pipe with a closed and open end submerged and measure the changing air pressure.
Hey, I'mm all for sensors and automatic reporting, but a stick works really well in this application.
Our house is on a buried stream, so water wells up into our basement. I too had a need for a water lever sensor and my solution was also cheap. Cut a piece of styrofoam packaging to loosely fit a pvc gutter downpipe (squarish plastic pipe). Because sump well is only about 0.7 meters, and I want to detect the top part, I only measure about 0.3 meter. That said, cut a slot into the pvc pipe so you can attach a pin to the styrofoam block. Two paint sticks make a simple linkage to a potentiometer at the top. An arduino analog pin completes the project. I also went with an RV pump as my submersible pumps seemed to disintegrate over time. There's some extra stuff, like a raspberry pi and relay board to run the pump and irrigation valves. Very very diy.
Oh boy. Sounds like fun :-)
Just like you said, some people don't have the time to DIY these certain things and are happy to pay a premium for prebuilt systems. Or it is also that some people dislike having to deal with issues. I personally enjoy DIYing most of the things because it is fun and can also save some hefty money on certain products.
I really like the solution, the only thing i might have done differently is that i would added an E-ink display at the distrobution board for local readout of the waterlevels and place the water level in the center of the tank to avoid reflections at lower waterlevels
One thing i want to do for my rain tank is a LED UV lamp to get cleaner water. All i can find is $€£ expansive. My tropical plants are getting sick of the rain water (i think some type of fungi) and i can not use tap water (hard water).
its good to see... finally u worked in a Level Controller. Make sure that sensor grade of IP. and also add a automatic valve in water IN when the Tank fills.
Hi! Have you considered using a VL53L0X (or L1X) ToF sensor? I have used them in concrete basement water tanks and work reliably (most of the time). You can easily integrate them in a waterproof enclosure. Just be sure to only use the optional cover panel, in order to avoid refraction and laser Rx/Tx interference. These sensors were connected to an esp8266 and programmed to send measurements with mqtt (every 30 min). The problem I face is that when the tank truck comes to fill up the water tanks, their pump is strong and water fills in with pressure which sprays the sensor (sensor is top mounted at the tank's hatch door). For the next ~12 hours I get wrong measurements, till the accumulated water blobs are gone (on the sensor cover panel). This sensor measures accurately and consistently the distance to the water surface - when water surface is calm, measurement variate in the range of mm, 1 cm at max. Just for reference the height I am measuring is from 25cm to ~190cm. I am using them for the past 3 years, and generally moisture does not build up in the sensor's cover panel, even though proactively I clean them twice a year. Another advantage is that electronics are not exposed to tank's moisture conditions.
Can't tell you how many times I've had to DIY because what I wanted was so niche. Good research!
I think the project turned out pretty well. We can also measure the water level with a hand-made strip (supported by a stick) capacitive sensor. Making a 1 meter capacitor can be difficult (Two conductors will be placed close together and nicely insulated). But it is very useful in small water tanks. There are examples made with Arduino on the internet.
I always prefer to make rather than buy although sometimes it is cheaper and prettier to buy something. I have just made a temperature recorder with web access and a local large display for my wood fired oven, great fun!
Another realible option would be the float from a car gas tank, extend the arm to extend the range😁
in terms of slow response time water level sensors i'm a fan of using what i call a float column, not sure what its real name would be but its essentially a bunch of float switches in a tube with a filter on both ends. as for connection i use two main methods: wire them all in parallel with resistors of specific value that you could then use ohms law to determine how many are on and by extension how high the water level is, or wire them all in parallel with individual wires for each. additional options for each switch include using floating wires to trigger mosfets instead of floats, linear variable resistor with spring reset, pressure plates, etc. in your use case i'd imagine you could get by with just a handful of thresholds. you can make that type of sensor from literal trash (unless you use mosfets) so its pretty much free, but you'd probably spend a bit longer on the assembly. less time on the troubleshooting/ software though given the simplicity.
The fact that I made a project similar to yours just 2 weeks ago. But i chose a different way to measure water level. I used hx710b sensor (~2$) and ESPHome supports it as HX711. The seller calls it as a " liquid pressure sensor" but i think it would cause leak over time. Instead of water i used it to measure pressure of air at the bottom of the tank. After some of calibration, it appeared to very accurate, maybe to every 1/10 litter. Now I just wait to see is the sensor drift over time or not.
That sounds like a really creative solution. Love it :-)
That is exactly how it is done on washing machines. Either a pressure switch for three levels (empty, level 1, level2) or probably on some more modern models a full on pressure sensor.
So one thing I want to point out - your sensor didn't really cost 37 Euros. Your sensor should include cost the broken transducer as well (only 4 Euros - so not much - but I've made much more expensive mistakes when DIYing) but I think it makes a good point - when DIYing something you shouldn't discount the cost of prototyping and mistakes. One thing you're paying for in the "buy" designs are the mistakes and lessons the company learned along the way to make their design reliable and consumer friendly.
The simplest water level indicator for a tank, is a clear PVC or acrylic pipe that is connected to the top and bottom of the tank.
It’s underground.
@@mikebond6328 that I did not know
Love these kinds of videos, please keep the series going for other random small projects you do.
I needed a temperature sensor for my room, i was going to get a smart sensor, but remembered i had a dht11 from an arduino kit and esp8266 lying around. Installed ESPHome, wired it up and saved £10!
you will need coax with the same characteristic impedance to extend the sensor mate, otherwise you will end up with a resonant transmission line and reflections, nice video 👍
I'm actually planning something really similar for my water tank in my camper van (which also runs home assistant of course). So thanks very much!
I think that the problem you encountered when trying to lengthen the cable on the sensor is not the cable but the system. I've used sensors from Micro epsilon in the past and both their eddy current and capacitive sensors have to have the cable between the sensor and the signal conditioning amplifier 'tuned' as can suffer problems from reflected waves at the high frequencies used in the sensor head. The sensors we were using had a resultion of 0.5 micron and worked faultlessly in the engine testing environment.
The cheapest easiest BUY i can think of is a $6 zigbee water leak sensor. It triggers when wet or submersed. You could install 3 at different levels, or as many as you would like. $18 for wireless low, medium, high read out in home assistant.
the most basic option I can think of for this would be a fuel pump assembly, it works on ohms to detect the level and that's transferred to a gauge which then displays the level based on the ohms received by the fuel pump assembly, how it detects the level is... with a floater and a pressure switch that's attached to a spring so that it can lower when the liquid lowers.
I'm not saying drop a fuel pump into your rainwater tank, that's basically asking for trouble, but having something run on what would be considered a whiff of watts from 12v or lower, can basically be ran by... a solar panel and maybe even a lithium battery housed under the solar panel, using a meter that's got a glowing hand should reduce the power needed as you can see the level in the dark then.
Total cost would be cheap, maintenance would be low and the functionality would be high as it would basically only be doing what it needs to do.
Gosh, this is the first time I've thought to myself: "I could have helped". I work as a student trainee in a German company that manufactures level probes, depending on the model with a simple analog output of 0-5 V. Price range 25-80 €. I also had to install a level probe in a water column as a demonstration model and read it out with an Arduino and LCD at the bottom.
I'm using such a "car weatherproof ultrasonic transducer" for exactly this purpose for several years now. It works well when the water level is still, but when rain-water is pouring into the (also for me 10000l) container the measurements are quite irregular, so I added a lot of averaging. Mine uses an attiny85 powered by an 18650 and sending its findings over a simple 433MHz transmitter to my ESP8266-based 433MHz to wifi gateway which also receives via 433MHz signals flagging access to my letterbox, ringing of the doorbell and various other things. The attiny85 and sensor run more than a year on a single 18650 charge, waking up every 15 minutes to take numerous samples and send through the results and the battery level.
Ah yeah ... what's also a pain is ... cobwebs ...
I had similar proble, but I used a pressure sensor with 4-20mA standard output. It is water proof (obviously), the length of cable could be up to 200m, and its output is standard (and used by any PLC). I prefer standards and durable solutions
You can modify water leak sensor which is cheaper for this project application. You don't need to know the exact water level, just turn on the pump if it's reach a certain point. Water leak sensor is just probe that measure resistance between two points. Water have different resistance than air.
Another cheap solution is to use the water level sensor from small top loading washing machine from Asia. They use the LVDT method.
There's probably a cheaper way using 2 pulleys (to measure the distance), 2 motors (to bring the weights up and down) and 4 stop switches on a pair of weighted strings (one with a denser-than water, the other one with lighter than water): the first string (with the dense weight) goes to the bottom and measures the total distance, the second one measures the current distance to the lighter weight. both strings go on a pulley to trigger the stop switch when they stop going down. The operation starts by bringing both weights to the top where they trigger the stop switches, the the "total depth" line goes down and triggers the "no-gravity" stop switch (release), then the "light" weight goes down and triggers its stop switch. The difference between the number of turns of pulleys.
Also, you could also simply measure the distance between a ping pong ball and the sensor in a PVC pipe going to the bottom if you know exactly the distance of your pipe, so you don't need to measure that with the weighted line and you can do "on demand" measurements without keeping the system active at all times. $37 sounds very expensive...
Just last week, I did the exact same project for my parents, they asked me if there is any option to make a water level display for our cistern. I looked online for finished products and came to the conclusion DIY is the better option. A water level meter integrated into homeassist with an ESP8266 using a pressure sensor.
I have an air conditioner in my apartment but it is built into the building and only has an on or off switch and just continuously pumps out air at a given temperature. This was annoying because it takes a long time to get up to temperature and if I want it warm/cool when I wake up I have to leave it running all night. It also seems to cost the same regardless of the temperature it is set to. So I built a device that sits on the control unit, I set AC to max heat or cold and have the device turn it on or off based on temperature and time of day, as well as using an IR remote to turn it on/off manually. It works great but cost me over $2000 to make because I was starting from nothing, I needed to buy all the tools, I needed heaps of electronic parts to learn from (though turned out I never fried anything), and got a heap of stuff I thought I needed but didn't. Parts and materials for the final product were probably under $50 but if you don't have any tools, materials, or experience then it can end up actually costing a hell of a lot more.
However in the end I was happy paying so much to have the tools and the skills and knowledge to be able to use them for future projects. For a one off it probably isn't worth doing a DIY project.
for signal wiring you need coaxial type cable but not a single copper core, rather multiple smaller ones.
Examle, the laptop psu cables are the best choise for thickness for you.
Maybe a weird comment, but I love how clear your handwriting is
depends on how much you value your time really. and whether or not the experience of building and learning how to build is valuable to you
No need to put the junction box in the duct, extend the Ethernet cable and leave the junction in the head of the tank.
Love your videos but sometimes I just think that you overcomplicate these things for yourself. I've just built something similar (pir / gate reed switch / bolt microswitches / doorbell speaker and siren) into a similar wiska box and using ESPHome too. But my new favourite way of doing this is using an ETH01 board + a POE 5V splitter. The 5v is broken out to power everything (and stepped up to 12v for the siren - although I could easily have got a 12v splitter and gone down to 5v/3.3v) then everything is powered from the switch. Works a treat. I've epoxied in a siren and a speaker to the Wiska box and the doorbell plays a doorbell sound via the DFPlayer mini and also alerts Home Assistant which then triggers the doorbell sound in my loft and in my shed at the back of the garden... it's also triggered via the ring doorbell at the front door... all 3 of these systems are the same POE-> ETH01 and they work FLAWLESSLY! never had even a slight issue with any of them in well over 2 years...
I really mean this as constructive feedback - would love to see you try something similar and see what you come up with as I do get many many ideas from your videos - I am a 51 year old former Electronics Engineer so have many years experience designing my own circuits and have no problem building something from scratch but the ease of using these prebuilt modules (and the price) cannot often be beaten...
The via in pad really saved my butt when designing an led matrix with 1.5mm square RGB LEDs.
I started off like this. But after a year the ultrasonic started giving garbage. Now use the pressure sensor and a shelly uni. Also for your wall tablet big number card, in hacs makes it look pretty 😀
I am doing the EXACT same sh**, with the EXACT same hardware and EXACT same software (Home Assistant), and I had the EXACT same thought that you when it comes to liquid sensor suitable for my application.
The only difference here is that I am doing it for my domestic fuel tank to know when to reorder some to never run out during the winter !
And in a near future, I will implement a full auto system to order some fuel when à certain threshold is reached.
Thanks for confirming my way of thinking and the effort I made with this project that it's so niche that DIY is best XD
Changing the wire length of the Sensor probably messed up the hardcoded timings of the sensors board
Maybe.....
Those sensors are impedance matched to the controllers. Which means you need a matched feedline.
Nah. The original wire is a coax cable and he just used a regular multi core cable.
It would of worked if he had used a coax cable of the correct impedance.
Those waterproof transducers sensors are notorously unrealiable though. I bought a bunch for the same usecase and it just spat out wrong values most of the time while the normal SR04 gave proper values. Ig the quality of the product and where you buy it from makes a huge difference.
"The guy with the swiss accent" had a nice idea:
Get a cheap blood pressure device for use on your wrist. ( < $10)
Attach a tube to the output. Dich the other end of the tube to the bottom of the tank.
Open the valve, wait a bit and measure pressure.
Then shut the valve and start the pump to push out all water from the tube.
Shut off the pump and wait a little. Read pressure again.
Eh voilá: the difference between pressure by valve open and valve closed is your level inside the tank.
Cons : All sensitive tech can be mounted outside the tank. Tube will withstand lots of hazards. And is cheap to replace.
Negs: Noise and current draw of the pump
Cool project. But the simplest and most practical way to see the water level is a float in the water connected to a thin pipe that goes out on the top, then you can see on the pipe on top how much water is in the tank. And of course then use small wifi camera to monitor the pipe and have a monitor inside. Or skip the pipe and the float and just have the camera in the tank... :D :D