9527 – Moisture Sensor/en
Erscheinungsbild
Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.
Summary
The Waveshare Moisture Sensor (P/N 9527 / WSAL9527) is a fork-shaped soil sensor with an analog output that measures soil moisture via transistor current amplification.
Related products at JW Tech
Technical overview
- Fork design for insertion into soil; the output voltage rises as soil moisture increases.
- Specifications: detection depth 38 mm, power 2.0–5.0 V, dimensions 20.0 × 51.0 mm, mounting holes 2.0 mm.
- Pinout: VCC (2.0–5.0 V), GND, AOUT (analog data output).
- Operating principle: moist-soil conduction switches the base-emitter path of a transistor; collector current is converted to a voltage across a resistor for the ADC.
- Raspberry Pi Pico: MicroPython and C examples are provided; the matching firmware must be flashed to the Pico before use.
- Pico wiring: VCC → 3.3 V, GND → GND, AOUT → GP26 (ADC channel).
- STM32 examples target STM32F103RBT6 or STM32H743; the shown connection uses PA6 for AOUT at 3.3 V.
- Arduino example targets the UNO: VCC → 5 V, GND → GND, AOUT → A0.
- Expected behavior: when the probe is inserted into soil and water is gradually added, the serial output value changes accordingly.
- FAQ note: if the output stays constant, the threshold voltage may be set too high; adjust it to an appropriate value.
Commands and examples – verify before use:
sudo apt-get install p7zip-full
cd ~
sudo wget https://files.waveshare.com/upload/5/59/Moisture-Sensor-code.7z
7z x Moisture-Sensor-code.7z -o./Moisture-Sensor-code
cd ~/Moisture-Sensor-code/Pico/c/build/
export PICO_SDK_PATH=../../pico-sdk
cmake ..
make -j9
cp main.uf2 /media/pi/RPI-RP2/
Notes and version constraints
- The Pico firmware version (e.g., rp2-pico-20210418-v1.15.uf2) is version-sensitive; verify that the firmware matches the sample code before flashing.
- The STM32 example assumes the HAL library and Keil; porting to other STM32 boards requires custom adaptation.
- The Arduino example is tailored to the UNO; compatibility with other Arduino boards must be verified separately.
- If the reading is constant: adjust the threshold voltage in the code, then recompile/re-flash.
- The source provides no certification, warranty, or safety-classification information; such claims are not supported here.
Source and revision record
- Moisture Sensor - Waveshare Wiki
- Source revision: 68933
- Captured: 2026-08-29T09:37:52+00:00
- SHA-256:
7356ccfbfb51727f9e2986e6d299575793332ff4f51350a370c87e4489e0b1b8