🌱 Automatic Irrigation System Using Arduino Uno
Efficient water management is crucial for sustainable agriculture and gardening. In this project, we’ll build a simple but effective automatic irrigation system using an Arduino Uno, a soil moisture sensor, and a water pump.
This system waters your plants only when they need it, saving water and ensuring healthy growth.
🔧 Components Required
Component |
Quantity |
Arduino Uno |
1 |
Soil Moisture Sensor |
1 |
Relay Module (5V) |
1 |
Water Pump (DC) |
1 |
Jumper Wires |
As needed |
Breadboard |
1 |
12V Battery or Power Supply |
1 |
⚙️ Working Principle
The soil moisture sensor detects the moisture level in the soil:
- If the soil is dry, the Arduino turns on the relay, which powers the water pump.
- If the soil is wet, the pump stays off.
🔌 Circuit Connections
Soil Moisture Sensor:
- VCC → 5V (Arduino)
- GND → GND (Arduino)
- AO → A0 (Arduino)
Relay Module:
- IN → D7 (Arduino)
- VCC → 5V (Arduino)
- GND → GND (Arduino)
Water Pump:
- Connected to relay output (NO and COM terminals)
- Power the pump using external 12V battery (not directly from Arduino)
/*💻 Arduino Code
|
// Automatic Irrigation System using Arduino Uno const int sensorPin = A0; // Soil Moisture Sensor connected to A0 const int relayPin = 7; // Relay Module connected to D7 int moistureThreshold = 400; // Adjust this based on your soil type void setup() { pinMode(sensorPin, INPUT); pinMode(relayPin, OUTPUT); Serial.begin(9600); } void loop() { int moistureLevel = analogRead(sensorPin); Serial.print("Soil Moisture Level: "); Serial.println(moistureLevel); if (moistureLevel < moistureThreshold) { digitalWrite(relayPin, HIGH); // Turn ON the water pump Serial.println("Soil is dry. Watering plants..."); } else { digitalWrite(relayPin, LOW); // Turn OFF the water pump Serial.println("Soil is wet. No need to water."); } delay(2000); // Wait for 2 seconds before reading again } */</span></h3> <h3><span style="font-family: Consolas, Monaco, monospace; font-size: 16px;"> |
📸 Demo
You can include a video or photo showing:
- The soil drying
- The pump turning on automatically
- Water being poured into the soil
- Pump turning off once the soil is moist
⚠️ Precautions
- Use a transistor or relay module to switch the pump, never drive a motor directly from the Arduino.
- Make sure the pump’s power source is appropriate for its voltage.
- Protect the soil sensor from corrosion by using capacitive types for long-term projects.
🌾 Applications
- Home garden automation
- Smart farming for small fields
- IoT-based agriculture systems (you can expand with GSM or Wi-Fi modules)
🔄 Future Improvements
- Add an LCD display to show moisture level.
- Use Wi-Fi (ESP8266) or GSM to control it remotely.
- Implement solar power for fully off-grid usage.