Automated Drip Irrigation System

by Srilakshmi Varma in Living > Gardening

1543 Views, 8 Favorites, 0 Comments

Automated Drip Irrigation System

DIY Automatic Drip Irrigation System! | Srilu Varma

Drip irrigation is an irrigation method that utilizes micro drippers to deliver water directly to plants’ roots which allows watering to be 40 to 70% more water efficient than using a hose.

I built an automated drip irrigation system for any backyard or small-scale garden that controls the flow of water based on soil moisture levels. Low moisture in the soil will switch the irrigation system on, reducing the need for manual labor and providing an environment for plants to thrive.

The system is controlled by an Arduino Uno and the on-off supply of water is regulated by a motorized ball valve.

I'd like to credit Salih Zeki's Smart Irrigation project as the inspiration for my irrigation system and Ms. Berbawy's Principles of Engineering class for supporting me.

Supplies

Electronics components

Drip Irrigation components (variable based on individual needs):

Tools

  • Soldering iron + solder (or breadboard)
  • Drill press

Electronics Assembly

schematic.png

Schematic image sources

Connect the following pins with jumper wires or solder as shown in the schematic above:

  • Pin 2 on Arduino to In 1 on 4 channel relay module
  • A0 on soil moisture sensor to A0 on Arduino
  • GND on soil moisture sensor to GND on Arduino
  • 3rd pin on K1 relay in 4 channel relay to the mini breadboard (as shown)
  • 2nd pin on K1 relay in 4 channel relay to the terminal
  • Solenoid valve wires to the mini breadboard (as shown)
  • Diode on the middle bridge of the mini breadboard
  • 2nd pin on K1 relay to the positive screw on the terminal block adapter
  • Positive pin on 5v power supply module directly to VCC on 4 channel relay
  • Negative pin on 5v power supply module to GND on 4 channel relay
  • Positive and negative wires to soil moisture sensor (as shown)
  • Solder together wires that connect: 5V on Arduino, VCC on soil moisture sensor, and VCC on 4 channel relay

A 12V, 2.5 Amp power source and a 3-way splitter plugs into the Arduino, 5v power supply module and terminal block adapter. A soldering iron and solder was also used to connect 1 set of wires, but this can be replaced with the use of a breadboard if needed.

Code

code.png

Code source: Salih Zeki's Smart Irrigation project

I uploaded the code to my Arduino Uno. Start by download the Arduino IDE Software then copy and paste the code below (all previous default text on Arduino IDE can be removed). Compile the code and uploaded it with a USB-A to USB-B cable.

Code:

const int relayEnable = 2;

const int sensorPin = A0;

const int thresholdMax = 800;

const int thresholdMin = 10;

void setup()

{

pinMode(relayEnable, OUTPUT);

pinMode(sensorPin, INPUT);

Serial.begin(9600);

Serial.println("Soil Moisture Level: ");

delay(1000);

}

void loop()

{

int sensorValue = analogRead(sensorPin);

sensorValue = map(sensorValue, thresholdMax, thresholdMin, 0, 100);

Serial.print("Moisture: ");

Serial.print(sensorValue);

Serial.println("%");

if (sensorValue < 0)

{

digitalWrite(relayEnable, LOW);

Serial.println("Relay ON");

}

else

{

digitalWrite(relayEnable, HIGH);

Serial.println("Relay OFF");

}

delay(1000);

}

Once done uploading the code, plug in the 12v power supply and test the electronics. Ensure that the lights on the 5V power supply and Arduino Uno turn on and that the motorized ball valve opens. Test the moisture sensor by dipping it in wet soil and checking that the motorized ball valve closes.

Potential challenges: I experienced some issues with my Arduino Uno, and here are some troubleshooting tips that helped me out.

  • Resetting the code by clicking the small white button in the top left hand corner of the board
  • Re-uploading the code
  • Using a different laptop to upload the code if your laptop is unable to detect the Arduino despite being properly plugged in (you may not have the latest drivers installed)
  • Using a different "port" when uploading the code
  • Re-installing Arduino IDE and compiling the code again
  • Burning the boot loader (as it may be corrupted)
  • More troubleshooting tips from Arduino

Box Assembly

image5.png
image9.jpg
image1.png
image4.png
IMG_6545.jpg

Once the electronics components are functional, transfer them to the electronics box. Holes must be drilled on both sides of the box to allow the wires to pass through.

Drilling holes

In order to drill the holes, I utilized a drill press which allowed me to stabilize the box while drilling the holes. The holes I drilled had a diameter of 0.4902 in. for the power supply cable and 0.2685 in. for the soil moisture sensor and motorized ball valve wires. I began with a small drill bit and slowly increased the size of the drill bit and this procedure allowed me to drill holes in the plastic box with minimal damage.

Assembling components in the box

I then assembled the electronics components within the box and I have included a CAD model of how I arranged the electronics.

Wire extension

I extended the wires to the my motorized ball valve and soil moisture sensor with outdoor grade wire and connected it to the existing jumper wires using wire nuts.

Drip Irrigation System Assembly

IMG_5370.JPEG
IMG_5379.JPEG
IMG_5384.jpg
IMG_5397 2.JPEG
IMG_5398.JPEG

This step is highly variable based on your individual location and needs. I implemented the irrigation system in my backyard and planned out the assembly before putting everything together.

Components:

  • Soaker hose: connected to input end of the motorized ball valve
  • 1/2" tubing: connected to output end of the motorized ball valve
  • 1/4" drip line: allows the dripping of water directly onto the plants' roots
  • 1/4" barb connectors: connect the 1/4" drip line to the 1/2" piping
  • Hole punch: makes holes in the 1/2" tubing with some force
  • Goof plugs: plug any accidental holes created
  • Tee connectors: T shaped barbed connections for 1/2" tubing
  • Elbows: L shaped barbed connections for 1/2" tubing
  • 1/2" and 1/4" stakes: hold tubing and drip line into the soil
  • Emitters: allow water to be aimed and dripped
  • End cap: stops the flow of water at the end of the system and builds up water pressure
  • Hose clamp: screw tightly onto the 1/2" tubing connections to stop leakage of water

Water source:

I chose to utilize the soaker hose in my backyard. Water tanks can also be used to create a gravity-fed irrigation system.

Conclusion

Once your electronic components and drip irrigation components have been assembled and connected together, you are done with the project! Enjoy your new irrigation system!

I would like to thank my peers in my Principles of Engineering class, my parents and Ms. Berbawy for supporting me with this project throughout the year.