Dam water pump control

I am brand new to the world of micro controllers/computers and I am eager to develop a new water pumping system to save a lot of walking and to keep my brain stimulated. In my early days as a mechanical engineer, I was pretty good at programming in FORTRAN and after seeing a few tutorials on Python, I don’t think the coding will be a problem.

I would like to develop a system to control filling various water tanks from dams on my property. I have a manual system which works well but is time consuming when I have to go to various tanks to check levels. I have two systems which are essentially the same. A dam pump pumps to a staging tank which has a high/low float switch. Once full, power to the dam pump is stopped (via the float switch). I then manually switch control to a pump at the staging tank which pumps to a top tank. It is stopped when the float switch reaches the low level. There are no sensors on the top tank, so there are situations when the top tank could overflow. There is no linking between the two pumping systems except for a common supply pipe to the top tank.

I would like to be able to monitor and control all systems through an app on my Android phone. Both staging tanks (where the pumps are controlled) are within WiFi range.

My idea is:
Use a Raspberry Pi Pico at one staging tank. It will have a WiFi module and a 4 channel relay module. The relays will be used to switch higher powered relays which will handle the pump motor current. There will be auto and manual options for each of the pumps.

Use a Raspberry Pi Model A+ at the second staging tank using the same relay controls as the other tank. It will communicate with the Pico via WiFi and will coordinate the whole system. I assume I will be able to get the time from my WiFi connection rather than needing a RTC module.

Use the MIT app Inventor to link all information and control to my Android phone.

Eventually, I might use another Pico at the top tank to provide tank level information to the system. It would only need to report tank high/low level via a float switch but can’t think of any other device for about $30 which could do the job.

Am I proceeding in the right direction?


Sounds to me like you’re pretty much on track, though if you want wifi there may be some more preferable options as far as microcontrollers - perhaps an ESP32 or ESP8266 may be better as they have built in WiFi.

From what you’ve said, I think you’ve got x2 of the following setups, both connected to the same top tank:
Do you have valving that needs to be controlled as well, or do the pumps hold pressure when they’re off?

It’d be a good start to install some kind of level sensing in the top tank to control your second stage pump, though I wouldn’t rely on it completely. I’d suggest putting a time-out or something on the pump control, else if a pipe blows one day it’ll just keep pumping water 'til the creek runs dry.

There are a few different IoT providers that make it easy to monitor sensors etc. remotely. I know Blynk is one that’s quite popular though I’ve never used it myself - I think core have a few tutorials on IoT setup.

I’ve seen a few community projects doing parts of what you’re trying to achieve on Core’s projects page that would be worth a read over:


Thanks for your comments and advice which will help me on my way.

I have check valves on the outgoing side of all pumps, so there is no backflow from the higher level tanks. Your suggestion regarding a time out rather than just a high level signal at the top tank was planned (I just didn’t want to go into every part of my system as the length of my first post would probably bore most readers!). I also plan to incorporate some logic which will only let the pumps operate whilst I am generating excess solar power as it is better to use it myself rather than getting the miserable $0.05/kWhr feed in rate.

I use Omron DPDT relays to switch both the Active and Neutral supplies to each pump. They operate on a 12VDC signal then switch the 240VAC. At about $7 for a relay and mount, they are cheaper than the relay modules I have seen for micro controller boards. They are also easy to replace and are built tough! It just means I need to have a 12VDC supply in the same cabinet as the Pico.


Hi Greg
I like your choice of Omron relays and bases. I have used these many times in the past while working full time and like you found them very robust and reliable. There are a couple of things to be aware of which you probably know about but I will repeat just in case.
If they are subject to any vibration at all you must use the retaining clip supplied as an option I think with the base. They do sometimes have a tendency to work their way out of the base socket.
Some models are fitted internally with the flywheel diode and an indicator LED. The coil on these types are polarity conscious.
They make a vast array of different types these days. If space is a problem the thin DIN rail mount types are not a bad option.
Cheers Bob