Core Electronics Forum

Project by Denver42165; Water Tank Level Sensor

Denver42165 just shared a new project: "Water Tank Level Sensor"

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.

Read more


Great project Denver! Practical projects are always the most satisfying to build.

Awesome project! Just wondering whether it would be possible to use the Raspberry Pi Zero W - provided there is wifi access to the tank, and how reliable “reconnecting” etc. would be. Had any look at that anytime? It would shave a few dollars off the project cost… though reckon wired ethernet would be probably more reliable… ??

I’m sure Denver will be able to provide better insight, but using a WiFi connection shouldn’t be an issue at all. Provided it’s in range, it has built in handling to ensure that data is sent and received correctly.

1 Like

It can absolutely be run from a RPi zero W. I tested it on a zero as well. I only used the RPi 3 and the Ethernet as I didn’t have power at the site where it was to be installed, so I used POE to get power there. I am about to build another one that runs on an onion from battery and solar. That one will be wifi only.


Are you getting much inaccuracy due to the temp and humidity inside the tank?

@Andrew54467, I am lately getting fluctuations in readings. The existing program uses a single reading to get the level. i am going to modify the program in the coming weeks to take an average or mean of 5 readings to get better accuracy. I will let you know what i come up with.


A post was split to a new topic: Water tank project

The averaging program seemed to of done the trick. I used the mean of multiple depths instead of the average.

1 Like

Can you share the GPIO/resistor/sensor layout please?
I’m new to this and the article skips over what resistors to use and how to connect things up :slight_smile:

Sorry for the late reply.
I used this site as a reference.

1 Like

Hi Denver,

We’ve had some recent interest in the Github files you’ve shared in this project, but the links no longer seem to work. Are they still available somewhere?

I am interested in this project, does anyone have the github code?

Hi Denver,

The Github file links are not working, are you able to update?
Also, the encloursure used, can you give some rough dimensions?


Bumping this. I’m interested in the github links also.

1 Like

I’m interested in finding these missing links too. Has anybody had any success yet?

1 Like

Hi Denver - are you able to share the github files please mate? Has anyone else found them?

Great project!

Was inspiration for mine, making up a part of an automated irrigation system.
Although I am using Python code to take the distance measurement to the water level in the tank (the earlier link was a lot of help for that), the rest of my UI is served up via a web browser.

I also had encountered some trouble with variance of the distance measurements. At times it was up to ~30mm. My solution was to take a bunch of individual measurements (10/12 or so), remove the outliers, then average whatever was left. There’s still a little bit of wobble in the resulting measurements. But I think it’s acceptable.

I used a 2.2k and a 3.3k ohm resistor as a voltage divider off the Echo output of the sensor. To take its 5volts down to the 3volts that the Raspberry Pi prefers. This bit was important so as not to damage the GPIO.

Happy to field questions.

Hi Jon and John,
I had started this project a while ago, and then I was side tracked. I have gone back through my backups, and found I still had the code files, but not the data files.
Let me know if you still want these and I’ll upload them?

1 Like