Project Overview
🌱 System Description
An intelligent irrigation system that automatically controls water flow based on soil moisture levels. The system uses Arduino Uno for control logic, a soil moisture sensor for real-time monitoring, and an LCD display for status visualization.
⚡ Key Features
- Real-time soil moisture monitoring
- Automatic motor control via relay
- 16x2 I2C LCD display
- Low power consumption
- Easy installation and maintenance
🔬 Technical Specs
- Microcontroller: Arduino Uno R3
- Display: PCF8574 LCD 16x2
- Sensor: Soil Moisture Sensor
- Power: 9V Battery
- Communication: I2C Protocol
Arduino Source Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int water; // Variable to store moisture level
LiquidCrystal_I2C lcd(0x27, 16, 2); // Address of the I2C LCD and its dimensions
void setup() {
pinMode(3, OUTPUT); // Output pin for relay board, this will send signal to the relay
pinMode(6, INPUT); // Input pin coming from soil sensor
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
}
void loop() {
water = digitalRead(6); // Reading the signal from the soil sensor
if (water == HIGH) { // If water level is full then cut the relay
digitalWrite(3, LOW); // Low is to cut the relay
} else {
digitalWrite(3, HIGH); // High to continue providing signal and water supply
}
// Display moisture level and motor state on LCD
lcd.clear(); // Clear the LCD
lcd.setCursor(0, 0); // Set cursor to first row
lcd.print("Moisture: "); // Print label
lcd.print(water == HIGH ? "Dry" : "Wet"); // Print moisture level
lcd.setCursor(0, 1); // Set cursor to second row
lcd.print("Motor: "); // Print label
lcd.print(water == HIGH ? "on" : "off"); // Print motor state
delay(400); // Delay for stability
}
📚 Libraries Used
- Wire.h - I2C communication protocol
- LiquidCrystal_I2C.h - I2C LCD control
🔌 Pin Configuration
- Pin 3 - Relay control (OUTPUT)
- Pin 6 - Soil sensor (INPUT)
- A4/A5 - I2C (SDA/SCL)
⚙️ Logic Flow
- Read soil moisture sensor
- HIGH = Dry soil → Motor ON
- LOW = Wet soil → Motor OFF
- Update LCD display
Project Documentation (PDF)
Bill of Materials (BOM)
| S.No | Name | Quantity | Component |
|---|---|---|---|
| Loading components... | |||
Component Distribution
System Architecture
🔄 Working Principle
The soil moisture sensor continuously monitors the moisture level in the soil. When the soil is dry (sensor output HIGH), the Arduino activates the relay to turn on the water pump. When the soil becomes wet (sensor output LOW), the relay is deactivated, stopping the water flow. The LCD displays real-time status of both moisture level and motor state.
🔗 Connections
- Soil Sensor → Arduino Pin 6
- Relay Module → Arduino Pin 3
- LCD SDA → Arduino A4
- LCD SCL → Arduino A5
- Power Supply → 9V Battery
✅ Advantages
- Water conservation
- Reduced manual intervention
- Cost-effective solution
- Easy to scale and maintain
- Real-time monitoring
Future Enhancements
📱 IoT Integration
Add WiFi/GSM module for remote monitoring and control via mobile app. Send notifications when irrigation starts/stops.
🌡️ Multi-Sensor System
Integrate temperature, humidity, and light sensors for comprehensive environmental monitoring and smart decision making.
☀️ Solar Power
Replace battery with solar panel and rechargeable battery for sustainable, long-term operation in outdoor environments.