Stufin
Home Quick Cart Profile

Analog Capacitive Soil Moisture Sensor

Buy Now on Stufin

Operating Voltage

3.3V to 5V

Operating Current

<10mA

Output Signal

Analog (0-5V)

Measurement Range

0-100% soil moisture

Accuracy

5% (at 20C)

Response Time

<1 second

Temperature Range

-20C to 70C

Humidity Range

20% to 90% RH

Applications

  • Agriculture: Monitor soil moisture levels to optimize irrigation systems, reduce water waste, and improve crop yields.
  • Horticulture: Track soil moisture in greenhouses, green roofs, and indoor gardens to ensure optimal growing conditions.
  • Environmental Monitoring: Use the sensor to monitor soil moisture levels in ecosystems, tracking changes in soil health and water cycles.
  • Smart Home Automation: Integrate the sensor into smart home systems to automate irrigation and lawn care tasks.

By providing accurate and reliable soil moisture measurements, the Analog Capacitive Soil Moisture Sensor is an essential component for various IoT applications, enabling users to make informed decisions and optimize their systems for improved performance and efficiency.

Pin Configuration

  • Analog Capacitive Soil Moisture Sensor Documentation
  • Pin Description:
  • The Analog Capacitive Soil Moisture Sensor has 4 pins, each with a specific function. Here's a detailed explanation of each pin:
  • Pin 1: VCC
  • Function: Power supply pin
  • Description: This pin is used to power the sensor. It requires a DC voltage supply within the range of 3.3V to 5V.
  • Connection: Connect VCC pin to a power source, such as a microcontroller's VCC output or a battery.
  • Pin 2: GND
  • Function: Ground pin
  • Description: This pin is used to provide a ground connection to the sensor.
  • Connection: Connect GND pin to a ground terminal, such as a microcontroller's GND output or a battery's negative terminal.
  • Pin 3: OUT
  • Function: Analog output pin
  • Description: This pin provides an analog voltage output that varies depending on the soil moisture level. The output voltage range is typically between 0V and VCC.
  • Connection: Connect OUT pin to an analog-to-digital converter (ADC) input on a microcontroller or a dedicated analog input pin.
  • Pin 4: NC (Not Connected)
  • Function: No connection
  • Description: This pin is not connected to any internal circuitry and should be left unconnected.
  • Connection Structure:
  • To connect the Analog Capacitive Soil Moisture Sensor to a microcontroller or other devices, follow this structure:
  • Connect VCC pin to a power source (e.g., microcontroller's VCC output or a battery's positive terminal).
  • Connect GND pin to a ground terminal (e.g., microcontroller's GND output or a battery's negative terminal).
  • Connect OUT pin to an analog-to-digital converter (ADC) input on a microcontroller or a dedicated analog input pin.
  • Leave Pin 4 (NC) unconnected.
  • Example Connection Diagram:
  • Here's an example connection diagram for an Arduino Uno board:
  • Arduino Uno | Soil Moisture Sensor
  • -----------|-------------------
  • VCC | VCC
  • GND | GND
  • A0 | OUT
  • (NC) | NC (Leave unconnected)
  • In this example, the VCC pin of the soil moisture sensor is connected to the VCC output of the Arduino Uno, the GND pin is connected to the GND output of the Arduino Uno, and the OUT pin is connected to analog input pin A0 on the Arduino Uno.

Code Examples

Analog Capacitive Soil Moisture Sensor Documentation
Overview
The Analog Capacitive Soil Moisture Sensor is a widely used IoT component designed to measure the moisture levels in soil. This sensor operates on the principle of capacitive measuring, which detects changes in capacitance caused by variations in soil moisture. The sensor provides an analog output signal that can be easily interfaced with microcontrollers, such as Arduino or Raspberry Pi.
Technical Specifications
Operating Voltage: 3.3V to 5V
 Output Voltage Range: 0V to 3.3V (analog)
 Sensitivity: 0.5% to 100% soil moisture
 Accuracy: 5%
 Response Time: < 1 second
 Interface: Analog output
Code Examples
### Example 1: Basic Soil Moisture Measurement using Arduino
This example demonstrates how to connect the Analog Capacitive Soil Moisture Sensor to an Arduino board and read the soil moisture levels.
Hardware Connection:
Connect the VCC pin of the sensor to the 5V pin of the Arduino board.
 Connect the GND pin of the sensor to the GND pin of the Arduino board.
 Connect the OUT pin of the sensor to an analog input pin (e.g., A0) of the Arduino board.
Code:
```c
const int soilMoisturePin = A0;  // Analog input pin
void setup() {
  Serial.begin(9600);
}
void loop() {
  int soilMoistureValue = analogRead(soilMoisturePin);
  float soilMoisturePercentage = map(soilMoistureValue, 0, 1023, 0, 100);
  Serial.print("Soil Moisture: ");
  Serial.print(soilMoisturePercentage);
  Serial.println("%");
  delay(1000);
}
```
In this example, the Arduino board reads the analog output from the sensor using the `analogRead()` function and maps the value to a percentage using the `map()` function. The soil moisture level is then printed to the serial console.
### Example 2: Soil Moisture Monitoring using Raspberry Pi with Python
This example demonstrates how to connect the Analog Capacitive Soil Moisture Sensor to a Raspberry Pi and monitor the soil moisture levels using Python.
Hardware Connection:
Connect the VCC pin of the sensor to a 3.3V pin of the Raspberry Pi.
 Connect the GND pin of the sensor to a GND pin of the Raspberry Pi.
 Connect the OUT pin of the sensor to an analog input pin (e.g., GPIO 18) of the Raspberry Pi.
Code:
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
soilMoisturePin = 18  # Analog input pin
while True:
    soilMoistureValue = GPIO.input(soilMoisturePin)
    soilMoisturePercentage = (soilMoistureValue / 1023.0)  100
    print("Soil Moisture: {:.2f}%".format(soilMoisturePercentage))
    time.sleep(1)
```
In this example, the Raspberry Pi reads the analog output from the sensor using the `GPIO.input()` function and calculates the soil moisture percentage. The soil moisture level is then printed to the console.
Note: In both examples, the sensor's output voltage range is assumed to be 0V to 3.3V. If your sensor has a different output range, you may need to adjust the code accordingly.