Skip to content

Circuit-Digest/automatic-irrigation-system-arduino-uno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 

Repository files navigation

Automatic Irrigation System Using Arduino Uno

Arduino License: MIT CircuitDigest

A DIY Automatic Irrigation System project using Arduino Uno and a soil moisture sensor to automatically water plants based on soil moisture levels, ensuring healthy plants even during extended absences.

Automatic Irrigation System

๐Ÿš€ Features

  • Automated Watering - Triggers water pump based on soil moisture levels
  • Soil Moisture Detection - Real-time monitoring using a soil moisture sensor
  • Relay Control - Manages pump operation safely and efficiently
  • Low Maintenance - Operates independently without human intervention
  • Customizable Thresholds - Adjustable moisture levels for different plants
  • Cost-Effective - Affordable setup for home gardens or indoor plants
  • Portable Design - Compact system for versatile deployment
  • Suitable for Indoor/Outdoor - Works for both garden and potted plants

๐Ÿ› ๏ธ Hardware Requirements

Primary Components

  • Arduino Uno (1x) - Microcontroller for processing and control
  • Soil Moisture Sensor (1x) - Measures soil moisture levels
  • 5V Relay Module (1x) - Controls the water pump
  • 6V Mini Water Pump with Pipe (1x) - Delivers water to plants
  • 5V Battery (1x) - Power source for the system
  • Connecting Wires - For circuit connections
  • Breadboard (Optional) - For prototyping connections

Optional Components

  • LCD Display - For real-time moisture level display
  • LED Indicators - Visual feedback for system status
  • External Power Supply - For larger pumps or extended operation
  • Water Container - Reservoir for the pump

๐Ÿ“ Circuit Diagram

Arduino Uno Connections:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Arduino Pin     โ”‚ Component        โ”‚ Function       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ A0             โ”‚ Soil Moisture    โ”‚ Analog Input   โ”‚
โ”‚ 3              โ”‚ Relay Module     โ”‚ Signal Control โ”‚
โ”‚ 5V, GND        โ”‚ Relay/Sensor     โ”‚ Power Supply   โ”‚
โ”‚ Vin, GND       โ”‚ Battery          โ”‚ Power Input    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“– Complete Circuit Diagram: View Detailed Schematic

โš™๏ธ Installation

1. Arduino IDE Setup

  1. Install the Arduino IDE from arduino.cc
  2. Connect the Arduino Uno to your computer via USB
  3. Update the Arduino board definitions:
    Tools -> Board -> Boards Manager -> Install Arduino AVR Boards
    

2. Software Dependencies

No external libraries are required for this project. The code uses basic Arduino functions.

3. Code Setup

Clone the project repository:

git clone https://github.com/electroscopearchive/automatic-irrigation-system-arduino-uno.git
cd automatic-irrigation-system-arduino-uno

Upload the main script using Arduino IDE:

File -> Open -> code.ino

๐ŸŽฏ Usage

  1. Connect the soil moisture sensor, relay module, and water pump to the Arduino Uno as per the circuit diagram
  2. Upload the Arduino code (code.ino)
  3. Insert the soil moisture sensor into the plant soil
  4. Place the pump in a water container with the pipe directed to the plant
  5. Power the system with a 5V battery
  6. Monitor the system via Serial Monitor (optional) for debugging

Sample Code

int soilMoistureValue = 0;
int percentage = 0;

void setup() {
  pinMode(3, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  soilMoistureValue = analogRead(A0);
  percentage = map(soilMoistureValue, 490, 1023, 0, 100);
  Serial.println(percentage);
  
  if (percentage < 10) {
    Serial.println("pump on");
    digitalWrite(3, LOW);
  }
  if (percentage > 80) {
    Serial.println("pump off");
    digitalWrite(3, HIGH);
  }
}

๐Ÿ“ Code Structure

โ”œโ”€โ”€ Code/
โ”‚   โ””โ”€โ”€ code.ino                    # Main Arduino sketch
โ”œโ”€โ”€ Documentation/
โ”‚   โ””โ”€โ”€ Component_Connections.md     # Detailed connections
โ”œโ”€โ”€ Circuit Diagram/
โ”‚   โ””โ”€โ”€ Irrigation_System_Circuit.png # Wiring schematic
โ””โ”€โ”€ README.md                       # This file

Key Functions

  • analogRead() - Reads soil moisture sensor data
  • map() - Converts raw sensor values to percentage
  • digitalWrite() - Controls the relay to turn the pump on/off
  • Serial.println() - Outputs debug information to Serial Monitor

๐Ÿ”ง Troubleshooting

Common Issues

Sensor Not Reading Correctly

  • Verify sensor connections to A0, 5V, and GND
  • Calibrate sensor using dry and wet soil values
  • Check for loose wires or damaged sensor

Pump Not Activating

  • Ensure relay module is connected to pin 3 and powered
  • Verify battery voltage matches pump requirements
  • Check relay signal (active LOW)

Inconsistent Watering

  • Adjust moisture thresholds (10% and 80%) in code
  • Ensure sensor is placed near plant roots
  • Test pump with a manual toggle to confirm functionality

๐Ÿ“ฑ Applications

Home Gardening

  • Indoor Plants - Automate care for potted plants
  • Small Gardens - Maintain backyard or balcony gardens
  • Vacation Care - Water plants during extended absences

Agriculture

  • Greenhouses - Manage irrigation for controlled environments
  • Small Farms - Automate watering for small crop zones
  • Hydroponics - Regulate water delivery in soilless systems

Education

  • STEM Projects - Teach microcontroller and sensor integration
  • Plant Science - Study moisture effects on plant growth
  • Automation Lessons - Demonstrate feedback control systems

๐Ÿ”ฎ Future Enhancements

  • WiFi Connectivity - Add ESP8266 for remote monitoring
  • Mobile App Integration - Control and monitor via smartphone
  • Multiple Sensors - Support multiple plants with zoned irrigation
  • LCD Display - Show real-time moisture and pump status
  • Solar Power - Use solar panels for eco-friendly operation
  • Data Logging - Store moisture data for analysis

๐Ÿ—๏ธ Technical Specifications

Parameter Value
Operating Voltage 5V DC
Current Consumption 1-3W (with pump active)
Sensor Range 0-100% moisture
Pump Capacity 100-500mL/min (adjustable)
Operating System Arduino IDE
Operating Temperature 0ยฐC to 50ยฐC

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contributing Guidelines

  • Follow Arduino coding standards
  • Test modifications on Arduino hardware
  • Update documentation for new features
  • Include comments for complex code sections

๐Ÿ”— Links

โญ Support

If this project helped you, please โญ star this repository and share it with others!


Built with โค๏ธ by Circuit Digest | Making Electronics Simple


Keywords

arduino irrigation system soil moisture sensor project diy automatic watering arduino uno projects smart irrigation system plant care automation relay module control arduino gardening projects automated plant watering

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages