Keep Your Plants Alive

TLIOB008

"Jugaadu’s friend is fond of gardening. He has some plants in his office too. Once Jugaadu went to his office to meet him. He told him that his plants are dying due to lack of water, as he has to move out of the town frequently, he is unable to water plants on time. He asks Jugaadu to help him resolve the issue. Can you help Juggadu in the same? "
NETWORKING KIT
  1. Connect water pump module with Arduino, and motor driver connecting wires on bread-board.
  2. Program the Arduino and upload the sketch Using A to B USB Cable.
  3. Test it by power it on.

    

int mr1 = 8;

int mr2 = 7;

int soil=A0;



void setup() {

pinMode(mr1,OUTPUT);

pinMode(mr2,OUTPUT);

pinMode(soil,INPUT);

Serial.begin(9600);

digitalWrite(mr1,LOW);

digitalWrite(mr2,LOW);

}

void loop() {

int soilValue = analogRead(soil);

Serial.println(soilValue);

if (soilValue >= 800) {

digitalWrite(mr1,HIGH);

digitalWrite(mr2,LOW);

Serial.println("moisture value less");

}

else{

digitalWrite(mr1,LOW);

digitalWrite(mr2,LOW);

Serial.println("moisture value high");

}