Automatic Plant Watering System

Source Code:-

int rainmodule = 0;
int buzzer = 1;
int led = 2;
int Rain = HIGH;

void setup() {
  pinMode (rainmodule, INPUT);
  pinMode (buzzer, OUTPUT);
  pinMode (led, OUTPUT);
}
 

void loop() {
  Rain = digitalRead(firesensor);
  if (Rain== LOW)
  {
    digitalWrite(buzzer, HIGH);
    digitalWrite(led,HIGH);
  }
  else
  {
    digitalWrite(buzzer, LOW);
    digitalWrite(led,LOW);
  }
  delay(400);
}

 

Leave a Comment