This is one of the NodeMCU projects I use to save $1000+ per year. For peanuts cost.
For complete details go to the website and click on: 6. Zero Municipal Water Toilet. Monitored and controlled from a web page hosted on the NodeMCU microcontroller.
Switched to self-priming pumps instead. A much higher flow pump to fill the toilet tank silently in a shorter time (65 seconds) and a tiny, much lower flow pump to fill the barrel from the well. The well pump cycles on and off as needed to refill the barrel after a flush in 30 to 60 minutes or so. Or at least 24 flushes per day.
If you use a sump pump or the water table is normally not far below the foundation this system will work for you. I only had to go down 6 ft or so. The well is beside an existing sewage pump tank in the basement. A square hole existed in the basement floor for the sewage pump tank. The 4" well is in the corner of the square hole.
https://sites.google.com/site/nodemcu12e/
Complete Original Code is here: https://sites.google.com/site/zerowatercode/
Updated code is one of the files below.