This Smart Irrigation System automatically waters plants based on soil moisture levels using an ESP8266 (NodeMCU), a soil moisture sensor, an OLED display, a buzzer, and a relay-controlled water pump. It helps conserve water and provides automation for home gardens, farms, and indoor plants.
✔ Soil Moisture Monitoring using an analog sensor
✔ OLED Display (128x64) shows moisture level with a bar animation
✔ Buzzer Alert when soil is dry
✔ Water Pump Control using a relay module
✔ Low Power & Cost-Effective
1️⃣ ESP8266 (NodeMCU)
2️⃣ Soil Moisture Sensor (FC-28 or similar)
3️⃣ OLED Display (128x64, SSD1306, I2C)
4️⃣ Buzzer (Piezo or standard)
5️⃣ Relay Module (5V, 1-channel)
6️⃣ Water Pump Motor (DC 5V–12V)
7️⃣ Jumper Wires & Breadboard
| Soil Sensor Pin | Connect To (ESP8266) |
|---|---|
| VCC | 3.3V |
| GND | GND |
| A0 | A0 |
| OLED Pin | ESP8266 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | D2 (GPIO4) |
| SCL | D1 (GPIO5) |
| Buzzer Pin | ESP8266 Pin |
|---|---|
| + (VCC) | D6 (GPIO12) |
| - (GND) | GND |
| Relay Pin | ESP8266 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| IN | D7 (GPIO13) |
Water Pump Wiring:
- COM (Common) → Connect to Pump Negative (-)
- NO (Normally Open) → Connect to GND
- Pump Positive (+) → Connect to External Power (+5V to 12V)
⚠ Note: Use an external power supply if the pump requires more than 5V.
Upload this code to your ESP8266 (NodeMCU) using the Arduino IDE:
Open Arduino IDE, go to Sketch → Include Library → Manage Libraries, and install:
✔ Adafruit SSD1306
✔ Adafruit GFX
- Connect ESP8266 to your PC via USB Cable
- Select Board: NodeMCU 1.0 (ESP-12E Module)
- Choose Port from Tools → Port
- Click Upload ✅
✔ Reads soil moisture percentage
✔ Displays moisture level on OLED with a bar animation
✔ Buzzer alerts when soil is too dry
✔ Water pump turns ON when moisture is low, then stops after 5 seconds
🔹 WiFi Monitoring (Send data to a web dashboard)
🔹 Remote Control (Turn pump ON/OFF from a mobile app)
🔹 Battery/Solar Powered System
Made with ❤️ by Arun Roshan 🚀