The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Connect the YL-69’s analog output to Arduino pin A0, read it with analogRead(), and calibrate the reading in the soil you plan to monitor. The example project by Sheekar Banerjee uses an Arduino Uno Rev3 and a threshold of 1000, but that number is not a universal watering point. Treat the sensor as a relative wet/dry indicator, not a calibrated moisture meter.
What the YL-69 project does
Banerjee’s Arduino Project Hub build, published May 23, 2022, pairs a YL-69 soil moisture sensor with an Arduino Uno Rev3. The sketch reads the sensor through A0, reports the value over the Serial Monitor at 9600 baud, prints a watering suggestion, and waits three seconds between readings. The source code calls the input variable rainPin; despite that name, it is connected to the soil sensor, not a rain sensor. See the Arduino Project Hub project and sketch.
Parts and wiring
You need an Arduino Uno or compatible board, a YL-69 probe, its companion controller board, and jumper wires. The controller board commonly has pins labelled VCC, GND, A0, and D0. Check the labels on your own module before wiring; kit boards and seller documentation can differ.
| Sensor module pin | Arduino connection | Purpose |
|---|---|---|
| VCC | 5 V | Supplies power to the module, as in the cited Arduino connection description. |
| GND | GND | Shares the circuit ground. |
| A0 | A0 (analog input) | Provides the analog signal the sketch reads. |
| D0 | Leave unconnected for this sketch | Optional thresholded digital output; it is not used by the analog-reading example. |
Insert the probe into the soil you want to monitor, keeping the controller board and its electrical connections clear of wet soil and water. The YL-69 is a resistive probe: moisture changes electrical conduction between its electrodes. Its companion board commonly uses an LM393 comparator and an adjustment potentiometer for the D0 threshold; that digital output is a simple threshold state, while A0 lets the Arduino inspect a range of readings. The University of Belgrade paper describes the connection and sensor behavior; Cirkit Designer describes the module’s analog and digital outputs.
Recommended Free Tools
#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
Upload a basic reading sketch
This sketch prints the raw analog reading every three seconds. It follows the example project’s pin, serial speed, and interval, but leaves out the project’s uncalibrated watering threshold so you can observe your own setup first.
const int soilPin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int reading = analogRead(soilPin);
Serial.println(reading);
delay(3000);
}
- Connect the Arduino to your computer and select the matching board and port in the Arduino IDE.
- Upload the sketch.
- Open the Serial Monitor and set its baud rate to 9600.
- Watch the readings while the probe is in your soil. Record values under conditions you can reproduce rather than interpreting one sample in isolation.
The reading is a raw analog value, not a percentage. Do not label it “percent moisture” unless you have developed and validated a conversion for your specific sensor, board, soil, and setup.
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.
Calibrate a threshold for your soil
There is no universal YL-69 threshold in the cited sources. Probe variation, soil composition, moisture, and circuit setup all affect readings. Even nominally similar probes can differ, and soil type affects probe resistance. A technical education reference recommends taking dry and wet reference readings with the specific sensor and soil being monitored. See the BMI Wiki guidance on dry and wet references.
- Place the probe in the actual growing medium and note the reading when it is relatively dry for your intended use.
- Water the medium, allow excess water to drain, and note a reading at the wetter condition you want to recognize.
- Repeat observations if the values jump around. Use the readings that represent your real conditions, not a threshold copied from another project.
- Choose a boundary between the observed conditions and test it over multiple readings before using it to trigger an alert or watering action.
Check which direction your particular module’s readings move as the soil dries. The example project compares its reading with 1000 and treats values below that boundary as no watering and values at or above it as a prompt to water. That is the project’s observed logic, not a guaranteed polarity or suitable threshold for every clone board. Its author explicitly makes the threshold adjustable; the project does not establish that 1000 works for other probes, boards, supply voltages, soil mixes, or plants. The project sketch shows the comparison.
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
Once you have established the direction and a useful boundary, add a conditional to the loop. For example, if your own measurements show that drier soil produces higher readings, the logic can be:
const int soilPin = A0;
const int threshold = 700; // Replace with a boundary measured in your setup
void setup() {
Serial.begin(9600);
}
void loop() {
int reading = analogRead(soilPin);
Serial.println(reading);
if (reading >= threshold) {
Serial.println("Soil is at or drier than your chosen boundary");
} else {
Serial.println("Soil is wetter than your chosen boundary");
}
delay(3000);
}
The number 700 here is only an example placeholder for a value you must replace after calibration; it is not a recommended setting. Reverse the comparison and messages if your observed output moves in the opposite direction.
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.
What the digital output does differently
If you only need a binary state rather than a numeric reading, D0 can provide a thresholded signal from the controller board’s comparator. The module’s potentiometer sets that threshold. A0 is preferable when you want to inspect changing values or implement the threshold in Arduino code; D0 is useful for a simple above/below indication. The two outputs are not interchangeable: changing the potentiometer affects the board’s digital threshold, while the analog example reads A0. Module output details.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why readings fluctuate and what to check
- Probe and soil differences: Soil type and probe variation affect the result. Calibrate with the actual probe in the medium being monitored rather than expecting another setup’s values to match. The technical paper discusses the influence of soil type.
- Changing contact or moisture: Check that the probe remains in consistent contact with the soil and that it has not been moved between readings.
- Electrical and soil conditions: A community discussion flags salinity and corrosion as possible contributors to inconsistent readings. Treat changes as clues to investigate, not as a precise moisture measurement. See the Arduino Forum discussion.
- Wrong output or wiring: Confirm that the Arduino reads A0 from the module’s analog pin, and that VCC and GND match the board labels. Reading D0 instead gives a thresholded state, not the analog range.
Limits and alternatives
The YL-69’s exposed conductive electrodes can corrode over time, and readings may vary with probe and soil conditions. It is best treated as an inexpensive relative wet/dry indicator for learning or a simple demonstration, not a precision agricultural instrument. The cited sources do not establish a validated accuracy percentage, service life, or universal conversion from its analog output to soil moisture. The ShillehTek manual discusses the module; the Arduino Forum discussion covers inconsistent readings.
Best Value
- Chip is TL555
- Operating Voltage: 3.3 ~ 5.5 VDC
- Output Voltage: 0 ~ 3.0 VDC
- PH:2.54MM
A capacitive soil moisture module is an alternative to consider when you want to avoid exposed resistive electrodes. It is a different sensor, not the one used in Banerjee’s project. The available sources do not support a blanket claim that every capacitive module is accurate, durable, or maintenance-free. ShillehTek’s manual and the Arduino Forum discussion provide context on the corrosion tradeoff.
Quick Recap
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.




