NatchaphonTah
Published © GPL3+

Automatic watering system

It is a concept project. Use time to benefit. In agriculture To reduce the time spent with watering vegetables, garden, etc.

IntermediateProtip1,728
Automatic watering system

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
10 unids KY-019 5 V Uno de 1 Canales Módulo de Relé Junta Escudo Para PIC AVR DSP DEL BRAZO para arduino Relay
×1
SparkFun Soil Moisture Sensor (with Screw Terminals)
SparkFun Soil Moisture Sensor (with Screw Terminals)
×1
Resistor 100 ohm
Resistor 100 ohm
×1
Solenoid Valve
RobotGeek Solenoid Valve
×1
LED (generic)
LED (generic)
×1

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

img_8798_mZbAsOmKp5.JPG

Code

Automatic watering system

Arduino
// Variable value : //                  //English//                            //Thai//
int sensorPin = A0 ;    //(Set the sensor at Pin A0)          //(  A0)
int sensorValue = 0;    //(Set the water valve to Pin 0)      //(  0)
int ledred = 10;        //(Set the RED LED on the Pin 10)     //( LED    10)
int ledgreen = 11;      //(Set the GERRN LED on the Pin 11)   //( LED    11)

void setup() {
  Serial.begin(9600);
  pinMode (ledred,OUTPUT);
  pinMode (ledgreen,OUTPUT);
  pinMode (sensorValue,OUTPUT);
  
}

void loop() {
Serial.print("sensor=");
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
  if(sensorValue>300)
    digitalWrite(ledred,HIGH);
    digitalWrite(ledgreen,LOW);
    delay(500);
    digitalWrite(sensorValue,HIGH);
    
  if(sensorValue<170)
    digitalWrite(ledgreen,HIGH);
    digitalWrite(ledred,LOW);
    delay(500);
    digitalWrite(sensorValue,LOW);
    
   //if(sensorValue>175&&sensorValue<295)
    //digitalWrite(ledred,LOW);
    //digitalWrite(ledgreen,HIGH);
    //digitalWrite(sensorValue,LOW);
}

Credits

NatchaphonTah
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.