To build the YL-69 Arduino project, connect the sensor module’s analog output to A0, power it and read its raw value with analogRead(). The example uses an Arduino Uno Rev3 and prints a watering suggestion to the Serial Monitor, but its threshold of 1000 is only a starting point—not a universal measure of when a plant needs water. Calibrate the reading with your own probe and growing medium before relying on it.
What the YL-69 project does
Sheekar Banerjee’s Arduino Project Hub build, published May 23, 2022, pairs an Arduino Uno Rev3 with a YL-69 soil moisture sensor. Its sketch reads the analog signal on A0, reports the value over serial at 9600 baud, and prints a watering suggestion. The sketch calls the input variable rainPin, but it is connected to the soil sensor; the project is not measuring rainfall. View the published project and sketch.
The YL-69 is a resistive probe: moisture changes electrical conduction between its two exposed electrodes. A companion controller board commonly provides power and ground, an analog output (A0), and a digital output (D0). Analog output gives the Arduino a range of readings to inspect. The digital output is a thresholded on/off signal controlled by the module’s comparator and adjustment potentiometer. A 2020 technical paper on an Arduino-controlled irrigation system describes the probe’s dependence on moisture and soil type, while Cirkit Designer’s YL-69 pinout guide discusses the comparator-based module.
Parts and wiring
- Arduino Uno Rev3 or a compatible Arduino board with an analog input
- YL-69 probe and its companion controller module
- Three jumper wires
Check the labels printed on your particular module before connecting it; generic YL-69/FC-28 kits can vary in how their pins are presented. For the common controller-board layout, wire:
#1 Best Overall
- This is a simple moisture sensor can be used to detect soil moisture, when the soil water shortage, the module outputs a high level, whereas the output low.
- Use this sensor to make an automatic watering device that will keep your garden of plants unmanaged.
- Module dual output mode, digital output is simple, more accurate analog output.
- Sensitivity adjustable (Figure blue digital potentiometer adjustment)
- Comparator using LM393 chip, stable job
| Sensor module pin | Arduino connection | Purpose |
|---|---|---|
| VCC | 5 V | Powers the module, as in the cited wiring description. |
| GND | GND | Provides the shared ground. |
| A0 | A0 | Sends the analog reading to the Arduino. |
Leave D0 unconnected for this analog-reading example. The 2020 paper describes connecting Vcc to 5 V, GND to ground, and A0 to an Arduino analog input. If your board’s labels or voltage requirements differ, follow its documentation rather than assuming every module is identical.
Upload a basic reading sketch
This sketch follows the project’s central approach: read A0, print the raw value and a suggestion, then wait three seconds. It uses the project’s threshold of 1000 as an example only; calibrate that value for your setup before using the message as a watering cue.
Rank #2
- 【Version】This capacitive analog soil moisture sensor is V1.2
- 【Voltage】Working voltage: 3.3~5.5 VDC, output voltage: 0~3.0 VDC
- 【Interface】Interface: PH2.54-3P, Pin: Analog signal output, GND, VCC
- 【Feature】Capacitive humidity sensor has good linearity, good repeatability, small hysteresis, fast response, small size, and can be used at - 10 ℃ - 60 ℃ humidity environment
- 【Comparision】This capacitive soil humidity sensor is different from most of the resistive sensors. It uses the capacitive sensing principle to detect soil humidity, avoiding the problem that the resistive sensor is easily corroded, and greatly extending its working life.
const int soilPin = A0;
const int thresholdValue = 1000; // Example only; calibrate for your setup
void setup() {
Serial.begin(9600);
}
void loop() {
int reading = analogRead(soilPin);
Serial.print("Soil sensor reading: ");
Serial.println(reading);
if (reading < thresholdValue) {
Serial.println("No watering suggestion from this example threshold.");
} else {
Serial.println("Check whether the soil needs watering.");
}
delay(3000);
}
- Connect the Arduino to your computer and open the sketch in the Arduino IDE.
- Select the correct board and port, then upload the sketch.
- Open the Serial Monitor and set its baud rate to 9600 to match
Serial.begin(9600). - Place the probe in the soil and observe the raw value. The example reports a reading every three seconds.
The original project’s comparison treats readings below 1000 as no watering and readings at or above 1000 as a prompt to water. That is the behavior of its example code, not a validated recommendation for other probes, boards, supply voltages, soils, or plants. The published sketch does not establish a universal threshold or output direction.
Calibrate the reading for your soil
A raw analog value is not a soil-moisture percentage. It depends on the specific probe, controller, board, soil composition, and moisture conditions. A technical education reference recommends recording dry and wet reference readings for the particular sensor and soil being monitored. See the Czech Technical University BMI Wiki’s YL-69 guidance.
Rank #3
- Capacitive Soil Moisture Sensor: Compatible with for Arduino Raspberry Pi
- Size:98*23mm
- Operating Voltage:3.3V DC;Output Voltage:0-3.0V DC
- Interface Type:PH2.54 3Pin
- Commodities include:10Pcs Soil Moisture Sensor;10Pcs connecting wire
- Use the same probe, module, board, and growing medium you intend to monitor.
- Record the sensor’s readings in representative dry soil and after the soil has been watered and allowed to settle.
- Compare the two readings to find which direction corresponds to drier soil in your circuit. Do not assume every clone has the same polarity.
- Choose a threshold between your observed reference points, based on the conditions at which you want a reminder.
- Repeat observations as needed; treat the threshold as a practical trigger for your setup, not a laboratory calibration.
If you want a scaled display, you can map the observed dry and wet endpoints to a convenient range in code, but that result remains specific to the conditions used to establish those endpoints. Do not label it “percent moisture” unless you have established and validated a conversion for your setup.
Why readings may fluctuate
Variation between nominally similar probes and changes in soil composition can affect readings; community discussion also flags sensitivity to salinity and corrosion. An Arduino Forum discussion about inconsistent YL-69 readings illustrates that users encounter this issue, but does not establish a single cause or a universal fix.
Rank #4
- 【Specifications】Operating voltage: DC3.3-5.5V, output voltage: DC0-3.0V, size: 98*23mm,Interface:PH2.0-3P, The sensor has a 3-pin "gravity" interface, which can be directly connected to the gravity I/O expansion baffle.
- 【Capacitive sensing】Soil moisture content is measured by capacitive sensing. Instead of measuring soil moisture by resistive sensing like other types of humidity sensors,It avoids the problem of resistive sensors and their easy corrosion, greatly extending its working life.
- 【DIY watering system】 If you combine this soil moisture sensor with a small water pump, hose, relay module, etc., you can create an automatic watering device. DIY kit for a device that waters when the soil is dry, freeing you from daily watering and making things easier. Rest assured when you are away for work or travel.
- 【Easy to use】Insert the soil and detect the output of real-time soil moisture data. This soil moisture meter has a built-in constant voltage chip and supports a 3.3V voltage operating environment, so it will work normally with a 3.3V master board. Micro PCs can be operated by simply connecting one external ADC (analog signal to digital signal) conversion module.
- 【Application in Various Occasions】Connect the screen and the motherboard to obtain real-time soil moisture data. Suitable for automatic watering system robots, etc. Commonly used in garden plants, humidity detection, and smart agriculture.
- Check placement: Keep the probe in a consistent position and depth when comparing readings.
- Check connections: Confirm VCC, GND, and A0 are firmly connected to the labeled pins.
- Compare like with like: Soil type and moisture affect conduction, so readings from different pots or mixes are not directly interchangeable.
- Look for electrode wear: The exposed resistive probe can corrode over time, which may affect its behavior.
The YL-69 is best treated as an inexpensive relative wet/dry indicator for learning and simple demonstrations, not a precision agricultural instrument. The cited sources do not establish a reliable service-life figure or validated accuracy percentage for the exact kit.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to consider a capacitive sensor
A capacitive soil moisture module is an alternative if you want to avoid relying on an exposed pair of resistive electrodes. It is not the sensor used in Banerjee’s project, and the available sources do not support a blanket claim that every capacitive module is accurate, durable, or maintenance-free. Whichever type you choose, check its interface and voltage requirements and calibrate it in the soil where it will be used. The ShillehTek sensor manual discusses the resistive module and its use.
Quick Recap
Best Value
- Chip is TL555
- Operating Voltage: 3.3 ~ 5.5 VDC
- Output Voltage: 0 ~ 3.0 VDC
- PH:2.54MM
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

