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.
- 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
- 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
- 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
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
- Install the Arduino IDE from arduino.cc
- Connect the Arduino Uno to your computer via USB
- Update the Arduino board definitions:
Tools -> Board -> Boards Manager -> Install Arduino AVR Boards
No external libraries are required for this project. The code uses basic Arduino functions.
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
- Connect the soil moisture sensor, relay module, and water pump to the Arduino Uno as per the circuit diagram
- Upload the Arduino code (
code.ino
) - Insert the soil moisture sensor into the plant soil
- Place the pump in a water container with the pipe directed to the plant
- Power the system with a 5V battery
- Monitor the system via Serial Monitor (optional) for debugging
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/
โ โโโ code.ino # Main Arduino sketch
โโโ Documentation/
โ โโโ Component_Connections.md # Detailed connections
โโโ Circuit Diagram/
โ โโโ Irrigation_System_Circuit.png # Wiring schematic
โโโ README.md # This file
analogRead()
- Reads soil moisture sensor datamap()
- Converts raw sensor values to percentagedigitalWrite()
- Controls the relay to turn the pump on/offSerial.println()
- Outputs debug information to Serial Monitor
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
- Indoor Plants - Automate care for potted plants
- Small Gardens - Maintain backyard or balcony gardens
- Vacation Care - Water plants during extended absences
- Greenhouses - Manage irrigation for controlled environments
- Small Farms - Automate watering for small crop zones
- Hydroponics - Regulate water delivery in soilless systems
- STEM Projects - Teach microcontroller and sensor integration
- Plant Science - Study moisture effects on plant growth
- Automation Lessons - Demonstrate feedback control systems
- 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
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 |
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit changes (
git commit -m 'Add AmazingFeature'
) - Push to branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Follow Arduino coding standards
- Test modifications on Arduino hardware
- Update documentation for new features
- Include comments for complex code sections
- ๐ Complete Tutorial: CircuitDigest - Automatic Irrigation System Guide
- ๐ Arduino Soil Moisture Sensor Tutorial: Circuit Digest
- ๐ More Arduino Projects: Circuit Digest Arduino Collection
If this project helped you, please โญ star this repository and share it with others!
Built with โค๏ธ by Circuit Digest | Making Electronics Simple
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