My 91 gallon reef aquarium requires RO water for top-up as the saltwater evaporates. Usually you get a container, fill it with RO/DI water and have an auto top-up setup to keep topping up the tank as the water evaporates.\
The problem is that if the reservoir runs empty, you risk damaging the top-up pump (mine has a safety shutoff), but worse - you run the risk that the tank's sump runs dry and you burn out your main return pump.
I initially tried to use Neptune Apex' LLS-15 sensor but it turned out to be horrible. It would measure accurately down to about 12cm, then it would spike up to 18cm and stay there - while the reservoir runs empty. Recalibration did not help.
So I decided to build my own. The basic principle of operation is based on an ultrasonic distance sensor that measures the distance to the top of the water level in the container (water reflects sound waves). Laser rangers would not work as water is translucent to light. This sensor sends its data to a controller that alerts me when the level falls below a threshold.
Here is the parts list:
Below is a (terrible) schematic-ish diagram - I had trouble finding the correct components in KiCad and I wanted to indicate how I wired it, so this is really more a wiring diagram than a schematic.
Principle of operation:
The sensor is IP65 rated and built like a tank. I verified the 1mm accuracy and it responds instantaneously. I also verified that with its extremely narrow beam, it can easily measure 50cm in the can without hitting the walls.
Here is a graph showing how nicely it tracks the water level (the dip on 11/08 was before I had the toggle button and I disconnected the probe for a case upgrade):