Stufin
Home Quick Cart Profile

Soil Moisture Sensor Module (Pack of 25)

Buy Now on Stufin

Operating Voltage

3.3-5V

Operating Current

<20mA

Soil Moisture Range

0-100%

Resolution

1%

Accuracy

5%

Operating Temperature Range

-20C to 80C

Dimensions

30mm x 20mm

Weight

5g

Applications

Gardening and Agriculture

Monitor soil moisture levels to optimize irrigation and reduce water consumption.

Environmental Monitoring

Track soil moisture levels in natural environments to study climate change or monitor ecosystem health.

IoT Projects

Integrate the Soil Moisture Sensor Module into IoT projects, such as smart gardens or agricultural monitoring systems.

Package Contents

25 x Soil Moisture Sensor Modules

25 x Electrode probes

1 x User Manual

Note

The user manual provides detailed instructions for using the Soil Moisture Sensor Module, including wiring diagrams, datasheets, and example code for popular microcontrollers.

Pin Configuration

  • Soil Moisture Sensor Module (Pack of 25) Documentation
  • Pinout Description
  • The Soil Moisture Sensor Module has 4 pins, which are used to connect the sensor to a microcontroller or other devices. Below is a detailed description of each pin:
  • Pin 1: VCC (Red Wire)
  • Function: Power supply pin
  • Description: This pin is used to connect the positive voltage supply (typically 3.3V or 5V) to the sensor module.
  • Connection: Connect to the VCC pin of your microcontroller or a suitable power source.
  • Pin 2: GND (Black Wire)
  • Function: Ground pin
  • Description: This pin is used to connect the ground pin of the sensor module to the ground pin of your microcontroller or a suitable ground source.
  • Connection: Connect to the GND pin of your microcontroller or a suitable ground source.
  • Pin 3: DOUT (Yellow Wire)
  • Function: Digital output pin
  • Description: This pin provides a digital output signal indicating the soil moisture level. The output is a digital signal that can be connected directly to a microcontroller or other digital devices.
  • Connection: Connect to a digital input pin of your microcontroller or other digital devices.
  • Pin 4: AOUT (White Wire)
  • Function: Analog output pin
  • Description: This pin provides an analog output signal indicating the soil moisture level. The output is a voltage signal that can be connected to an analog-to-digital converter (ADC) of a microcontroller or other analog devices.
  • Connection: Connect to an analog input pin of your microcontroller or other analog devices.
  • Connecting the Pins
  • To connect the Soil Moisture Sensor Module to your microcontroller or other devices, follow these steps:
  • Connect the VCC pin (Red Wire) to the positive voltage supply of your microcontroller or a suitable power source.
  • Connect the GND pin (Black Wire) to the ground pin of your microcontroller or a suitable ground source.
  • Connect the DOUT pin (Yellow Wire) to a digital input pin of your microcontroller or other digital devices.
  • Connect the AOUT pin (White Wire) to an analog input pin of your microcontroller or other analog devices.
  • Note:
  • Make sure to connect the pins correctly to avoid damage to the sensor module or your microcontroller.
  • Use a breadboard or a PCB to connect the pins securely and avoid loose connections.
  • Refer to the datasheet of your microcontroller or other devices for specific pin connections and configuration.
  • By following these guidelines, you can successfully connect the Soil Moisture Sensor Module to your project and start measuring soil moisture levels.

Code Examples

Soil Moisture Sensor Module (Pack of 25) Documentation
Overview
The Soil Moisture Sensor Module is a widely used IoT component for measuring the moisture level in soil. It is commonly used in agricultural, horticultural, and gardening applications to monitor and control soil conditions. This module is designed to be easy to use and integrate into various projects.
Technical Specifications
Operating Voltage: 3.3V - 5V
 Output Voltage: 0-3.3V (analog) or 0-1023 (digital)
 Sensing Range: 0-100% soil moisture
 Accuracy: 10% soil moisture
 Interface: Analog or Digital (optional)
 Dimensions: 35mm x 15mm x 10mm
 Weight: 5g
Pinout
The Soil Moisture Sensor Module has three pins:
VCC (Red): Power supply (3.3V - 5V)
 GND (Black): Ground
 OUT (Yellow): Analog output (0-3.3V) or Digital output (0-1023)
Code Examples
### Example 1: Basic Analog Reading (Arduino)
Connect the Soil Moisture Sensor Module to an Arduino board as follows:
VCC to Arduino's 5V pin
 GND to Arduino's GND pin
 OUT to Arduino's Analog Input pin (A0)
Use the following code to read the soil moisture level:
```c++
const int moisturePin = A0;  // Analog input pin
void setup() {
  Serial.begin(9600);
}
void loop() {
  int moistureValue = analogRead(moisturePin);
  float moisturePercentage = map(moistureValue, 0, 1023, 0, 100);
  Serial.print("Soil Moisture Level: ");
  Serial.print(moisturePercentage);
  Serial.println("%");
  delay(1000);
}
```
This code reads the analog output from the sensor, maps it to a 0-100% scale, and prints the result to the serial monitor.
### Example 2: Digital Output with ESP32 (MicroPython)
Connect the Soil Moisture Sensor Module to an ESP32 board as follows:
VCC to ESP32's 3.3V pin
 GND to ESP32's GND pin
 OUT to ESP32's Digital Input pin (GPIO 17)
Use the following code to read the soil moisture level:
```python
import machine
import time
moisture_pin = machine.Pin(17, machine.Pin.IN)
while True:
    moisture_value = moisture_pin.value()
    if moisture_value == 1:
        print("Soil is dry")
    else:
        print("Soil is wet")
    time.sleep(1)
```
This code uses the ESP32's digital input pin to read the output from the sensor. If the output is high (1), the soil is dry; if it's low (0), the soil is wet.
### Example 3: IoT Automation with Raspberry Pi (Python)
Connect the Soil Moisture Sensor Module to a Raspberry Pi as follows:
VCC to Raspberry Pi's 3.3V pin
 GND to Raspberry Pi's GND pin
 OUT to Raspberry Pi's Analog Input pin (GPIO 18)
Use the following code to read the soil moisture level and automate watering:
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
moisture_pin = 18
GPIO.setup(moisture_pin, GPIO.IN)
while True:
    moisture_value = GPIO.input(moisture_pin)
    if moisture_value == 0:
        print("Soil is dry, watering...")
        # Trigger watering mechanism (e.g., relay module)
        time.sleep(10)  # Water for 10 seconds
    else:
        print("Soil is wet, no need to water")
    time.sleep(60)  # Check every 1 minute
```
This code uses the Raspberry Pi's analog input pin to read the output from the sensor. If the soil is dry, it triggers a watering mechanism (e.g., a relay module) to water the plants.
Note: These examples are for illustrative purposes only and may require modifications to suit your specific project requirements. Ensure you follow proper safety precautions when working with electronics and IoT components.