Build an Automatic Water Tank Controller
An automatic water tank controller monitors the water level in a storage tank and controls a water pump without manual intervention. It helps prevent tank overflow, protects pumps from running dry and ensures a reliable water supply for homes, farms and commercial buildings. This project demonstrates how to build an intelligent water controller using an Arduino or ESP32 together with water level sensors and relay modules.
Project Overview
Water level sensors continuously monitor the amount of water in the storage tank.
When the level falls below a preset minimum, the controller starts the water pump automatically. Once the tank reaches the full level, the controller switches the pump off.
Advanced systems can also monitor the source tank, detect dry-running, measure water usage and send smartphone notifications.
Project Difficulty
| Item | Value |
|---|---|
| Difficulty | ⭐⭐⭐ Intermediate |
| Build Time | 4–8 Hours |
| Supply Voltage | 5 V or 12 V DC |
| Controller | ESP32 or Arduino |
| Pump Control | Relay or Contactor |
Main Sections
| Section | Function |
|---|---|
| Microcontroller | Controls the complete system. |
| Water Level Sensors | Detect the water level. |
| Relay Module | Controls the water pump. |
| Pump Protection Circuit | Prevents dry running. |
| Status Indicators | Display pump and tank status. |
| Wi-Fi Module (Optional) | Provides remote monitoring. |
Water Level Detection Methods
| Sensor Type | Advantages |
|---|---|
| Float Switch | Simple, reliable and inexpensive. |
| Conductive Probes | Low cost and easy to install. |
| Ultrasonic Sensor | Non-contact measurement. |
| Pressure Sensor | Suitable for deep tanks. |
| Capacitive Sensor | No direct contact with water. |
Typical Components
| Quantity | Component |
|---|---|
| 1 | ESP32 or Arduino Nano |
| 2–5 | Water Level Sensors or Float Switches |
| 1 | Relay Module or Contactor Driver |
| 1 | Buzzer (Optional) |
| 3–5 | Status LEDs |
| 1 | 5 V Power Supply |
| 1 | Manual Override Switch |
| 1 | Waterproof Enclosure |
How the System Works
The controller continuously checks the water level inside the storage tank.
If the level falls below the minimum sensor, the controller energises the relay, starting the water pump.
As the tank fills, higher-level sensors are activated. When the upper sensor detects a full tank, the controller switches the pump off automatically.
Optional dry-run protection prevents the pump from operating if the source tank or well has insufficient water.
Typical Features
| Feature | Description |
|---|---|
| Automatic Pump Control | Starts and stops the pump automatically. |
| Overflow Protection | Stops pumping when the tank is full. |
| Dry-Run Protection | Prevents pump damage. |
| Manual Override | Allows manual operation. |
| Tank Level Display | Shows current water level. |
| Wi-Fi Monitoring | Remote status and notifications. |
Applications
- Domestic water tanks.
- Apartment buildings.
- Rainwater harvesting systems.
- Agricultural irrigation.
- Industrial water storage.
- Swimming pools.
- Hotels and hospitals.
- Remote pumping stations.
Testing
- Verify all sensor connections.
- Power the controller.
- Simulate a low-water condition.
- Verify that the pump starts.
- Simulate a full tank.
- Verify that the pump stops automatically.
- Test dry-run protection.
- Confirm manual override operation.
Troubleshooting
| Problem | Possible Cause |
|---|---|
| Pump does not start | Faulty relay, sensor or controller wiring. |
| Pump runs continuously | Upper level sensor not detecting water. |
| False level readings | Dirty probes or electrical interference. |
| Dry-run protection activates unexpectedly | Incorrect sensor placement or faulty source-level sensor. |
| Wi-Fi unavailable | Network configuration problem. |
Project Improvements
- Display the water level on an OLED screen.
- Send alerts via Wi-Fi or MQTT.
- Measure daily water consumption.
- Add automatic leak detection.
- Integrate with Home Assistant.
- Monitor multiple tanks simultaneously.
- Record operating history on a MicroSD card.
- Add battery backup for power failures.
Skills Learned
- Water level sensing.
- Relay control.
- Pump automation.
- ESP32 programming.
- Industrial control principles.
- IoT monitoring.
Safety Notes
- Disconnect mains power before wiring pumps or contactors.
- Use relay modules or contactors rated for the motor current.
- Install suitable overload and short-circuit protection.
- Keep low-voltage electronics isolated from mains wiring.
- Use waterproof enclosures and corrosion-resistant sensors.
Key Points
- An automatic water controller maintains the tank level without manual intervention.
- Dry-run protection helps prevent pump damage.
- ESP32-based systems allow remote monitoring and control.
- Automatic water management saves water, electricity and maintenance costs.
- Water tank controllers are widely used in homes, farms and industrial facilities.