Sump Well Level Monitor
My wife and I own a twinplex. Both sides have sump wells in the basement. It isn't very convenient to check on them as my in-laws live in our basement and of course the other side has renters. We do not wish to frequently disturb our renters by coming over to check on such things. Recently however we received a $2,000 water bill. This was because our sump pump had failed. As a backup we have a water powered sump pump. These are common in the city because city water rarely loses pressure so a water powered sump pump can be more reliable than a battery powered backup. But... if they run for a month before they are noticed they can be expensive. Still, much less expensive then flood damage, but expensive.
Needless to say, I would like to find a better solution, where I can discover a pump is not working before the water runs for a month! How this works is the main, mains powered pump is mounted low in the well. The backup is mounted higher. So long as the main pump is working the water should never get high enough to trigger the backup pump. I did think about solutions that would monitor the flow from the main pump or the current consumed by it. Those all depend on the amount of water coming into the foundation drain which varies throughout the year. A better way is just to watch the water level. If it rises higher than the main pump then the main pump must not be functioning. If it rises even higher, past the backup then there is a flood.
I found many products out there which do this. But none were satisfactory. The problem is our house was not originally built with backup pumps and monitors in mind. I added the backup pumps after we bought it. So the wells are a bit narrow for two pumps in each. It was already tricky to fit two pumps, each with their own float switches in such a way that the floats never stick against one another or the pumps and get trapped in one position. Most solutions I found involved adding a third float switch. This is not an option!
I also found ultrasonic sensors. Most were meant to be mounted in the top of a water tank, not over-top a sump well. I could probably find a spot to stick one where it is pointed at the water. But, if it was disturbed at all and re-pointed at a different angle it would be measuring the distance to one of the pumps, the side of the well or one of the floats. I do not like this, still to fiddly.
Then there is the question of how to get the measurements and/or an alarm to us. Most just make a loud noise. That isn't going to be very useful on our renter's side when they are often gone days at a time. I also found one that was sold by Verizon and would text us. That's kind of neat but I don't really want to subscribe to yet another service for this. I am running HomeAssistant. It already controls several of the lights and fans in our house and my whole family has the client installed on their phones. Most of our devices are talking to HomeAssistant via Zigbee so something which will do that would be perfect.
While I did find some ultrasonic water level sensors that use Zigbee and would talk to HomeAssistant they were all industrial items meant to be mounted in the top of a water tank. This was not what I wanted.
So... that leaves one option... Build it myself!
In the past I have played a little with HC-SR04 ultrasonic distance modules. I thought maybe I could connect one of those to some sort of ESP32 or other microcontroler that does Zigbee. My plan was to mount that at the top of a pvc pipe with holes drilled through the sides to let water in and out. I would stick the pipe in the well and zip-tie or otherwise attach it to the existing pipes for support. This way nothing could find it's way between the sensor and the water, it would be enclosed. It would only need an area the size of the pipe's outer diameter out of the already cramped space in the wells.
I have lots of 1/2" PVC pipe lying around. So I wanted to use that size. The HC-SR04 however uses a pair of transducers with a little space between them. The pair are too wide to fit inside a 1/2" pipe. So I thought maybe I could 3d print a Y-adapter that the transducers would press into on one side and the pvc pipe would press into the other. I also ordered a 3-pack of Seed Studio XIAO microcontrolers that can do Zigbee.
I designed and printed my Y-adapter. To start with I tried designing it to bring the two sensor holes towards one another at a 45° angle. After I pressed the sensor in and looked at it through the pvc pipe hole I could see that was pretty agressive and it looked like the sound waves might just bounce right back instead of continuing down the PVC pipe. But I tried it anyway. Rather than pull out the XIAOs, which I had never used before I decided to start with a plain old Arduino Uno clone. Sure enough.. as soon as I press the sensors into my Y-adapter it started reporting a distance of about 1cm which does not change no matter what is in front of the pipe side. At this point I could re-design my y-adapter to be longer, with a more gradual angle. Maybe that would work? But.. I see that Amazon has a pair of JSN-SR04T sensors for only about $13. These are designed to be better protected from water and they seem to have just a single entrance/exit point rather than the two that woudl need to be y-ed together. I have ordered a pair and will come back to this project after they arrive.