-->
Notification texts go here Contact Us pelacakan

Soil Moisture Sensor YL-69 or HL-69 with Arduino

 

- A guide for the Soil Moisture Sensor YL-69 or HL-69 with Arduino provides step-by-step instructions on incorporating these sensors into electronic projects. These sensors are specifically designed to measure soil moisture levels, making them essential for applications like smart irrigation systems, plant monitoring, or agriculture automation. The guide typically includes details on wiring the sensor to an Arduino board, sample code for Arduino programming, and explanations on interpreting the moisture sensor readings. By following this guide, users can effectively integrate soil moisture sensors with Arduino, enabling their projects to optimize water usage and enhance plant care based on real-time soil conditions.

- The YL-69 or HL-69 soil moisture sensor is commonly used to measure the moisture content in soil. Here's a basic guide on how to connect and use a soil moisture sensor with an Arduino:


Components Needed:

1x YL-69 moisture sensor 

Arduino UNO – read Best Arduino Starter Kits

1x Breadboard

2x 220 Ohm Resistors

1x Red LED

1x Green LED

Jumper wires

Wiring:

Connect the soil moisture sensor as follows:

Connect the VCC pin to 5V on Arduino.

Connect the GND pin to GND on Arduino.

Connect the A0 pin to an analog pin on Arduino.



Arduino Code:

Here's a simple example to read the analog output from the soil moisture sensor:


int rainPin = A0;

int greenLED = 6;

int redLED = 7;

// you can adjust the threshold value

int thresholdValue = 800;


void setup(){

  pinMode(rainPin, INPUT);

  pinMode(greenLED, OUTPUT);

  pinMode(redLED, OUTPUT);

  digitalWrite(greenLED, LOW);

  digitalWrite(redLED, LOW);

  Serial.begin(9600);

}


void loop() {

  // read the input on analog pin 0:

  int sensorValue = analogRead(rainPin);

  Serial.print(sensorValue);

  if(sensorValue < thresholdValue){

    Serial.println(" - Doesn't need watering");

    digitalWrite(redLED, LOW);

    digitalWrite(greenLED, HIGH);

  }

  else {

    Serial.println(" - Time to water your plant");

    digitalWrite(redLED, HIGH);

    digitalWrite(greenLED, LOW);

  }

  delay(500);

}

Interpretation:

The analog value represents the resistance between the sensor probes, which varies with the soil moisture content. Lower values typically indicate higher moisture levels.

Calibration:

Calibrate the sensor by measuring analog values in dry and wet soil conditions. Adjust the code or create a threshold based on your calibration.

Note:

Soil moisture sensors provide a relative measurement and may require calibration for accurate readings.

Ensure proper placement of the sensor probes in the soil to get accurate readings.

Adjust the pin numbers in the code to match your actual wiring configuration. Depending on your project requirements, you may want to implement a more sophisticated algorithm for moisture interpretation or integrate the sensor readings into a larger project.

soil moisture sensor,soil moisture sensor with arduino uno,moisture sensor,arduino,how to use soil moisture sensor,sensor arduino,sensor de humedad arduino,sensor de humedad y lcd arduino,sensor de humedad arduino tinkercad,sistema de riego arduino,activar bomba de agua arduino y sensor de humedad,sensor,sensor de lluvia,sensores arduino,sensor de lluvia para home assistant con esphome,arduino uno,arduino project,arduino robotics tutorial,yl-69

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.