🌱 Smart Plant Monitoring + Automatic Watering System
Using ESP32 + Soil Moisture Sensor + Relay + Water Pump
✅ 1) Project Idea (Concept)
Plants need water when the soil becomes dry.
But humans cannot check soil moisture every time.
So, this project is made to:
-
Measure soil moisture automatically
-
Detect dry soil condition
-
Turn ON water pump automatically
-
Stop pump when soil is enough wet
-
Save water + save time + keep plant healthy
This is called a Smart Plant Monitoring and Automatic Watering System.
✅ 2) Main Components Used
1. ESP32 Development Board
2. Soil Moisture Sensor
3. Relay Module (1 Channel)
4. DC Water Pump
5. External Power Supply
6. Jumper Wires + Breadboard (optional)
7. Pipe + Water Tank/Container
✅ 3) Detailed Explanation of Every Component
3.1 ESP32 Development Board (Main Controller)
🔹 What is ESP32?
ESP32 is a microcontroller board (like Arduino, but more powerful).
It has:
-
WiFi
-
Bluetooth
-
Many GPIO pins
-
Analog pins (ADC)
-
PWM output
-
Fast processor
🔹 Why we use ESP32 in this project?
Because ESP32 can:
-
Read analog data from soil moisture sensor
-
Process moisture values
-
Take decision (dry or wet)
-
Control relay ON/OFF
-
(Optional) Send data to mobile using WiFi
🔹 ESP32 Power
ESP32 works internally on 3.3V.
But we can supply power by:
-
USB cable (5V)
-
VIN pin (5V)
3.2 Soil Moisture Sensor (Plant Soil Checking)
🔹 What is Soil Moisture Sensor?
It is a sensor that checks water level in soil.
It gives output based on soil wetness.
🔹 How it works (Real Logic)
Soil moisture sensor checks:
-
If soil has water → soil conducts electricity more
-
If soil is dry → soil conducts electricity less
So sensor produces analog output based on moisture.
🔹 Types of Soil Moisture Sensors
✅ 1) Resistive Soil Moisture Sensor (Cheaper)
-
Has 2 metal probes
-
Works but corrodes after few days/weeks
-
Not good for long-term use
✅ 2) Capacitive Soil Moisture Sensor (Recommended)
-
No metal corrosion
-
Long lasting
-
More accurate
⭐ For best project, use Capacitive sensor.
🔹 Sensor Pins
Most soil sensor module has 3 pins:
| Pin | Meaning |
|---|---|
| VCC | Power |
| GND | Ground |
| AO | Analog output |
🔹 Sensor Output
The sensor gives analog value:
-
Wet soil → lower value
-
Dry soil → higher value
ESP32 reads this value using ADC.
ESP32 ADC range:
-
0 to 4095
3.3 Relay Module (1-Channel Relay)
🔹 What is Relay?
Relay is an electrically controlled switch.
It helps ESP32 control high-power devices like:
-
Water pump
-
Fan
-
Bulb
-
Motor
🔹 Why relay is needed?
Because:
ESP32 GPIO pins can give:
-
only 3.3V
-
very small current (max ~20mA)
But pump needs:
-
5V / 12V
-
high current (500mA, 1A, etc.)
So relay acts as a bridge between ESP32 and pump.
🔹 Relay Pins
Relay module has 3 input pins:
| Relay Pin | Work |
|---|---|
| VCC | Relay power |
| GND | Ground |
| IN | Control pin from ESP32 |
Relay output side has terminals:
| Terminal | Meaning |
|---|---|
| COM | Common |
| NO | Normally Open |
| NC | Normally Closed |
🔹 Relay Output Meaning (Important for Viva)
NO (Normally Open)
-
Default OFF
-
When relay triggers → ON
✅ This is used for pump (safe).
NC (Normally Closed)
-
Default ON
-
When relay triggers → OFF
❌ Not used in pump because pump will stay ON by default.
3.4 DC Water Pump
🔹 What is DC Pump?
DC pump is a small motor-based pump that pushes water.
It takes water from a tank and gives it to plant.
🔹 Common Pump Ratings
-
5V DC Pump
-
6V DC Pump
-
9V DC Pump
-
12V DC Pump
⭐ 12V pump is common and powerful.
🔹 Why pump is used?
Because the project is not only monitoring, but also automatic watering.
3.5 External Power Supply (Very Important)
🔹 Why external power supply is needed?
Because ESP32 cannot supply enough power for pump.
Example:
-
Pump needs 12V 1A
-
ESP32 cannot give that
So we use:
-
12V adapter (for 12V pump)
-
5V 2A adapter (for 5V pump)
3.6 Jumper Wires / Breadboard
Used to connect:
-
ESP32 to sensor
-
ESP32 to relay
Breadboard helps in temporary wiring.
✅ 4) Full Working (Step-by-Step)
This is the main part of explanation:
Step 1: Sensor in Soil
Soil moisture sensor is inserted into plant soil.
Step 2: Sensor Output Changes
-
If soil is wet → sensor gives low analog value
-
If soil is dry → sensor gives high analog value
Step 3: ESP32 Reads Moisture
ESP32 reads sensor output using analog pin GPIO34.
ESP32 reads values like:
-
Wet: 1200–2000
-
Medium: 2000–3000
-
Dry: 3000–4095
Step 4: ESP32 Decision Making
ESP32 checks:
If moisture value > threshold
➡ Means soil is dry
If moisture value < threshold
➡ Means soil is wet
Step 5: Relay ON
When soil is dry:
ESP32 sends HIGH/LOW signal to relay IN pin.
Relay triggers and connects:
COM ↔ NO
Step 6: Pump ON
When relay connects COM and NO:
Power supply flows to pump
Pump starts watering the plant.
Step 7: Pump OFF
After few seconds (example 5 seconds), ESP32 stops relay.
Relay disconnects COM and NO
Pump stops.
Step 8: Monitoring Continues
ESP32 continues checking soil again and again.
✅ 5) Complete Wiring / Connection Details
5.1 Soil Sensor to ESP32
| Soil Sensor Pin | ESP32 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| AO | GPIO34 |
5.2 Relay to ESP32
| Relay Pin | ESP32 Pin |
|---|---|
| VCC | 5V (VIN) |
| GND | GND |
| IN | GPIO26 |
⚠ Important Note:
ESP32 GND and Relay GND must be common.
5.3 Pump Connection with Relay (Output Side)
For Example: 12V Pump
Connections:
-
Adapter + (positive) → Relay COM
-
Relay NO → Pump +
-
Pump – → Adapter –
✅ 6) Project Logic (Simple)
If soil is dry:
✅ Pump ON
If soil is wet:
❌ Pump OFF
✅ 7) Advantages of the System
-
Fully automatic watering
-
Saves water
-
Improves plant health
-
Reduces manual effort
-
Works continuously
-
Can be upgraded to IoT
✅ 8) Applications
-
Home gardening
-
Smart farming
-
Nursery automation
-
Greenhouse irrigation
-
Indoor plant care
-
Agriculture monitoring
✅ 9) Conclusion
This Smart Plant Monitoring and Automatic Watering System is an IoT-based project that uses ESP32, soil moisture sensor, relay module, and water pump.
The sensor checks soil wetness and ESP32 controls the relay to start the pump when soil becomes dry.
This project is very useful in modern agriculture and smart gardening.