Water management in a rainwater well-coupled system: monitoring potable water quality

@monkey-house I’m sure you will be able to design something that works for that tank. Maybe you could post again with your solution?

1 Like

Here is what a few minutes of designing yielded. Idea is to cutout a piece of plywood then put this on top with bolts and nuts. Angle of the sides is 50.5 degrees and should not interfere with the sensor readings. Height from the sensor to the water when tank full will be roughly 23cm.
Will 3d print this and share the stl if worthwhile!

2 Likes

Love your work!

What if you include a base (in your 3D design) to mount your sensor enclosure as well?

Was thinking of just wiring it through the top. Glueing it or something like that. Could put a housing at the top to protect it from rough weather, but I thought the fact that they are waterproof would annihilate such need…
A screw on top housing with a hole for the cable would be an easy iteration…

oh…I was thinking of the housing for the PCB and power supply as well?

Nope, I’ll have the PCB in a different housing. Running on a ESP32 also used as a bluetooth beacon and bluetooth gateway for Miflora sensors nearby. May add air quality and BME680 sensors as well as this is a good spot for these.
Anyway, gonna start the 3d print on this. Will post back eventually!

1 Like

I would be keen to have a look at that completed project…sounds cool!

That’s pretty much everything except the housing, the BME680 (backorder) and the SDS sensor… You gotta love ESPHome!

1 Like

I tried setting up the two JSN-SR04T I talked about above on one (tasmotised) Wemos D1 mini and a second try using a Sonoff basic but found I couldn’t setup two identical sensors on the same device.

Any idea if that can be done using ESPHOME + ESP32 Device?

Can’t do it on Sonoff. Not enough GPIOs. Not sure about Wermos. Quite positive about ESP32 as the hardware allows this.=. I’ll try that for you tonight and get back here…

1 Like

@wellsy you’re good to go dude. As I thought, you can have more than one ultrasonic sensor on an ESP32. Theoretically, you could have a dozen… Am using a NodeMCU32s FYI. I don’t think I ever want to touch a Sonoff, Wemos or any ESP82xx by now. Well, I may as stock of Sonoff relay is plentiful…
Here is the code just for the sensors:

  - platform: ultrasonic
    trigger_pin: GPIO13
    echo_pin: GPIO12
    update_interval: 3s
    name: "Ultrasonic Sensor"
  - platform: ultrasonic
    trigger_pin: GPIO27
    echo_pin: GPIO14
    update_interval: 3s
    name: "Ultrasonic Sensor 2"`


Quite interesting to see how different the ultrasonic sensors are. Same pins and components, but different PCB layouts. The second one does not keep the LED on permanently making it a much better candidate for solar powered sensing stations…

Had a look at your posts on these forums. Definitely have some common interest going, ie. pond + farming. May need to pick your brains in the future. In the meantime, you got me going again on the water management at home so cheers!

1 Like

@monkey-house Wow…thanks for going to that much trouble! I have to ask though why do you think there is so much dislike in the community for Sonoff devices? My own experience with them has been nothing but positive?

I have only used the ‘JSN’ branded ultrasonics so far…they perform very well for me. How do you find the other ones are going? The two (sonoffs) I have connected to those JSN sensors I have running on 5 volts and they are very solid so far?

Anytime you want to compare notes please do!

@monkey-house I wanted to show you how I handled the ultrasonic sensor housing using the two sonoffs running on 5V.

Please note this is still at what I would call prototype stage.
The box was selected based on my intention to use a single Wemos D1 mini which would have resulted in a far more spacious arrangement. Unfortunately I couldn’t figure out out how to get the Tasmotised Wemos to work with two ultrasonics onboard…seems to be a limitation of the Tasmota system?

However this arrangement fits and for the combined cost of around $50 for everything you can see including the box I’m happy enough with the result.

My intention is to strip the sonoffs out of their boxes and reconfigure them on a PCB to shrink the footprint considerably. I may post that as a complete post at some point.

Wow, that’s neat. Wish I had such electrical skills. I can’t see any voltage down-step. Are you supplying 5V to the box?

My take is if it ain’t broke don’t fix it. I would recommend using ESP32’s for new projects. Reason for that is just the number of options that gives straight out of the box: 2xUART buses, tons of ADCs, 5V + 3.3V, configurable GPIOs, tons of memory. This is such a flexible platform at a good price.

Sonoff are not liked by the community as Itead has made it so much more difficult to flash. My personal experience is that they can be quite flimsy and stop working even after you manage to flash them. I had a bunch of Sonoff POW, TH and Basic stop working due to over-voltage in my electrics… This was caused by poor installers’ skills working on my solar panels. These guys managed to burn a fridge’s PCB, but all my other electronics apart from Sonoff survived.

I’ll still use the Sonoff I got laying around. Got one ready for my sliding gate motor flashed with ESPHome… Will also use an old POW for my swimming pool pump with Tasmota (like the today and yesterday sensors out of the box) as it’s now just relying on an old school timer. Generally Sonoff are nice when you just need a compact relay and that’s it! Am unlikely to buy any more of these.

1 Like

Got the 3d print finished, ready for install. I messed up the size of the opening to let the cable through, but will file that. The bottom of the sensor will sit 12cm above its support. Add 2cm plywood and 7cm concrete on top of the water tank and I should be able to get readings almost all the way to a full tank. First automation will be to turn pump off when the sensor reads 23cm… Second one to notify when tanks is getting low at 100cm. Third to fill the tank when reaching 120cm. Hopefully that will save my booster pump and water heater from running dry.

Can’t share the stl here due to this site’s limitations, but anyone can PM in case it’s needed. I corrected the size of the hole to allow the cable through without filing. This can also be scaled up, if a higher sensor works better. I recommend using PETG as for all outdoor projects. No support is needed and a 10% infill is strong enough. I printed this with a PRUSA Mk3s using Pretty PETG profile.

1 Like

My observation here is that I would be very reluctant to rely on a reading from these sensors to stop a pump when it reads 23cm. Normally these are used as indicators…not so much for actual level control. For control you most often see a float switch or pressure switch used as these are more reliably on or off at the required level you want to stop the pump.

Maybe if you specify a range of lets say ±3cm from your target but even then these are prone to flicking up and down quite a bit…but its your call I reckon.

5VDC+ on the white wire and GND on the Black which is supplied from within a control board about 2m away.

Yup, it seems to be this way indeed:

[QUOTE]I’m looking for alternative ways to do the same, such as using pressure to measure water volume or even simple contact sensors rather than ultrasound.[/QUOTE

1 Like

try one, two or three of these…(quick search yielded this https://www.mrappliance.com.au/1528189-02-8-water-level-switch-westinghouse-dishwasher) Dishwasher water level switch

And then connect to something like this (your tubing length set for heights you want)

100% accurate everytime to around 1 cm resolution and I just set them up as binary sensors (a switch in tasmota) in HA

Yup, exactly what I had in mind… Could even make one up myself. Just need 2 really: empty and full, then rely on the ultrasonic sensor for more precise level sensing…
Or go with a 5V pressure transducer: https://www.aliexpress.com/item/32670894714.html?spm=a2g0o.productlist.0.0.8bb3119f7wxiUa&algo_pvid=59321ff6-439f-498e-b3c2-dc02c1d5cf98&algo_expid=59321ff6-439f-498e-b3c2-dc02c1d5cf98-31&btsid=24449d38-62f4-4a92-844d-07eb7c64644c&ws_ab_test=searchweb0_0,searchweb201602_7,searchweb201603_52