Sheekar Banerjee
Published © CC0

YL69 Soil Moisture Sensor with Arduino | Sheekar Banerjee

This project is about interfacing YL69 soil moisture or hygrometer sensor which is generally used to detect the humidity of the soil.

IntermediateShowcase (no instructions)1,199
YL69 Soil Moisture Sensor with Arduino | Sheekar Banerjee

Things used in this project

Hardware components

YL-69 Soil Hygrometer Humidity & Soil Moisture Detection Sensor For Arduino
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram of YL-69 Sensor with Arduino UNO R3

Code

Program of YL69 Soil Sensor with Arduino UNO R3

Arduino
int rainPin = A0;

// you can adjust the threshold value
int thresholdValue = 1000;

void setup(){
  pinMode(rainPin, INPUT);
  Serial.begin(9600); // Streaming 9600 bits of Sensor Data per Second
}

void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(rainPin);
  Serial.println("Soil-humidity sensor value: ");
  Serial.print(sensorValue);
  if(sensorValue < thresholdValue){
    Serial.println(" - Plant doesn't need watering now...");
    
  }
  else {
    Serial.println(" - Time to water your plant now...");
    
  }
  delay(3000);
}

Credits

Sheekar Banerjee
0 projects • 6 followers
A motivated Computer Scientist & Engineer with years of experience over IoT, Robotic Systems, Machine Learning Algorithms and Software.
Contact

Comments

Please log in or sign up to comment.