Author Topic: Water Level Sensing for outdoor plastic water tubs?  (Read 1213 times)

0 Members and 1 Guest are viewing this topic.

Offline victorhooiTopic starter

  • Contributor
  • Posts: 44
  • Country: au
Water Level Sensing for outdoor plastic water tubs?
« on: September 02, 2024, 04:39:46 am »
Hi,

I have some open white plastic tubs with carnivorous plants on my balcony, and I need to monitor the water level in them (photo attached):

2358391-0

I'm trying to keep the water level in them >= 30mm if possible. (At first, it will just be for alerting - later on, I'm going to try to link it to a drip irrigation and/or misting system)

This is an an exposed outdoor balcony - I can have a waterproof control box somewhere, with a Raspberry Pi/Arduino/NUC, but it may be some distance (e.g. 1.0 - 3.0 meters) to where the sensors are.

I'm looking at a few different types of water level sensors, and confused as to which would be best here:


Firstly, I'm not sure which of these would do best at these low water levels (e.g. 0mm up to 50mm).

Secondly, I'm not sure which of these will do best outdoors, exposed to the rain, UV, and possibly a bit of dirt?

Thirdly - although this may be surmountable - is the larger distances between the sensors and the waterproof control box.

The Grove sensor above looks pretty good - however, it's I2C - so I'm guessing I might hit some kind of distance limitations? I was thinking I could use the Qwiic Differential I2C boards to try to extend the distance? (But then I also need to figure out a way to waterproof those boards, and the both the JST-SH and RJ45 connectors, since it will all be outdoors).

Modbus (RS485) might be better for the distances - however, most of the Modbus sensors are quite expensive (e.g. > USD 100 per sensor), and seem more designed for every larger tanks full of petrol, oil, or other harsh chemicals (i.e. they're over-engineered for just water - and also I assume for very large volumes, and so may not do well at 30mm of water in a small plastic tub).

What do you guys think would be a good solution here?

Thanks,
Victor
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #1 on: September 02, 2024, 05:09:35 am »
If you only need to maintain a certain level range (which I assume is sufficient for your application), I would suggest the first solution with the float switch.
If you take two of them you can distinguish three levels: too low - OK - too high.
They surely would be the simplest and most reliable solution.
If you’re into DIY, you could experiment with a hydroponics water level indicator and photo interruptors…
« Last Edit: September 02, 2024, 05:16:33 am by inse »
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12792
  • Country: ch
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #2 on: September 02, 2024, 07:25:42 am »
You got most of the important measurement methods. The one major measurement method that you left out is pressure sensing, which is one of the most widely used. (You also didn’t mention ultrasonic and optical distance measurement, which are less common.)

When I was finishing up my electronics technician education, my class worked on a project about water level regulation, and I was in the group that did the level sensing. We ended up going with pressure sensing. If you use one with an analog output, you can have the sensor at a distance with no problem.

We tried the eTape, too, and while it’s actually really neat, it is delicate, and the top of the tape is not waterproof (water must not get into the opening at the top, but air needs to be able to move in and out). In a sense, they’re actually a really weird shaped pressure sensor.

But as inse said, if you only need binary sensing, a float or that dfrobot optical sensor would likely be easier. There are also pressure switches commonly used in household appliances, maybe one of those is for the 30mm depth you need.
 

Offline victorhooiTopic starter

  • Contributor
  • Posts: 44
  • Country: au
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #3 on: September 03, 2024, 04:52:09 am »
@inse - Got it, I can try with float switches. You're right in that I just need to make sure the water level isn't too low (i.e. binary output is fine).

Can I ask why you'd prefer float switches here? Are they just more reliable than the other methods?

Would a simple stainless steel float switch like this one work well?

https://atlas-scientific.com/float-switches/short-vertical-metal-float-switch/

(I'll still need to find a way to fix these to the corner of the container - not sure if waterproof duct tape would do it...lol. Maybe some kind of right-angle bracket?)

Also, if I'm going to be reading these from say the GPIO pins on a Raspberry Pi or Arduino - I've read I'm going to need some kind of protection, right? (e.g. here or here).

What sort of pull-up resistors would I need to add for the above float switch? And how would I handle the issue that the long leads act as an antenna?

I might have 2-3 meters between the waterproof box and the white tubs - and also, there's maybe 5-10 tubs:

2359475-0

@tooki - Ah, I didn't realise about pressure sensing. Do you think that might be worth trying here? If so, what sort of pressure *switch* would you suggest?

I think I already had optical sensors (DFRobot SEN0205), and I added a short link to the TI paper on ultrasonic sensing (but I don't know of any good recommended sensors here).

And thanks for the note about eTape - I thought it looked pretty nifty - however, I didn't realise about the top not being waterproof, but also needing airflow - so it might not be suitable for this sort of exposed/outdoor application.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #4 on: September 03, 2024, 05:16:12 am »
I would simply prefer the most simple solution - no over engineering.
Fix the level switch to the container with a right angle bracket, duct tape does not last long in sun light.
Using a 1k pull up should deliver a robust signal and two serial diodes to Vcc and GND protect against ESD.
Check first if the level switch meets your demands before going into series production.
« Last Edit: September 03, 2024, 05:23:49 am by inse »
 

Offline wobbly

  • Regular Contributor
  • *
  • Posts: 177
  • Country: gb
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #5 on: September 03, 2024, 07:23:45 am »
Just make sure the plants don't grow too close to the float switches and jam them in the wrong state.
 

Offline Irilia

  • Regular Contributor
  • *
  • Posts: 78
  • Country: de
    • My YouTube channel
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #6 on: September 03, 2024, 08:21:14 am »
This type is possibly the most simple for this application

Level Sensor, Non-contact Water Detection Sensor
https://a.aliexpress.com/_EyhCVjL
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #7 on: September 03, 2024, 11:45:34 am »
I had such a capacitive sensor fail when it got wet on the sensing side and would not turn off.
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3903
  • Country: nl
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #8 on: September 03, 2024, 03:12:26 pm »
Another option is to simply measure it's weight with a loadcell.

A float switch is also a simple option. This can either be combined with a timer, or the switch can have a fixed hysteresis.

There are also a bunch on:
https://hackaday.com/blog/?s=water+level+sensor

I like the latest, in which the arm of a float switch is used with an angle sensor. All electronics can be put in conformal coating or putty.

Also, if you ever go full automatic, then also consider what happens if a sensor, pump or a valve fails. At a minimum I would have two valves in the main water supply, or have an inherently limited amount of water such as from a rain water barrel. (You can top off such a barrel with water from another source of course).
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12792
  • Country: ch
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #9 on: September 03, 2024, 06:30:07 pm »
Would a simple stainless steel float switch like this one work well?

https://atlas-scientific.com/float-switches/short-vertical-metal-float-switch/

(I'll still need to find a way to fix these to the corner of the container - not sure if waterproof duct tape would do it...lol. Maybe some kind of right-angle bracket?)
Duct tape? LOL no. (There do exist tapes for outdoor use. But they're not to ghetto-rig things, and require clean surfaces that mate properly.)

You need a bracket, and understand that one half of the float switch shown has to be in a dry enclosure. You can't just have the wires floating in the wind!

This style of float switch needs to be perpendicular to the water, so the float moves only up and down along the shaft. Other kinds exist that move in different ways, like the angle-sensor based one mentioned above.





@tooki - Ah, I didn't realise about pressure sensing. Do you think that might be worth trying here? If so, what sort of pressure *switch* would you suggest?
As I said, pressure sensing is extremely widespread. (Your dishwasher and washing machine are practically guaranteed to contain one or more of them each.) In older appliances they mostly used on/off pressure switches, while newer ones use pressure sensors that let the microcontrollers control fill level dynamically.

Pressure sensors are very sensitive (in the good sense), and have the cool property that you can mount them a bit away from the water itself, with the sensing hose connecting the sensor to the water.

For water level sensing, IIRC you want a differential pressure sensor so that changes in ambient air pressure don't affect the measurement, so you just get the pressure increase caused by the water. (Basically, the water traps a column of air in the hose between the sensor and the water. As the water level rises, it compresses said column of air, increasing its pressure relative to ambient.) I don't have the part number at hand of the sensor I used, but I can dig it up if need be.


I don't have any specific recommendations for pressure switches since I've never actually used one in a project. You'd want one intended as a replacement part for a washing machine; industrial pressure sensors are quite expensive.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #10 on: September 03, 2024, 07:07:30 pm »
The type mentioned seems to be completely sealed at the electrical side and as it’s only operated at 3.3/5V the wires surely can be left dangling around.
Heat shrink tubing provides more than sufficient isolation for the extension wires.
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12792
  • Country: ch
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #11 on: September 03, 2024, 07:16:50 pm »
The type mentioned seems to be completely sealed at the electrical side and as it’s only operated at 3.3/5V the wires surely can be left dangling around.
Heat shrink tubing provides more than sufficient isolation for the extension wires.
I wouldn't want to rely on the insulation (especially the woven kind, even if it is impregnated) for long-term outdoor use.
 

Offline Irilia

  • Regular Contributor
  • *
  • Posts: 78
  • Country: de
    • My YouTube channel
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #12 on: September 04, 2024, 12:09:19 am »
I had such a capacitive sensor fail when it got wet on the sensing side and would not turn off.

Never had this experience. you can modify the sensitivity, but otherwise I'm really surprised they didn't work as expected.
« Last Edit: September 04, 2024, 06:01:32 am by Irilia »
 

Offline Poroit

  • Regular Contributor
  • *
  • Posts: 103
  • Country: au
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7524
  • Country: ca
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #14 on: September 04, 2024, 04:47:48 am »
I think plant leaves and roots will find their way to any sensor used inside the tub. That makes floats/electrodes etc. a poor solution  :-//

Outside the tub, capacitance sensors can work, but they also like to fall off. Ikea containers are usually recycled PET and I'm not sure what glue works good for that. Falling off will cause catastrophe with overfill, use a timeout for filling max. xx seconds. You can also look at home aquarium water level sensors.

Popular are the XKC Technology sensors offered on Aliexpress/Amazon etc.
XKC-Y25 is cheap and the manual has some ideas for mounting. Limitation I think is the sensor is 28mm dia. so minimum liquid level sensed would be around that but not sure.
 

Offline Irilia

  • Regular Contributor
  • *
  • Posts: 78
  • Country: de
    • My YouTube channel
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #15 on: September 04, 2024, 06:09:45 am »
I think plant leaves and roots will find their way to any sensor used inside the tub. That makes floats/electrodes etc. a poor solution  :-//

Outside the tub, capacitance sensors can work, but they also like to fall off. Ikea containers are usually recycled PET and I'm not sure what glue works good for that. Falling off will cause catastrophe with overfill, use a timeout for filling max. xx seconds. You can also look at home aquarium water level sensors.

Thanks to confirm what I was thinking, sensor don't go together, ultrasound sensors could work but the space is very limited for this type of sensor.
A simple Timer is probably the safest, if you have a constant flow. I recommend to have an or something to track the water level and averting you if the level of the water become to low.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #16 on: September 04, 2024, 08:01:08 am »
It’s all not maintenance free, I guess.
If the plant gets too close the capacitive sensor, it will be disabled as well.
 

Offline eutectique

  • Frequent Contributor
  • **
  • Posts: 453
  • Country: be
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #17 on: September 04, 2024, 12:36:41 pm »
Drill a hole or two in the wall of the tub at the desired water level. Every 2-3 days feed the tub with water for 10-30 seconds. The excess will be discharged through the hole.

Improvement:
  -- Run a pipe from the discharge orifice into the next tub positioned 20 mm below the first one.
  -- Scale.

Further improvements:
  -- Build a weather station which will regulate the frequency and duration of water supply based on temperature and humidity.
  -- Create a web page, publish the graphs and a live video.
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #18 on: September 04, 2024, 02:31:17 pm »
Actually a brilliant idea to connect all containers in daisy chain with a hose entering and exiting at the desired water level. The containers would not need to be stacked, same level or lower is possible.
And the excess water is collected in a pot and there the level is sensed and controls the fresh water inlet.
Pot to be drained at regular intervals or pumped to the first container.
« Last Edit: September 04, 2024, 02:33:26 pm by inse »
 

Offline Randy222

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: ca
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #19 on: September 04, 2024, 04:50:19 pm »
Plants and bugs almost always clog mechanical means.

If you did something like a probe (two wires close to each other, float, etc), water contact could be indicated using logic in the MC. The probe should be put in a perforated tube and then tube wrapped with some type of fine mesh to keep bugs and plant out.
Moving parts like floats will eventually fail.

Is too much water in the bucket also a bad thing?
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12409
  • Country: us
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #20 on: September 04, 2024, 05:13:28 pm »
A long time ago, water level sensors might have used stainless steel rods of various lengths dipping below the water surface. When a rod pokes below the water line, conductivity between rods indicates the presence of water. A very similar principle is used in soil moisture sensors for house plants. In fact, a soil moisture sensor might possibly be repurposed for this task.
 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12792
  • Country: ch
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #21 on: September 04, 2024, 05:21:32 pm »
A long time ago, water level sensors might have used stainless steel rods of various lengths dipping below the water surface. When a rod pokes below the water line, conductivity between rods indicates the presence of water. A very similar principle is used in soil moisture sensors for house plants. In fact, a soil moisture sensor might possibly be repurposed for this task.
As long as it's one that is properly designed and uses AC. The cheap ones that use DC don't survive very long.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7524
  • Country: ca
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #22 on: September 04, 2024, 08:21:45 pm »
Ikea's plant watering alarm Chilipulver used two SS electrodes, one on each side of a thin tube. It's battery operated and not relevant for OP but the format - a thin pen with electrodes on the side looks good - if inside a larger tube (well) which prevents plants from touching.
(I bought one but it did not work - bad firmware it never alerted to dry soil and the plant almost died. It's shit and discontinued now I wonder why lol. It had a boost-converter and ARM MCU).

Connecting all plant containers with a daisy chain tubing, I found a bad idea as small insects could traverse between them and spread. Spidermite everywhere.
That starts to look like hydroponics?
 

Offline victorhooiTopic starter

  • Contributor
  • Posts: 44
  • Country: au
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #23 on: September 06, 2024, 03:51:47 am »
Thanks everybody for the suggestions/ideas - I've tried to answer them all, and added some follow-up questions. When I figure this out, I'll make sure to update with photos of the setup, and let you know if it works...

My main concern actually is if I use the float sensor, I'm a bit worried about frying the MCU - @inse mentioned a 1K ohm resistor - and using two diodes - does it matter what type? and where would you put them? I'm going to look at the other approaches as well.

@floobydust
Quote
I think plant leaves and roots will find their way to any sensor used inside the tub. That makes floats/electrodes etc. a poor solution  :-//

The plants are actually in individual pots usually  :) - so the white tubs just have water, with some dirt that might have leaked/fallen out.

2362637-0

Some plants do get a bit bushy (which is a good thing! As in, I love plants, and I want them to grow well, haha), but it shouldn't get *too* overgrown*. Do you think that's still an issue?

@ Irilia
Quote
A simple Timer is probably the safest, if you have a constant flow. I recommend to have an or something to track the water level and averting you if the level of the water become to low.

Unfortunately, all of these tubs are outside (since carnivorous plants need *lots* of sunlight - and also, they plants generally do much better outdoors. Many of them originate from bog conditions in the US Pacific Northwest).

Hence, I get a lot of water loss via evaporation (although that evaporation loss is also what boosts the humidity around the plants, which is what they crave), but then also some top-up through rainfall. Hence why I wanted a sensor on the tubs, so I know when they're empty, and so I can link it up to a drip irrigation system.

@inse
Quote
Actually a brilliant idea to connect all containers in daisy chain with a hose entering and exiting at the desired water level. The containers would not need to be stacked, same level or lower is possible.

That's a clever idea - however, I have a *lot* (> 20) of tubs ;D, and I think it would be also very difficult to get them all in some decreasing height or have it all flow neatly like that.

2362641-1

@Randy222
Quote
Plants and bugs almost always clog mechanical means.
As mentioned above - the plants themeslves are in black pots, which are then sitting in water in the white trays.

However, there's obviously dirt etc, which can and does get in the water.

For say, a stainless steel float sensor (e.g. PLS-045A-3VAI that one - how sensitive is this to dust/dirt or clogging up?)

@Randy222
Quote
Is too much water in the bucket also a bad thing?
Yup, it is unfortunately. If the water level is too high, it causes root rots for the plants. The idea with carnivorous plants is that you sit them in water, and the media wicks up water via capillary action so that the growing media is wet but not waterlogged. Hence why I try to keep say 2-5cm of water in all of my trays. But obviously with outdoor weather in Australia, it means they can dry out in a few hours (on a sunny day), or may overflow (with the rains etc.).

@ IanB
Quote
A long time ago, water level sensors might have used stainless steel rods of various lengths dipping below the water surface. When a rod pokes below the water line, conductivity between rods indicates the presence of water. A very similar principle is used in soil moisture sensors for house plants. In fact, a soil moisture sensor might possibly be repurposed for this task.
I did actually think about using those wireless water leak detectors - apparently you can attach wires directly to the electrodes on them, and then dangle those wires into a container. Then you would flip the alert around so instead of detecting a water leak, it would detect the absence of a water leak (i.e. to indicate the container is dry).

https://www.reddit.com/r/homeassistant/comments/zwouod/could_you_submerge_a_leak_sensor_and_use_it_as_a/
https://www.reddit.com/r/Aqara/comments/13f1ych/know_if_water_tank_full_with_leak_sensor/
https://www.reddit.com/r/homeassistant/comments/vxf6t1/low_water_level_detection/
https://www.reddit.com/r/HomeKit/comments/ibogq3/aqara_water_leak_sensor/
https://www.reddit.com/r/HomeKit/comments/iaei09/water_sensor_and_then_ifttt/

However, I was a bit concerned that this would drain the battery on those sensors quickly (since they're designed to detect water leaks, and likely assume those are rarer), and also, it only detects when completely dry - whereas I ideally want to top up the water wel before it gets to that point - as by that point, the plants are already suffering).

The soil sensor idea is interesting - however, I don't know how well they'd do with constant submersion in water....

In fact, most of the soil sensors out there tend to fail after 6-12 months, I assume due to corrosion - apparently the salts etc in soils mixed with water are very bad for electronics.

Also, I water with RO (reverse osmosis) water, so this is what will be in the tubs. I've heard this can be incredibly corrosive to metals - but perhaps stainless steel should be ok?
 

Offline Irilia

  • Regular Contributor
  • *
  • Posts: 78
  • Country: de
    • My YouTube channel
Re: Water Level Sensing for outdoor plastic water tubs?
« Reply #24 on: September 06, 2024, 04:08:59 am »
You can use 2 or more temperature sensor, with one above the water on one below the water you just have to use the difference to know if the third or more sensor is above or below the water. Will not Block and you can very easily know if something is wrong
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf