Water Tank Level Sensor

Updated 10 February 2023

Update:

Community member Chris has had a go at remaking this project after the original project contributor Denver made the original code repository private. GitHub links below will not work but the original project has been kept here for reference.


Imagine getting home from work, its winter, its cold. You have a shower to warm up and half way through your shower...... your water stops. You wrap a towel around yourself, remove the shampoo from your eyes and go out into the cold to swap the tanks as the water tank you were using had run dry. This was a common occurrence in my house......... but not anymore. Now I can keep visually see the level of water in my water tanks on my iPad and receive an email when the tank level gets low.

Why would I go to this much effort when you can buy off the shelf wireless tank level sensors from Bunnings for $85. The issue is they only do one tank. I would have to buy 3 kits and have 3 individual monitors mounted on the wall. They all require batteries to be replaced every 6 months, I can only see the data at one place in the house and they still won't stop me from running out of water as I would still have to check them every day. So..... I built my own.

Parts list

Tools

  • Hot Glue gun
  • Soldering Iron
  • Battery Drill with spade bit
  • Safety gear
  • Ladder (for getting to those high places)

Processor

So many to choose from. Where to start? I wanted easy to use for my first project and something I can convert into a games console if the project didn't work (obviously no confidence in my own ability). So, I went for the Raspberry Pi 3.

Sensors

The first issue.... which sensor should I use. I looked at 2 different types. Ultrasonic vs pressure sensor. I deemed the pressure sensor inadequate due to it using an analogue signal (4-20ma) and that seemed a little complicated for my first project. There were two types of ultrasonic sensors I looked into. The HC-SR04 wasn't waterproof but the JSN-SR04T was. I was reading online that the sensor would give false readings when not installed in a tube. When the prototype was made I spent 2 weeks trialing different diameter and length tubes........ to find out that I didn't even need one. Lessons 1: too much planning not enough testing. The sensor had a lot of code already written online which made prototyping easy.

Testing Prototype

Completed sensor prototype

https://github.com/Denverado/Level_Sensor

Power and router

The second and third issue.... connection to router and power. The location of the rpi3 was to be at the far end of the house. There is no wifi, Ethernet or power at the install point. I was trying to tackle these issues separately until one day staring at my work phone, I had inspiration. POE!! Connectivity to the home network and power, all wrapped up in one easy to install bundle. Yay!!! After researching the topic I decided on the TP-LINK TL-POE200 Power over Ethernet Adapter Kit. The kit allows for 5-volt output built in and enough amps to run the RPi. Only an adapter is required to get it from the barrel fitting to micro USB. I add a power button that had an LED incorporated into it. The LED flashes when not connected to the network, is on when connected and off when the pi is off.

https://github.com/Denverado/Power_Restart_Button

https://github.com/Denverado/Network_LED

GUI

The fourth problem.... how do I display the data. A GUI. I had to make a GUI so simple my wife could operate it. I used VNC to link into the RPi and the GUI starts on the RPi startup. All that has to be done is oven VNC viewer on the iPad and the up to date water levels is displayed. A just had to write a simple code to get an email when the tank is low and when it was full. Easy as!

https://github.com/Denverado/Water_Tank_GUI

Mounting the Components

The final problem was how to mount the project. A hot glue gun and some M2.5 standoffs were my friends. A weatherproof container, help from my wife and dad to run CAT 6 cables, a couple of drills and presto!!! A water tank sensor. I showed my neighbor and he wants a tank sensor too.

Final Install

Where to from here?

Now I have a taste for coding and this small project work, I want to do more...... I have another tank that needs a level sensor added, maybe with a temp and humidity sensor on it too. I could add some valving on the tanks so they automatically change when they get low. The flow meter on the dual house pumps that switch over when one fails and measure how much water we use would be perfect.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.