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?
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.
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.
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.
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.
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.
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!
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.
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.
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. 😊
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.
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.
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.
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 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!
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!!!!! 🥳
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.
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.
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.
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).
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.
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.
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" .
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 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.
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.
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.
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.
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.
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.
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.
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 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.
Obviously you came up with your solution already, but i wasn't sure if you thought about using a float similar to what alot of vehicle fuel tanks have. Those style are easily modified by varying the length of the float arm. You can get submersible or dry, analog, digital, or even just mechanical. It'd be a good backup to have just a mechanical graduated float can put a limit switch a the high water mark that kicks a pump on or w.e is needed.
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 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 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.
I had that ultrasonic in a tank outside and worked well for some time but then would stop working after few sunny days. Found out the heat outside would evaporate the water and create water drops in front of the ultrasonic sensor messing out the readings. After trying dif sensors, I end up buying that heavy duty pressure sensor around $30 and works perfectly for over a year now, also connected using ESPhome and Home assistant.
I literally have one in my cart and was about to buy it but this video makes me believe I can get away with the ultrasound. Did you set the sensor on the floor or is it hung a couple cm's from the bottom of the tank? Did you also purchase one of the readouts or did you use an arduino?
@@nerfinator03 I just left all the way to the floor, did not leave it hanging. I use the 4-20mA version and placed a simple resistor for voltage divider so the analog pin can read. Its crazy accurate. Also, don't vary with the temperature, the previous ultrasonic one would change with day and night time. The only thing that makes it vary is using the sprinklers, so I put an automation not to check level when the sprinklers are on. Prob my power supply is not enough for all l stuff I have hooked up, not sure. I used ESPhome software with an ESP32 board to get the reads.
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've been using that stainless steel type sensor in my cistern for about 5 years now No tinkering, no fiddling, just throw it in and forget about it. I've had zero issues so far I like to see a followup on how your solution works in 1 or 2 years. I have a lot of spiders and dirt and stuff in that area that might mess with ultrasound
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!" :)
Hi, I am an Electrical Engineering graduate my majors are in power system. But much lately I have been getting interested in electronics, so recently I felt my mind going blank as to how to create a electronic device to perform certain task, I know I can probably do it with Arduino but I don't want unnecessary extra component, you can say I want to create an electronic product to do a certain task with no unnecessary component and in budget. Now for example recently I installed an exhaust in my room, but now I also want the exhaust to run in reverse direction and I can do so buy adding 2 way switch and capacitor but problem is I have to manually switch it every time for both directions now what I want to do is want to add a electronic device that has a timer in it and I can set the time for one direction run, like for first 1 minutes in clockwise and then another 1 minutes into anticlockwise ( just like Energy recovery ventilations). but I don't know how to start making it what components will be needed how to connect it. and logic behind it if there is a website or any software or some AI tool that can guide me into learning on how to make make electronics by knowing the task it needs to perform. Please share your knowledge
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.
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.
Just drop a wooden ruler or rod in there through a channel in the top. Will rise and fall with the water level showing you the depth by the length of rod sticking up.
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!
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.
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.
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.
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!
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.
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.
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.
what was your reasoning behind not having a floating device that would start at a known height and then just reports height as it changes or when you query it?
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
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.
Questions : 1. How reliable do you think this sensor will be ? Is there any chances of corrosion ?(due to high humidity). Please break open the sensor & make a video 2. Is there any possibility of doing Arduino style programming in ESP32 and still supporting Home Assistant ? . It will give us flexibility to add local HMI interface in any device that we want to make work with Home Assistant.
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.
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...
Thank you SO much! We have an Kerosene tank for the heating here and I've been trying to come up with a sensor to monitor the fuel level. this looks like it will do exactly that!
With fuel and the fumes, you need to really carefully select all the components that are involved. A lot of plastics will break down quickly in there. And i guess it should be Ex rated components that are fit for a possibly explosive environment with the fumes in the tank. There is a good reason most fuel sensors still just use a float and some clever linkages to get the level mechanically out of the tank, before you convert the data in neutral atmosphere to an electronic signal.
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.
How do you like this idea you use a pipe with hall sensors. And the pipe is connected to a floting objekt with a magnet. Then you can detect where the magnet ist and calculate the volume of the wahter by the hught of the corresponding hall sensor
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.
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!!
You could also use it (or another sensor if you want backup), that can if it goes above 100% full, it could be an indication that the sump pump failed, and have that send you alerts to phone / turn on lights. (Dunno how important it is, I realize this isn't in a basement so maybe its too much)
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
There's so many ways, Pressure, height, weight And there are so many ways to do that aswell Loadcells, potentiometers, ultrasonic, But imo the cheapest is to just to put a load cell ontop of a long sealed pvc pipe As the water level rises the displacement of the pipe increases, thus increases the pressure to the load cell 🤷♂️ no moving parts Ofc it's not gonna be that accurate but going from 0% to 100% is gonna be so different that you'd probably have 0 problems in calibration😂 and the math is easy too Just from the weight from the loadcell - the weight of the pipe, that's the water displacement, Turn into volume easily, and divide with the circumference of the pipe, and you get the height of the water 0 moving parts, no risk of water damage cus a loadcell is sealed Very very simple compared to complicated ultrasound sensors or expensive pressure gauges which are just loadcells at the end of the day😂
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.
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...
Edit: Looking back, it seems like the values were just trash all around. In that case, the driver board is probably calibrated to the resistance of the wire. You could probably fix it by changing the value of a resistor or two on the driver board, and maybe a cap, depending on the circuit. I couldn't tell you for sure because you're much better at the low-level, pcb side of things than I am. I worked as an automation tech for quite a while. Those pressure diaphragms are EXTREMELY fragile. The slightest nick or dent on them and you're SOL. As for the ultrasonics, they're not as accurate or reliable, but they are way easier to calibrate, and have much more flexible mounting options (oh yeah, if you mount the pressure diaphragm at an angle, or too close to the bottom, it'll throw the readings off). I'd have to look at your code to see what's going on with that ultrasonic, but because the increments are so small, any added resistance not properly calibrated for will affect the reading, including virtually zero resistance wire. In the future, always try to find a three-wire sensor, so resistance of the wire can be automically cancelled. For the two-wire, though, your ratios shouldn't change that much, so you can likely add an offset in the code. Just measure the max range out precisely, take a reading, do the same for minimum range, calculate your increment, and compare that to the data sheet to find your offset. Your exact level may not be dead accurate throughout the range, but if top and bottom are okay, you can eke by.
7:12 the ultrasonic board returns a line that is HIGH from when a pulse is sent out to when it receives a pulse back. The cable length should be negligible, so..
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.
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'm wondering what happens if you have the sensor mounted in a "stilling" tube , vs the cone angle of the transducer in many cisterns it would be more ideal to not ever let the transducer get wet (even though it is supposedly waterproof ) Ideally i would mount this in the 2" IU.D vent tube above the water surface. There are many elctro/mechanical sensors one could make with potentiometers too. Maybe Time-Of-Flight sensors have a narrow beam angle.
Hi, I completely agree with you. Even when I have something in mind I look for various solutions and then often switch to DiY, even if my things are less electronic than yours the principle is always to look for the best for our use which is not always standard. Only one thing isn't clear to me: did you have the box with the transducer interface inside the tube along the entire length of the transducer cable or did you place it just inside the tube? The second of the two hypotheses seems to me to be the best of the two because it allows you to access the box always and in any case without having to disconnect the cat7 from the circuit in the garage, saving one or two meters of cat7 and then having to disconnect it every time you have to work on it (even if it will be rare) seems useless to me
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.
You didn't have any problems with the sensor being placed that close to the cistern wall? In the company I work for we had problems with that placment of industrial ultrasound sensors. The manufacturer specified a minimum distance of 0.5m - which prior to planning nobody seemed to look up in the manual. As usual... (I don't plan that stuff, I 'just' have to work with what they come up with and fix it so it works...)
That "black magic wire" the ultrasonic transducer was using was a coaxial cable and had a specific impedance and range of operating frequencies. It wasn't just some average shielded cable you could just cut and splice with butt end connectors since they would change the impedance and how the circuit would respond to high frequency signals. If you see coax, you need the same type of coax or a better, compatible coax to connect to it using compatible connectors and devices for that type of coax and signal type. I could get into actually crimping and connectors, but that is another conversation. The why of this being the case has to do with the physics of high frequency AC circuits treating every part of the circuit like it a capacitor, a coil, and a resistor, so if you change the shape of the shape of the wire by splicing the coax, you create capacitors at the splice points and then that changes the impedance of the whole circuit, making signals in it the wrong frequency to pass through filters they are supposed to pass through and not pass through filters they are supposed to pass through, so you get garbage back. There is also the fact that you need circuits that are connected together to have matched impedance or they can't transfer energy (signal) between each other, so when you put that splice in there, you ruin that matching and cause the signal transfer from happening efficiently, so the energy is instead being directed into the ground part of the circuit, into a noise filter (the most common result), or into parts that you are now frying (also an option).
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
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.
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.
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.
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)
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.
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!
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.
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.
Nothing beats the satisfaction of doing it yourself . Being cost effective is the most important. Looking forward to the next video
5:40
I was waiting all things to collapse after you took out the screw😂😂😂
Oh boy
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.
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. 😊
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.
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.
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.
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.
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.
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 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!
My DIY throw in pressure sensor with esp32 and INA219 set-up via ESPhome for my 5,000 gal water tank has been working great for the past 4 years.
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!!!!! 🥳
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.
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.
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.
My water tank has a float sensor which has a Reed switch inside. Working flawlessly for couple of years.
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).
10:18 OMG that's retrofitted ceramic screw fuses? I thought everyone uses only MCBs nowadays
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.
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.
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" .
I absolutely love that your getting into more smart home stuff, definately want to see more videos on DIY smart home creations!
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 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.
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.
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.
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.
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.
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.
Andreas Spiess has ones made a sensor using blood pressure measuring machine.
You could use an acoustic meter. The emptier the container is, the deeper is the sound resonance. Contactless and precise.
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.
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.
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.
Obviously you came up with your solution already, but i wasn't sure if you thought about using a float similar to what alot of vehicle fuel tanks have. Those style are easily modified by varying the length of the float arm. You can get submersible or dry, analog, digital, or even just mechanical. It'd be a good backup to have just a mechanical graduated float can put a limit switch a the high water mark that kicks a pump on or w.e is needed.
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 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...
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.
I had that ultrasonic in a tank outside and worked well for some time but then would stop working after few sunny days. Found out the heat outside would evaporate the water and create water drops in front of the ultrasonic sensor messing out the readings. After trying dif sensors, I end up buying that heavy duty pressure sensor around $30 and works perfectly for over a year now, also connected using ESPhome and Home assistant.
I literally have one in my cart and was about to buy it but this video makes me believe I can get away with the ultrasound. Did you set the sensor on the floor or is it hung a couple cm's from the bottom of the tank?
Did you also purchase one of the readouts or did you use an arduino?
@@nerfinator03 I just left all the way to the floor, did not leave it hanging. I use the 4-20mA version and placed a simple resistor for voltage divider so the analog pin can read. Its crazy accurate. Also, don't vary with the temperature, the previous ultrasonic one would change with day and night time. The only thing that makes it vary is using the sprinklers, so I put an automation not to check level when the sprinklers are on. Prob my power supply is not enough for all l stuff I have hooked up, not sure. I used ESPhome software with an ESP32 board to get the reads.
@@DanielNictheroy hey, thanks for the follow up! Much appreciated!
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've been using that stainless steel type sensor in my cistern for about 5 years now
No tinkering, no fiddling, just throw it in and forget about it. I've had zero issues so far
I like to see a followup on how your solution works in 1 or 2 years. I have a lot of spiders and dirt and stuff in that area that might mess with ultrasound
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!" :)
Hi, I am an Electrical Engineering graduate my majors are in power system. But much lately I have been getting interested in electronics, so recently I felt my mind going blank as to how to create a electronic device to perform certain task, I know I can probably do it with Arduino but I don't want unnecessary extra component, you can say I want to create an electronic product to do a certain task with no unnecessary component and in budget.
Now for example recently I installed an exhaust in my room, but now I also want the exhaust to run in reverse direction and I can do so buy adding 2 way switch and capacitor but problem is I have to manually switch it every time for both directions
now what I want to do is want to add a electronic device that has a timer in it and I can set the time for one direction run, like for first 1 minutes in clockwise and then another 1 minutes into anticlockwise ( just like Energy recovery ventilations). but I don't know how to start making it what components will be needed how to connect it. and logic behind it
if there is a website or any software or some AI tool that can guide me into learning on how to make make electronics by knowing the task it needs to perform. Please share your knowledge
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.
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.
Just drop a wooden ruler or rod in there through a channel in the top. Will rise and fall with the water level showing you the depth by the length of rod sticking up.
A stick on a float? A visual with NO batteries 😉
@@steveroberts4762 😂
But I like this approach too, elegant and allows you to incorporate into your home automation setup
@@steveroberts4762 😂
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!
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.
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.
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.
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!
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.
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.
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.
what was your reasoning behind not having a floating device that would start at a known height and then just reports height as it changes or when you query it?
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
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.
Questions :
1. How reliable do you think this sensor will be ? Is there any chances of corrosion ?(due to high humidity). Please break open the sensor & make a video
2. Is there any possibility of doing Arduino style programming in ESP32 and still supporting Home Assistant ? . It will give us flexibility to add local HMI interface in any device that we want to make work with Home Assistant.
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.
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...
Thank you SO much! We have an Kerosene tank for the heating here and I've been trying to come up with a sensor to monitor the fuel level. this looks like it will do exactly that!
With fuel and the fumes, you need to really carefully select all the components that are involved. A lot of plastics will break down quickly in there. And i guess it should be Ex rated components that are fit for a possibly explosive environment with the fumes in the tank.
There is a good reason most fuel sensors still just use a float and some clever linkages to get the level mechanically out of the tank, before you convert the data in neutral atmosphere to an electronic signal.
@@ProtonOne11 good point thanks !
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!
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.
How do you like this idea you use a pipe with hall sensors. And the pipe is connected to a floting objekt with a magnet. Then you can detect where the magnet ist and calculate the volume of the wahter by the hught of the corresponding hall sensor
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.
6:16 I love that you included that meme in the video 😂
It is one of my favorites :-)
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!!
You could also use it (or another sensor if you want backup), that can if it goes above 100% full, it could be an indication that the sump pump failed, and have that send you alerts to phone / turn on lights. (Dunno how important it is, I realize this isn't in a basement so maybe its too much)
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
There's so many ways,
Pressure, height, weight
And there are so many ways to do that aswell
Loadcells, potentiometers, ultrasonic,
But imo the cheapest is to just to put a load cell ontop of a long sealed pvc pipe
As the water level rises the displacement of the pipe increases, thus increases the pressure to the load cell 🤷♂️ no moving parts
Ofc it's not gonna be that accurate but going from 0% to 100% is gonna be so different that you'd probably have 0 problems in calibration😂 and the math is easy too
Just from the weight from the loadcell - the weight of the pipe, that's the water displacement,
Turn into volume easily, and divide with the circumference of the pipe, and you get the height of the water
0 moving parts, no risk of water damage cus a loadcell is sealed
Very very simple compared to complicated ultrasound sensors or expensive pressure gauges which are just loadcells at the end of the day😂
1inch od pvc tube,
100cm
That's almost 2000cc of volume
That's 2kg of water displaced so the loadcell only,
A 5kg loadcell is like $2😂
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.
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...
Edit: Looking back, it seems like the values were just trash all around. In that case, the driver board is probably calibrated to the resistance of the wire. You could probably fix it by changing the value of a resistor or two on the driver board, and maybe a cap, depending on the circuit. I couldn't tell you for sure because you're much better at the low-level, pcb side of things than I am.
I worked as an automation tech for quite a while. Those pressure diaphragms are EXTREMELY fragile. The slightest nick or dent on them and you're SOL. As for the ultrasonics, they're not as accurate or reliable, but they are way easier to calibrate, and have much more flexible mounting options (oh yeah, if you mount the pressure diaphragm at an angle, or too close to the bottom, it'll throw the readings off). I'd have to look at your code to see what's going on with that ultrasonic, but because the increments are so small, any added resistance not properly calibrated for will affect the reading, including virtually zero resistance wire. In the future, always try to find a three-wire sensor, so resistance of the wire can be automically cancelled. For the two-wire, though, your ratios shouldn't change that much, so you can likely add an offset in the code. Just measure the max range out precisely, take a reading, do the same for minimum range, calculate your increment, and compare that to the data sheet to find your offset. Your exact level may not be dead accurate throughout the range, but if top and bottom are okay, you can eke by.
7:14 I think its because when you add a longer cable you increase the resistance of the cable? Therefore the sensor gives strange values.
7:12 the ultrasonic board returns a line that is HIGH from when a pulse is sent out to when it receives a pulse back. The cable length should be negligible, so..
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.
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'm wondering what happens if you have the sensor mounted in a "stilling" tube , vs the cone angle of the transducer in many cisterns it would be more ideal to not ever let the transducer get wet (even though it is supposedly waterproof ) Ideally i would mount this in the 2" IU.D vent tube above the water surface. There are many elctro/mechanical sensors one could make with potentiometers too. Maybe Time-Of-Flight sensors have a narrow beam angle.
ruclips.net/video/KawRd5evHyY/видео.html
I did the same thing for a work project, but used a LiDar sensor since the cone of the ultrasonic sensor was too large for my application.
Hi, I completely agree with you.
Even when I have something in mind I look for various solutions and then often switch to DiY, even if my things are less electronic than yours the principle is always to look for the best for our use which is not always standard.
Only one thing isn't clear to me: did you have the box with the transducer interface inside the tube along the entire length of the transducer cable or did you place it just inside the tube? The second of the two hypotheses seems to me to be the best of the two because it allows you to access the box always and in any case without having to disconnect the cat7 from the circuit in the garage, saving one or two meters of cat7 and then having to disconnect it every time you have to work on it (even if it will be rare) seems useless to me
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
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.
You didn't have any problems with the sensor being placed that close to the cistern wall?
In the company I work for we had problems with that placment of industrial ultrasound sensors. The manufacturer specified a minimum distance of 0.5m - which prior to planning nobody seemed to look up in the manual. As usual...
(I don't plan that stuff, I 'just' have to work with what they come up with and fix it so it works...)
That "black magic wire" the ultrasonic transducer was using was a coaxial cable and had a specific impedance and range of operating frequencies. It wasn't just some average shielded cable you could just cut and splice with butt end connectors since they would change the impedance and how the circuit would respond to high frequency signals. If you see coax, you need the same type of coax or a better, compatible coax to connect to it using compatible connectors and devices for that type of coax and signal type. I could get into actually crimping and connectors, but that is another conversation.
The why of this being the case has to do with the physics of high frequency AC circuits treating every part of the circuit like it a capacitor, a coil, and a resistor, so if you change the shape of the shape of the wire by splicing the coax, you create capacitors at the splice points and then that changes the impedance of the whole circuit, making signals in it the wrong frequency to pass through filters they are supposed to pass through and not pass through filters they are supposed to pass through, so you get garbage back. There is also the fact that you need circuits that are connected together to have matched impedance or they can't transfer energy (signal) between each other, so when you put that splice in there, you ruin that matching and cause the signal transfer from happening efficiently, so the energy is instead being directed into the ground part of the circuit, into a noise filter (the most common result), or into parts that you are now frying (also an option).