Water overflow and dry running pumps are common problems in many homes. An Automatic Water Pump Controller solves this issue by automatically turning the motor ON and OFF based on the water level in the tank.
In this guide, we will build a smart and efficient water pump controller using the D1 Mini Pro (ESP8266). This project is low-cost, reliable, and can even be upgraded for IoT monitoring.
🔧 Components Required
- D1 Mini Pro (ESP8266)
- Relay Module (5V or 3.3V compatible)
- Water Level Sensor / Float Switch
- Jumper Wires
- Power Supply (5V)
- Connecting Wires
The D1 Mini Pro is developed by WEMOS, a popular brand for compact WiFi-based microcontroller boards suitable for IoT projects.
⚙️ Working Principle
The system works based on water level detection:
- When the tank water level is LOW → Pump turns ON.
- When the tank is FULL → Pump turns OFF automatically.
- Prevents dry run when underground tank is empty.
The D1 Mini Pro reads signals from the water level sensor and controls the relay module, which switches the water pump.
🔌 Basic Connection Overview
- Relay IN → D1 Mini D1 Pin
- Water Level Sensor Output → D2 Pin
- VCC → 5V
- GND → GND
Important: Always use proper isolation when connecting AC water pumps. If unsure, consult a qualified electrician.
💻 Sample Code (Basic Logic)
#define sensorPin D2
#define relayPin D1
void setup() {
pinMode(sensorPin, INPUT);
pinMode(relayPin, OUTPUT);
}
void loop() {
int waterLevel = digitalRead(sensorPin);
if (waterLevel == LOW) {
digitalWrite(relayPin, HIGH); // Pump ON
} else {
digitalWrite(relayPin, LOW); // Pump OFF
}
}
This simple logic can be expanded to include WiFi alerts, Blynk app integration, or Telegram notifications.
🚀 Advantages of This Project
- Prevents water overflow
- Saves electricity
- Protects pump from dry run
- Low-cost DIY solution
- Upgradeable to IoT system
🌐 Future Upgrades
You can upgrade this project by:
- Adding LCD display for water level
- Creating a web dashboard
- Sending mobile notifications
- Adding dual tank monitoring
📌 Final Thoughts
This Automatic Water Pump Controller using D1 Mini Pro is a practical and efficient electronics project. It is perfect for beginners and intermediate hobbyists who want to build smart home automation systems.
If you found this tutorial helpful, stay tuned to our blog for more latest tips and tricks in electronics, IoT, and technology.

0 Comments