Bill Wong
Published

Automatic Plant Watering System with Arduino

The project is aiming to help the houseplant keeper to water the plants automatically.

BeginnerFull instructions provided4 hours1,722
Automatic Plant Watering System with Arduino

Things used in this project

Hardware components

Seeeduino V4.2
Seeed Studio Seeeduino V4.2
×1
Grove - Relay
Seeed Studio Grove - Relay
×1
Seeed Studio Grove - Soil Moisture Sensor
×1
Grove Base Shield V2.0 for Arduino
Seeed Studio Grove Base Shield V2.0 for Arduino
×1
Water Pump Motor (5V)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Watering System by Arduino IDE

Arduino
// Pin Definitions
int sensorPin = A0;
int relayPin = 4;  

// Variable Definitions
int sensorValue = 0;  

void setup() {
    Serial.begin(9600);
    pinMode(4,OUTPUT); //Set pin 4 as OUTPUT pin
    pinMode(A0,INPUT); //Set pin A0 as INPUT pin
}
void loop() {
    // read the value from soil moisture sensor:
    sensorValue = digitalRead(sensorPin);
    Serial.print("value = " );
    Serial.println(sensorValue);

    // determine when to open the relay:
    if(sensorValue<200){
      digitalWrite(4,HIGH);      
      delay(3000);
      digitalWrite(4,LOW);
    }
    
    else{
      digitalWrite(4,LOW);
    }
    
    //read the value every 10 minutes
    delay(60000);
}

Credits

Bill Wong

Bill Wong

1 project • 0 followers

Comments