Page 1 of 1

Water tank level monitoring. Skill level required?

Posted: Mon Mar 23, 2020 12:23 pm
by Gingerbread Man
Hi all.

I live on a rural property in Australia that utilises water tanks to provide the house water. I'm intrigued by automation and data, and being a plumber by trade, the plumbing naturally takes my interest. I wanted a way to monitor the water tank levels (we have two identical tanks, possibly a third in the future, but they're all connected together so I can just double or multiply the contents of one tank by what I have.
A while back I bought an off the shell solution (something like this - https://www.mydeal.com.au/new-ultrasoni ... JUQAvD_BwE) and it turned out to be a dud and never really worked. Anyhow, the idea of a monitor and display or an app/ webpage seems like what I'm after. Saves me going out and climbing a ladder to peer down into the water tanks!

Is the Raspberry Pi the solution for me? I've never used one or even laid my hands on one but Googling around suggests that it could be. There seem to be a few tutorials around for other projects, not all using the Pi mind.

Ideally:
Powered by a long lasting battery or best solution - solar powered for a hands off, maintenance free life. It'll be on top of a tank so in the sun, but a pain, although not impossible to get to.

The tanks are only a stones throw from the house, so should be able to use the house Wifi to broadcast.

Nice to be able to have a webpage/ app or similar that can be loaded up and display a % of how much water I have in the tank.

I do have another tank down in the garden (~50m from the house) which is soon to be plumbed in and used to feed animal troughs/ garden beds. Not sure if that would be too far away, but if I could replicate what I end up with on the household tanks down there and then to show up as a seperate tank. That would be spot on.

Am I wanting too much or could a novice like me set something up without too much hassle? I have tried to find an off the shelf solution, but they easily jump from cheap and analog to extensive commercial farming systems that are many hundreds of dollars!

Thoughts? Thanks all.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Mar 23, 2020 1:18 pm
by PhatFil
The off the shelf solution you looked at uses the sort of approach that imho you should perhaps consider too
https://pimylifeup.com/raspberry-pi-distance-sensor/
should illustrate the point.

I also think an 'is empty' alarm could be usefull and for that i like these sensors as theyhave NO MOVING PARTS unlike the usual float switch..

https://www.ebay.co.uk/i/283696056246?c ... 9wQAvD_BwE

Re: Water tank level monitoring. Skill level required?

Posted: Mon Mar 23, 2020 1:25 pm
by LTolledo
If it were me, I'd use "old school" OMRON 61F-IN floatless level sensor with the Raspberry Pi 3 Model B.
the sensor will give me (depending on the setting of the sensors in the tank) low level, intermediate level and high level,
as well as alarm on high and low level.
and display the status on a small monitor (programmed via python).

as the outputs of the sensor are "dry contacts" it can be coupled to the RPi just like normal switches.

I may need to run some long wires from the level sensor rods (located at the top of the tank) to the lever sensor controller.
it does work even on "hard water"

Re: Water tank level monitoring. Skill level required?

Posted: Mon Mar 23, 2020 1:49 pm
by jbudd
I suggest an ESP8266 microcontroller at the tank to take sensor readings and transmit them by MQTT to a Raspberry Pi in the house.

The Pi runs an MQTT broker (Mosquitto) and Node-Red to collate and display the results on a web page.

Node-Red has a drag and drop web based interface making it very easy to add in more sensors or send an email if the water reaches a particular level etc.

Re: Water tank level monitoring. Skill level required?

Posted: Sat Mar 28, 2020 11:01 pm
by Gingerbread Man
Right thanks for the replies folks. I have just had a look at the links. Apologies for the delay, mad times at the moment.

Mostly went over my head hahah. Where do I start to get a grapple on all of this? Happy to buy a set of components and join them together, but guess I'll also need some programming?

Re: Water tank level monitoring. Skill level required?

Posted: Sun Mar 29, 2020 1:14 am
by jbudd
There is an example using Node-Red at https://developer.ibm.com/recipes/tutor ... ng-system/
That has an ultrasonic sensor connected directly to the Pi and it says "Almost no coding required"

If you were to connect the sensor to an ESP rather than directly to the Pi you would have to program the ESP to send readings to the Pi, possibly using the Arduino IDE. I'm sure you can find a recipe online for this. You would have to install Mosquitto on the Pi too, and adjust the Node-Red flow to get it's input data from MQTT.

Re: Water tank level monitoring. Skill level required?

Posted: Sun Mar 29, 2020 3:57 am
by wh7qq
Many years ago, I ran a hemodialysis center that had a 1K gal. storage tank for pure water from an RO machine that ran all night. It used a set of reed relays inside a sealed long poly tube, activated by a donut shaped magnet that rode on the outside of the poly tube with a float. An RPi could easily do that, with the reeds just working GPIO inputs. This system had to work 24/7/365 and it did.

The RPi could be in a weather proof box on the side of the tank rather than on top. Easy to access. It could also be done with an Arduino with WiFi or a Nodemcu. The computer would be an elaboration. It would be easy to do with simple lights or LEDs connected to the reed switches and zero programming.

Re: Water tank level monitoring. Skill level required?

Posted: Sun Mar 29, 2020 7:06 am
by Gingerbread Man
jbudd wrote:
Sun Mar 29, 2020 1:14 am
There is an example using Node-Red at https://developer.ibm.com/recipes/tutor ... ng-system/
That has an ultrasonic sensor connected directly to the Pi and it says "Almost no coding required"

If you were to connect the sensor to an ESP rather than directly to the Pi you would have to program the ESP to send readings to the Pi, possibly using the Arduino IDE. I'm sure you can find a recipe online for this. You would have to install Mosquitto on the Pi too, and adjust the Node-Red flow to get it's input data from MQTT.
That looks pretty easy. Nice run through, thanks for that. Are there many different Pi's?

Right so I think the Raspberry Pi Zero will serve my needs. Wifi and small form. I think the others look over powered for my needs? Thoughts?

Re: Water tank level monitoring. Skill level required?

Posted: Sun Mar 29, 2020 1:31 pm
by JohnsUPS
wh7qq wrote:
Sun Mar 29, 2020 3:57 am
Many years ago, I ran a hemodialysis center that had a 1K gal. storage tank for pure water from an RO machine that ran all night. It used a set of reed relays inside a sealed long poly tube, activated by a donut shaped magnet that rode on the outside of the poly tube with a float. An RPi could easily do that, with the reeds just working GPIO inputs. This system had to work 24/7/365 and it did.
If I were to monitor a water tank and didn't need a really precise readout, this (above) would be how I would do it.
Obviously the more reed relays in the row along the inside of the poly tube, the more granular the output would be.
I have always been a fan of elegant simplicity as long as it will do the job.

Re: Water tank level monitoring. Skill level required?

Posted: Sun Jun 28, 2020 5:14 pm
by palillo
Hi,

We developed a solution for water tank monitoring using Rasbperry Pi around 3 years ago in Venezuela where we have lots of problems with water supply.

We can help you by either selling the solution or helping you build your own if needed.

We use regular ultrasonic sensor (water resistant) JSN-SR04T you can find on Amazon for around 8 USD.

For example:

https://www.amazon.com/gp/product/B07X5 ... UTF8&psc=1

Our system, TankMon can:

- Manage multiple sensors.
- Manage alarms for configured water level.
- Has a web interface.
- Can be integrated with Alexa skill (currently in testing/final development)
- Can automate turning pumps/electro valves/etc using relays with time schedule for week days.
- Has graphical reports for the last 24 hours, 3 days, 7 days, 15 days and 1 month worth of data.
- Has a cloud option to push data to a mirror system on the cloud so if you do not have a public IP (you can't access the system over the internet directly) you can always control access water tank levels from the internet.
- The system has a WiFi access point so you can connect directly to the Pi via WiFi and access the web interface.
- The systema comes with a 3.5" LCD touch screen display for in place checking of water tank level.
- We support some basic REST/JSON web APIs to have third party systems integrate (For example Alexa uses this webservices).

We are always improving the solution.

If anyone is interested in learning more about TankMon solution or if you wanto to build your own, I will be more than happy to help.

Best regards,
Andres Maduro.!

Re: Water tank level monitoring. Skill level required?

Posted: Fri Jul 03, 2020 8:16 pm
by dolliff
I'm interested in what you created. I would like to see the code you used to make it work.

Re: Water tank level monitoring. Skill level required?

Posted: Thu Dec 17, 2020 12:22 am
by ohshaughnessy
palillo wrote:
Sun Jun 28, 2020 5:14 pm
Hi,

We developed a solution for water tank monitoring using Rasbperry Pi around 3 years ago in Venezuela where we have lots of problems with water supply.

We can help you by either selling the solution or helping you build your own if needed.
...
If anyone is interested in learning more about TankMon solution or if you wanto to build your own, I will be more than happy to help.

Best regards,
Andres Maduro.!
@palillo, I’d be interested in seeing what you have available. I live in a rural area of the US, and I have a few locations where monitoring the water level like that would really help. Could you reply here or DM me?

Re: Water tank level monitoring. Skill level required?

Posted: Thu Dec 17, 2020 1:13 pm
by davidcoton
ohshaughnessy wrote:
Thu Dec 17, 2020 12:22 am
@palillo, I’d be interested in seeing what you have available. .... Could you reply here or DM me?
  1. palillo has not visited this forum since the day of his/her one and only post.
  2. DMs are disabled on this site.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Dec 21, 2020 6:04 am
by ohshaughnessy
davidcoton wrote:
Thu Dec 17, 2020 1:13 pm
ohshaughnessy wrote:
Thu Dec 17, 2020 12:22 am
@palillo, I’d be interested in seeing what you have available. .... Could you reply here or DM me?
  1. palillo has not visited this forum since the day of his/her one and only post.
  2. DMs are disabled on this site.
Well, rats. Thanks, David. Appreciate the thoughtful response. I was hoping to find a solution for monitoring a well cistern that doesn’t tempt me to learn yet another ecosystem. I will continue the quest.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Dec 21, 2020 9:58 am
by vinnieb
There's nothing too specialised in what they mentioned though, you could probably replicate something yourself pretty easily?
Home Assistant sounds like it could do most of the functionality there, either hosted on a pi yourself or a cloud setup.
It's got alot easier to use over the years, and is practically plug and play with alot of stuff now.
I'm using the sensor mentioned, JSN-SR04T, to monitor my cold water tank. You might just want to check min+max distances to check would work with your well.
Mines connected to a Pi for convenience as I've got a bunch of other sensors there, and publishes over MQTT to home assistant. An ESP board might make more sense for your application, in low power mode and publishing less frequently.

But in a nutshell, something like home assistant will give you all the graphs, automation, etc out of the box, and you can build it out as your pace lets you, and then adding in remote sensors over MQTT is pretty straightforward, and remote actuators if you wanted to go down that road. If you want to do more complex automation logic at some point, it interacts nicely with node-red as well.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Dec 21, 2020 11:04 am
by JumpZero
Hi,
I'm currently adding a water level sensor to my existing swimming pool water temperature monitoring system based on esp8266.
I went on a different route I use a capacitive sensor (home build). My initial guide was this youtube video:
https://www.youtube.com/watch?v=Z-1X4IoChiY
I built my own pcb based on 555.
It wasn't possible for me to use the JSN-SR04T because I need shorter distance than 20cm.
The esp8266 is programmed in MicroPython and send mqqt messages to a mosquitto broker (a Raspberry Pi 2)
If one can use JSN-SR04T it may be easier.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Dec 21, 2020 1:08 pm
by Rudolf
You can do water level measurement on all levels of expertise. Simplest version I use for school experiments is just a piece of rod from a metal hanger of a professional laundry, a ping pong ball and a potentiometer hooked to a Pi. The ball floats, the rod connects to the potentiometer, which is measured by the Pi. Im many cases this is just enough, does the job and also works at rural Australia or in the middle of Africa.

Yes, you can do highly sophisticated stuff, complex and complicated - but, try to think your way along what I learned at NASA: always do the easiest approach and be creative to use limited resources only.

Re: Water tank level monitoring. Skill level required?

Posted: Mon Dec 21, 2020 1:18 pm
by cleverca22
https://youtu.be/41QMaJqxqIo?t=122

was watching this a few weeks ago
the gasoline tank levels are basically measured by having a tape measure tied to a heavy float
and there would also be something like a potentiometer on the dial for the tape measure, to also give a digital readout

Re: Water tank level monitoring. Skill level required?

Posted: Tue Jan 05, 2021 5:44 pm
by walterqq
For a no climbing solution, I think you could tap into the water supply line on the ground or in a building and use a pressure sensor. The sensor would have to have enough resolution to give a useful range between full and empty. For a tank that is 4 feet high and 20 feet off the ground for instance the pressure should range between 10.56 psi full, 8.8 psi empty, and 0 psi when the supply line is also empty. Use a differential or gage sensor (that reports a difference from ambient), not an absolute sensor to avoid recalibrating every time the barometer changes.

This assumes gravity is providing the water pressure to wherever the sensor would be located. It would have to be upstream from any pump and pressure tank. Also there will be some noise in the reading when water is turned on and off or being refilled. The sensor will have to survive the max pressure when the tank is being filled.

A raspberry pi is well suited to this kind of problem. It can read a sensor easily and using Node-RED provide a web based dashboard that you could check with your phone. You could also attach a touch screen to the pi (if it is in a building) and show the dashboard there.

If you end up powering it with dedicated solar, try to stick with the Pi 0-W. It has much less power draw than say a Pi 3 or Pi 4.

As to if you can do this yourself or not, it depends on your interests. If the wifi at your place is acting strangely, do you go check it and work out what is wrong or do you curse computers and get someone else to look at it? If you don't hate configuring things like wifi then you can tackle this project.

Re: Water tank level monitoring. Skill level required?

Posted: Wed Jan 06, 2021 1:40 am
by wh7qq
JohnsUPS wrote:
Sun Mar 29, 2020 1:31 pm
If I were to monitor a water tank and didn't need a really precise readout, this (above) would be how I would do it.
Obviously the more reed relays in the row along the inside of the poly tube, the more granular the output would be.
I have always been a fan of elegant simplicity as long as it will do the job.
The first thing this says is to decide the minimum that you really need in terms of information and then determine the simplest way to get it back to your house. An esp8266 based NodeMCU is the smallest, simplest and cheapest answer to getting information back to the house as it has a built-in wifi and GPIO pins that can receive the data. Solutions abound on the web as far as the required software is concerned that include web interfaces that can be your "readout" and even trigger an alarm at a critical level. A RPi zero W would work just as well but the nodeMCU will always restart the program in the event of a power failure. Boot failure is not a factor either.

Several years ago I wanted to replace the noisy analog clock timer that couldn't reset its time after a power failure (frequent where I live) and initially thought of convoluted, software based ways to accomplish that simple task. Ultimately, I wound up with a RPi zero W, and the included "Cron" software on the RPi driving a solid state relay which switched the unit off and on. It required nearly NO programming and minimal wiring. It needs no battery backup as it automatically resets its time when the modem and router bring the network back on line and the system can't work without AC power anyhow. Simplest is best. This system remains in 24/7 service and requires little or no maintenance. If I really want to monitor it, a GPIO read command is all that is required to check the status.