I made a sump pump monitor with an ESP32 development board and a submersible level (pressure) sensor. The idea behind this project was to meet several goals:
- Locally controlled
- Retains functionality without power or internet
- No failure modes that can affect the sump pump’s operation
- Tells me how often the pump is operating
- Alerts me when either the primary or backup pump is not working
- Alerts me when the backup battery is not charging or is drained
This monitor operates off the 12V battery that powers the backup sump pump. Here’s the major parts I used, plus miscellaneous wires, resistors, bypass capacitors, headers, DC barrel jacks, solder, etc. Some of the links are just examples; I got some items from AliExpress and others I had on-hand.
- ESP32 dev board
- ADS1115 Analog-to-digital converter
- Level sensor - I have the one with 1m range
- 12-to-24V converter
- 12-to-5V converter
- Project Box
- Momentary Push Button
- 12V Siren
- 5V relay - I had a dual relay sitting around which I used, even though a single is all I needed.
This is the schematic I came up with.
They make current-to-voltage converters which I could have used instead of creating the voltage divider circuit, but I didn’t see much point to that. I have no experience with this one, but here is an example if you want to use that option.
I connected it to the battery with a harness that goes from ring terminals to a DC plug, with an in-line fuse:
Doing this project made me realize how absolutely awful I am at soldering. Please don’t feel the need to tell me how bad I am, but I’ll take tips if you have them. The DC barrel jacks soldered to the board aren’t being used; this project went through several iterations and I reworked the board multiple times while I was still changing the schematic. Yes, even after I had it running on a breadboard and thought it was “good enough”. The one smart thing I did was to use headers instead of soldering the ESP32 and ADS1115 boards directly to the perfboard. It allowed easier access during soldering, I didn’t have to worry about overheating those components, and if I screw anything up they are easy to swap out.
This is all the components placed into the project box:
And here it is installed, sitting on the backup battery:
The level/pressure sensor sits in the bottom of the sump. It doesn’t really matter if it is vertical or laying horizontal, as long as it doesn’t interfere with any of the pumps. I have mine vertical, with the wire zip tied to some of the PVC pipe. You can’t see anything with both sump pumps in there, so here’s a picture with the sensor sitting in the sump while I was replacing the backup sump pump. The sensor is circled in red.
The code is quite complicated for all the sensors and monitoring I wanted to have. Here it is, feel free to modify as needed: