A Soil Moisture Sensor measures the volumetric water content in soil. Common resistive sensors feature two exposed probes that insert into the soil; water content increases the soil's electrical conductivity (lowers resistance). The sensor outputs both a variable analog voltage (AO) and a digital threshold alert (DO).
1. Hardware Specifications & Pinout
- Operating Voltage: 3.3V to 5.0V.
- Outputs: Dual output module (Analog + Digital).
- Pin Configuration:
- VCC: Power input.
- GND: Ground.
- AO (Analog Output): Outputs variable voltage. Note: Higher water content (wet) increases conductivity, resulting in a lower voltage output. Dryer soil gives a higher voltage output.
- DO (Digital Output): Triggered LOW when moisture rises above the threshold set by the onboard blue potentiometer — modeled in OMS as a real
thresholdproperty (Section 3), not just a fixed physical knob.
2. How it Works & Calibration
- Inverse Relation: Because dry soil has high resistance, the analog output behaves inversely to moisture. Dry soil reads near VCC (e.g. 1023 or 4095), while wet soil reads near GND (e.g. <300).
- Calibration: You should record the raw values in:
- Open air (0% moisture baseline, e.g., 1023).
- Submerged in a cup of water (100% moisture baseline, e.g., 200).
- The OMS Blockly blocks automatically handle this mapping so that the percentage block returns 100% for wet and 0% for dry.
3. Component Properties (Property Inspector)
When you select the Soil Moisture Sensor on the canvas, you can modify the following parameters in the Property Inspector panel:
- Moisture (
moisture): Simulates the moisture percentage of the soil.- Default:
50% - Range:
0% (bone dry) to100% (fully saturated)
- Default:
- Threshold (
threshold): Simulates the onboard comparator trimpot — the DO pin fires oncemoisturecrosses this value.- Default:
50% - Range:
0% to100%
- Default:
There's no separate "VCC Voltage" property — the sensor's actual supply voltage comes from
whatever real circuit voltage you wire to its VCC pin, not a configurable prop. Dropping below
3.0V while powered triggers a real LOW VCC fault (see Section 6).

