Irrigation System

SRJT08202

Sharad is very fond of gardening. He has got some plants in the office too. Once Jugaadu went to visit him in the office. Sharad told Jugaadu that his plants are dying as he is not able to water them timely while he is on a business trip. He asks help from Jugaadu to save his plants?br

Bag Items:

  1. Arduino UNO UNO
  2. 12V Battery
  3. Battery connector
  4. Beaker
  5. USB Cable
  6. Soil Moisture Sensor
  7. Jumper Cables Cutter
  8. Glue gun
  9. Foam Sheets
  10. Motor Pump
  11. Pipes
  12. Cardboard
  13. Motor Driver IC

"


    int pumpp=7;
int pumpn=6;
void setup() {
// put your setup code here, to run once:
pinMode(pumpp,OUTPUT);
pinMode(pumpn,OUTPUT);
pinMode(5,OUTPUT);
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
analogWrite(5,140);
if(analogRead(A0)<170){
digitalWrite(pumpp,LOW);
digitalWrite(pumpn,LOW);
}else{
digitalWrite(pumpp,HIGH);
digitalWrite(pumpn,LOW);
}
Serial.println(analogRead(A0));
}