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.
Components and supplies
LED (generic)
9V battery (generic)
Water pump
Breadboard (generic)
Jumper wires (generic)
Resistor 221 ohm
Arduino UNO
Slide Switch
Humidity Sensor, 20% to 90% Relative Humidity
Ceramic Capacitive Rain Sensor
Relay (generic)
Tools and machines
Soldering iron (generic)
Laser cutter (generic)
Scissor, Electrician
Multitool, Screwdriver
Apps and platforms
Arduino IDE
Project description
Code
SEMI_AUTOMATED_IRRIGATION_SYSTEM_Arduino_Code.ino
arduino
This is the code to make the system work
1int pinrain = A0; // set all moisture sensors PIN ID 2int valrain = 0; // declare rain values 3int pinhumidity = A1; // Variable declaration 4int valhumidity = 0; // declare humidity values 5int ledgreen = 2; // Variable declaration 6int startmisu = 9; // Variable declaration 7int ledred = 10; // Variable declaration 8int relaypump = 7; // Variable declaration 9 10void setup () { 11 Serial.begin (9600); // open the serial port at 9600 bps 12 pinMode (pinrain, INPUT); // declare the sensor as input 13 pinMode (pinhumidity, INPUT); // declare the sensor as input 14 pinMode (startmisu, OUTPUT); // declare LED as output 15 pinMode (ledgreen, OUTPUT); // declare LED as output 16 pinMode (ledred, OUTPUT); // declare LED as output 17 pinMode (relaypump, OUTPUT); // declare relay as output 18 19} 20void loop () { 21 22 delay (3000); // wait 3000 millisecond 23 digitalWrite (startmisu, HIGH); // turn the LED on HIGH 24 valrain = analogRead (pinrain); // read the value from the rain sensors: 25 valhumidity = analogRead (pinhumidity); // read the value from the moisture sensors: 26 delay (3000); // wait 3000 millisecond 27 digitalWrite (startmisu, LOW); // turn the LED on LOW 28 Serial.print("valore pioggia: "); // print as an ASCII-encoded decimal 29 Serial.println(valrain); // print as an ASCII-encoded decimal 30 Serial.print("valore umidit: "); // read the value from the moisture sensors: 31 Serial.println(valhumidity); // print as an ASCII-encoded decimal 32 delay (5000); // wait 5000 millisecond 33 34 if ((valrain >= 800) & (valhumidity <= 650)) { // check which plant need water 35 digitalWrite (ledgreen, HIGH); // turn the LED on HIGH 36 digitalWrite (relaypump, HIGH); // turn the relay on HIGH 37 delay (5000); // wait 5000 millisecond 38 39 digitalWrite (ledgreen, LOW); // turn the LED on LOW 40 digitalWrite (relaypump, LOW); // turn the relay on LOW 41 } 42 if ((valrain < 800) & (valhumidity > 650)) { // check which plant need water 43 digitalWrite (ledred, HIGH); // turn the LED on HIGH 44 delay (5000); // wait 5000 millisecond 45 digitalWrite (ledred, LOW); // turn the LED on LOW 46 } 47 if ((valrain < 800) & (valhumidity <= 650)) { // check which plant need water 48 digitalWrite (ledred, HIGH); // turn the LED on HIGH 49 delay (5000); // wait 5000 millisecond 50 digitalWrite (ledred, LOW); // turn the LED on LOW 51 } 52 if ((valrain > 800) & (valhumidity > 650)) { // check which plant need water 53 digitalWrite (ledred, HIGH); // turn the LED on HIGH 54 delay (5000); // wait 5000 millisecond 55 digitalWrite (ledred, LOW); // turn the LED on LOW 56 } 57} 58
SEMI_AUTOMATED_IRRIGATION_SYSTEM_Arduino_Code.ino
arduino
This is the code to make the system work
1int pinrain = A0; // set all moisture 2 sensors PIN ID 3int valrain = 0; // declare 4 rain values 5int pinhumidity = A1; // Variable 6 declaration 7int valhumidity = 0; // declare 8 humidity values 9int ledgreen = 2; // Variable 10 declaration 11int startmisu = 9; // Variable 12 declaration 13int ledred = 10; // Variable 14 declaration 15int relaypump = 7; // Variable 16 declaration 17 18void setup () { 19 Serial.begin (9600); // 20 open the serial port at 9600 bps 21 pinMode (pinrain, INPUT); // 22 declare the sensor as input 23 pinMode (pinhumidity, INPUT); // 24 declare the sensor as input 25 pinMode (startmisu, OUTPUT); // 26 declare LED as output 27 pinMode (ledgreen, OUTPUT); // 28 declare LED as output 29 pinMode (ledred, OUTPUT); // 30 declare LED as output 31 pinMode (relaypump, OUTPUT); // 32 declare relay as output 33 34} 35void loop () { 36 37 delay (3000); // 38 wait 3000 millisecond 39 digitalWrite (startmisu, HIGH); // 40 turn the LED on HIGH 41 valrain = analogRead (pinrain); // 42 read the value from the rain sensors: 43 valhumidity = analogRead (pinhumidity); 44 // read the value from the moisture sensors: 45 delay (3000); // 46 wait 3000 millisecond 47 digitalWrite (startmisu, LOW); // 48 turn the LED on LOW 49 Serial.print("valore pioggia: "); // 50 print as an ASCII-encoded decimal 51 Serial.println(valrain); // 52 print as an ASCII-encoded decimal 53 Serial.print("valore umidit: "); // 54 read the value from the moisture sensors: 55 Serial.println(valhumidity); // 56 print as an ASCII-encoded decimal 57 delay (5000); // 58 wait 5000 millisecond 59 60 if ((valrain >= 800) & (valhumidity <= 650)) { 61 // check which plant need water 62 digitalWrite (ledgreen, HIGH); // 63 turn the LED on HIGH 64 digitalWrite (relaypump, HIGH); // 65 turn the relay on HIGH 66 delay (5000); // 67 wait 5000 millisecond 68 69 digitalWrite (ledgreen, LOW); // 70 turn the LED on LOW 71 digitalWrite (relaypump, LOW); // 72 turn the relay on LOW 73 } 74 if ((valrain < 800) & (valhumidity > 650)) { // 75 check which plant need water 76 digitalWrite (ledred, HIGH); // 77 turn the LED on HIGH 78 delay (5000); // 79 wait 5000 millisecond 80 digitalWrite (ledred, LOW); // 81 turn the LED on LOW 82 } 83 if ((valrain < 800) & (valhumidity <= 650)) { // 84 check which plant need water 85 digitalWrite (ledred, HIGH); // 86 turn the LED on HIGH 87 delay (5000); // 88 wait 5000 millisecond 89 digitalWrite (ledred, LOW); // 90 turn the LED on LOW 91 } 92 if ((valrain > 800) & (valhumidity > 650)) { // 93 check which plant need water 94 digitalWrite (ledred, HIGH); // 95 turn the LED on HIGH 96 delay (5000); // 97 wait 5000 millisecond 98 digitalWrite (ledred, LOW); // 99 turn the LED on LOW 100 } 101} 102
Downloadable files
Electrical circuit
We made this circuit with fritzing
Electrical circuit
Documentation
Wood box Technical draw
thi is the Technical draw of the wood box
Wood box Technical draw
Wood box Technical draw
thi is the Technical draw of the wood box
Wood box Technical draw
Comments
Only logged in users can leave comments