Monday, May 4, 2026

well pump controller to allow development in low-flow wells

Background: when you install a well, the screen always clogs up with fine particles, slowing down how fast water can get into the well bore. To clean it up, you need to develop the well. There are lots of ways to do this, but maybe the simplest is just to pump a bunch of water out of the well and wash the fines out. I have some crappy wells I installed with students this spring, and the challenge is that they currently are so clogged that the pump runs dry in about 10 seconds, and then it takes 5 minutes for the well to fill up again enough to pump. So if I just leave the pump running, it'll burn out from running dry most of the time.


Project: a simple timer that will run the pump for some time, and then shut it off for some time, and repeat. The time intervals need to be adjustable. 


I have the hardware I need to build it, but screwing around with buttons and knobs and displays is always a bit of a challenge, as is keeping all that stuff water-resistant and robust. 


Idea: I have plenty of microcontrollers that can act as wifi access points, and host their own websites, and interact via those.


Challenge: the coding for the website hosting and interacting is fairly complex, and I've never really done a good job figuring it out.  Sounds like a great opportunity for LLM coding!


So I wrote up a basic description of what I want the system to do:


"Make a program that runs on an esp8266. The program will control a 12v pump using a pair of relays attached to gpio pins. The esp8266 will host a website the provides places to enter 2 time periods, ON time and OFF time, as well as a start button, stop button and timer status display. When the user clicks the start button, the pump runs for ON time, then waits for OFF time and then runs again. It repeats this cycle indefinitely until turned off."


It spit out some code, and with one small tweak it worked great.  here's the code:

github









No comments:

Post a Comment