
There are a whole lot of automated pump controllers and water-level monitoring programs on the market. However the second you search for one thing wi-fi with correct IoT options, the place you may see the tank’s water stage in actual time and swap the pump on or off out of your cellphone or laptop computer, the costs shoot as much as round ₹5,000–₹6,000. Most of them are additionally fairly cumbersome and are available these large box-type enclosures.
So as an alternative, we’re placing collectively a a lot less complicated and cleaner resolution. It’s tremendous compact (below 4 cm), straightforward to repair on a tank, and does every thing you really want: pump management, real-time alerts, and correct stage readings. You additionally get a neat dashboard for all of the controls, and the gadget works in each WiFi AP mode and STA mode. Meaning you may both join on to it or let it be a part of your private home community.
To maintain the gadget small and straightforward to put in, we’re utilizing the IndusBoard Coin V2. It provides us sufficient I/Os and an ADC to measure the water stage correctly. For controlling the pump, we’re pairing it with a relay module so the switching stays protected and dependable.

Observe: Within the Invoice of Supplies, as an alternative of the 5V energy adapter, you may as well use a 5V battery together with a small photo voltaic panel to make the gadget unbiased of electrical energy.
Connections
Begin by connecting all of the parts as proven within the circuit diagram (Fig. 2).
For energy, join the 5V pin of the IndusBoard to a 5V energy adapter, and ensure the GND pin of the IndusBoard is tied to the widespread floor of all the circuit.
Water Degree Sensing (Conductive Probes)
Widespread GND Probe:
Connect a wire to the GND pin of the IndusBoard and place it on the backside of the tank. This can act because the reference probe.
Degree Probes:
Join GPIO pins 1, 3, 4, 5, 6, and seven to particular person wires positioned at completely different heights contained in the tank (0%, 20%, 40%, 60%, 80%, 100%). When the water reaches a specific peak, it’ll full a path to the GND probe, permitting the system to detect the water stage.
Observe: You don’t want exterior resistors as a result of the ESP32-S2’s inner pull-ups shall be used (configured within the code).
Relay Module for Pump Management
- VCC: Join the relay module’s VCC to the 5V pin of the IndusBoard.
- GND: Join the relay module’s GND to the IndusBoard’s GND.
- Sign (IN): Join the relay’s sign pin to GPIO 33 of the IndusBoard. This pin will management the pump’s ON/OFF state.
Pump Wiring:
Join the 220V AC pump to the relay’s Usually Open (NO) and Widespread (COM) terminals. Ensure the reside (L) and impartial (N) out of your 220V provide are wired correctly between the relay and the pump.
When you’re uncertain about dealing with AC mains wiring, seek the advice of an electrician—security comes first.

Code
Now, let’s transfer into the coding half, written within the Arduino IDE. This assumes you have already got the ESP32 board package deal put in and every thing able to go.
The code begins with an array of I/O pins for water-level detection:
const int levelPins[] = {1, 3, 4, 5, 6, 7};
These six pins correspond to the conductive probes positioned at completely different heights contained in the tank, protecting ranges from 0% to 100%.
After that, the Wi-Fi configuration is available in. STA mode is about up utilizing:
const char* sta_ssid = "YOUR_SSID";const char* sta_password = "YOUR_PASSWORD";
You simply want to interchange these placeholders with your individual Wi-Fi identify and password so the gadget can be a part of your private home community.
For flexibility, AP mode can also be included:
const char* ap_ssid = "WaterController";const char* ap_password = "controller123";
This lets you join on to the gadget, which is useful when working it in standalone mode.
Within the setup part, the online server is began, and the I/O pins are configured as enter pull-ups for water-level detection utilizing the conductivity technique. After that, completely different capabilities are added to deal with water-level calculations, pump management, and the opposite required operations.

Testing Water Degree Monitoring and Pump Management System

Now place the gadget on high of the tank and place the wires at their respective ranges. Energy it on, and you’ll connect with it both by its hotspot (utilizing the identify and password you set within the code) or by your private home Wi-Fi, if it has already joined the community.
As soon as related, open an internet browser, enter the gadget’s IP handle, and also you’ll be capable to see the real-time water stage. Within the webpage UI, set the whole capability of your tank in liters and submit it. The system will then estimate the quantity of water primarily based on the detected stage.
For pump management, you may swap the pump ON and OFF from the interface. The floating circle on the high will change coloration—inexperienced for ON and purple for OFF—so you may simply see the pump’s present standing.


