Federico_GonellaLeonardo_02
Published © CC BY-NC-ND

Semi automted irrigation system

With this project we want to show to people a way to try to reduce water waste. And help old, young people's plant survive.

IntermediateFull instructions provided639
Semi automted irrigation system

Things used in this project

Hardware components

Relay (generic)
×1
Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Water pump
×1
9V battery (generic)
9V battery (generic)
×1
Slide Switch
Slide Switch
×1
Ceramic Capacitive Rain Sensor
Telecontrolli Ceramic Capacitive Rain Sensor
×1
Humidity Sensor, 20% to 90% Relative Humidity
Humidity Sensor, 20% to 90% Relative Humidity
×1
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
One red, one blue and one green
×1
Resistor 221 ohm
Resistor 221 ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
Soldering iron (generic)
Soldering iron (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Scissor, Electrician
Scissor, Electrician

Story

Read more

Custom parts and enclosures

Wood box Technical draw

thi is the Technical draw of the wood box

Schematics

Electrical circuit

We made this circuit with fritzing

Code

SEMI_AUTOMATED_IRRIGATION_SYSTEM_Arduino_Code.ino

Arduino
This is the code to make the system work
int pinrain = A0;                                      // set all moisture sensors PIN ID
int valrain = 0;                                       // declare rain values
int pinhumidity = A1;                                  // Variable declaration
int valhumidity = 0;                                   // declare humidity values
int ledgreen = 2;                                      // Variable declaration
int startmisu = 9;                                     // Variable declaration
int ledred = 10;                                       // Variable declaration
int relaypump = 7;                                     // Variable declaration

void setup () {
  Serial.begin (9600);                                 // open the serial port at 9600 bps
  pinMode (pinrain, INPUT);                            // declare the sensor as input
  pinMode (pinhumidity, INPUT);                        // declare the sensor as input
  pinMode (startmisu, OUTPUT);                         // declare LED as output
  pinMode (ledgreen, OUTPUT);                          // declare LED as output
  pinMode (ledred, OUTPUT);                            // declare LED as output
  pinMode (relaypump, OUTPUT);                         // declare relay as output

}
void loop () {

  delay (3000);                                         // wait 3000 millisecond
  digitalWrite (startmisu, HIGH);                       // turn the LED on HIGH
  valrain = analogRead (pinrain);                       // read the value from the rain sensors:
  valhumidity = analogRead (pinhumidity);               // read the value from the moisture sensors:
  delay (3000);                                         // wait 3000 millisecond
  digitalWrite (startmisu, LOW);                        // turn the LED on LOW
  Serial.print("valore pioggia: ");                     // print as an ASCII-encoded decimal
  Serial.println(valrain);                              // print as an ASCII-encoded decimal
  Serial.print("valore umidit: ");                     // read the value from the moisture sensors:
  Serial.println(valhumidity);                          // print as an ASCII-encoded decimal
  delay (5000);                                         // wait 5000 millisecond
  
  if ((valrain >= 800) & (valhumidity <= 650)) {        // check which plant need water
    digitalWrite (ledgreen, HIGH);                      // turn the LED on HIGH
    digitalWrite (relaypump, HIGH);                     // turn the relay on HIGH
    delay (5000);                                       // wait 5000 millisecond

    digitalWrite (ledgreen, LOW);                       // turn the LED on LOW
    digitalWrite (relaypump, LOW);                      // turn the relay on LOW
  }
  if ((valrain < 800) & (valhumidity > 650)) {          // check which plant need water
    digitalWrite (ledred, HIGH);                        // turn the LED on HIGH
    delay (5000);                                       // wait 5000 millisecond
    digitalWrite (ledred, LOW);                         // turn the LED on LOW
  }
  if ((valrain < 800) & (valhumidity <= 650)) {         // check which plant need water
    digitalWrite (ledred, HIGH);                        // turn the LED on HIGH
    delay (5000);                                       // wait 5000 millisecond
    digitalWrite (ledred, LOW);                         // turn the LED on LOW
  }
  if ((valrain > 800) & (valhumidity > 650)) {          // check which plant need water
    digitalWrite (ledred, HIGH);                        // turn the LED on HIGH
    delay (5000);                                       // wait 5000 millisecond
    digitalWrite (ledred, LOW);                         // turn the LED on LOW
  }
}

Credits

Federico_Gonella
2 projects • 1 follower
Contact
Leonardo_02
2 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.