Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Capacitive Soil Moisture Sensor M2: Examples, Pinouts, and Specs

Image of Capacitive Soil Moisture Sensor M2
Cirkit Designer LogoDesign with Capacitive Soil Moisture Sensor M2 in Cirkit Designer

Introduction

The Capacitive Soil Moisture Sensor M2 is a reliable and efficient device designed to measure the volumetric water content in soil. Unlike resistive soil moisture sensors, this capacitive sensor detects changes in soil capacitance, which varies with moisture levels. This design ensures better durability and resistance to corrosion, making it ideal for long-term use in agricultural, gardening, and environmental monitoring applications.

Explore Projects Built with Capacitive Soil Moisture Sensor M2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Smart Soil Moisture and Temperature Monitoring System with Solar Power
Image of THEISISSSSSS POWERBANK: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
This circuit is a soil moisture and environmental monitoring system using an ESP32 microcontroller. It integrates multiple capacitive soil moisture sensors and a DHT22 temperature and humidity sensor to collect data, which can be processed or transmitted by the ESP32. The system is powered by a solar charger power bank, ensuring sustainable operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Wi-Fi Connected Soil Moisture Monitoring System
Image of 2: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
This circuit consists of an ESP32 microcontroller connected to a capacitive soil moisture sensor. The ESP32 provides power to the sensor and reads the analog output from the sensor to monitor soil moisture levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Smart Irrigation System with Soil Moisture Sensors and ESP8266
Image of mohamed tarek: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
This circuit is an automated irrigation system that uses capacitive soil moisture sensors to monitor soil moisture levels and controls solenoid valves and a water pump via relays. The system is managed by an ESP8266 NodeMCU, which processes sensor data and actuates the relays to regulate water flow based on the moisture readings.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wemos D1 Mini Based Soil Moisture and Temperature Monitoring System
Image of pfe2: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
This circuit features a Wemos D1 Mini microcontroller connected to an AHT10 temperature and humidity sensor and a capacitive soil moisture sensor. The AHT10 communicates with the Wemos D1 Mini via I2C (with SDA connected to D2 and SCL to D1), while the soil moisture sensor's analog output is connected to the A0 pin of the Wemos D1 Mini. Both sensors and the microcontroller share a common power supply, with the 3V3 pin of the Wemos D1 Mini providing power to the sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Capacitive Soil Moisture Sensor M2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of THEISISSSSSS POWERBANK: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
ESP32-Based Smart Soil Moisture and Temperature Monitoring System with Solar Power
This circuit is a soil moisture and environmental monitoring system using an ESP32 microcontroller. It integrates multiple capacitive soil moisture sensors and a DHT22 temperature and humidity sensor to collect data, which can be processed or transmitted by the ESP32. The system is powered by a solar charger power bank, ensuring sustainable operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 2: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
ESP32-Based Wi-Fi Connected Soil Moisture Monitoring System
This circuit consists of an ESP32 microcontroller connected to a capacitive soil moisture sensor. The ESP32 provides power to the sensor and reads the analog output from the sensor to monitor soil moisture levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of mohamed tarek: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
Wi-Fi Controlled Smart Irrigation System with Soil Moisture Sensors and ESP8266
This circuit is an automated irrigation system that uses capacitive soil moisture sensors to monitor soil moisture levels and controls solenoid valves and a water pump via relays. The system is managed by an ESP8266 NodeMCU, which processes sensor data and actuates the relays to regulate water flow based on the moisture readings.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of pfe2: A project utilizing Capacitive Soil Moisture Sensor M2 in a practical application
Wemos D1 Mini Based Soil Moisture and Temperature Monitoring System
This circuit features a Wemos D1 Mini microcontroller connected to an AHT10 temperature and humidity sensor and a capacitive soil moisture sensor. The AHT10 communicates with the Wemos D1 Mini via I2C (with SDA connected to D2 and SCL to D1), while the soil moisture sensor's analog output is connected to the A0 pin of the Wemos D1 Mini. Both sensors and the microcontroller share a common power supply, with the 3V3 pin of the Wemos D1 Mini providing power to the sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Smart irrigation systems: Automating watering schedules based on soil moisture levels.
  • Gardening and agriculture: Monitoring soil conditions for optimal plant growth.
  • Environmental monitoring: Measuring soil moisture in research and conservation projects.
  • DIY projects: Integrating with microcontrollers like Arduino for hobbyist applications.

Technical Specifications

  • Operating Voltage: 3.3V to 5.5V
  • Output Type: Analog voltage (proportional to soil moisture level)
  • Current Consumption: < 20mA
  • Interface: Analog or digital output
  • Dimensions: 98mm x 23mm x 3mm
  • Material: Corrosion-resistant PCB
  • Operating Temperature: -40°C to 85°C

Pin Configuration and Descriptions

The Capacitive Soil Moisture Sensor M2 has a 3-pin interface. The table below describes each pin:

Pin Name Description
1 VCC Power supply pin. Connect to 3.3V or 5V.
2 GND Ground pin. Connect to the ground of the power supply or microcontroller.
3 AOUT Analog output pin. Provides a voltage proportional to the soil moisture level.

Usage Instructions

How to Use the Sensor in a Circuit

  1. Wiring the Sensor:

    • Connect the VCC pin to the 3.3V or 5V power supply of your microcontroller.
    • Connect the GND pin to the ground of your microcontroller.
    • Connect the AOUT pin to an analog input pin on your microcontroller (e.g., A0 on an Arduino UNO).
  2. Placement:

    • Insert the sensor into the soil at the desired depth. Ensure the sensor's PCB is fully in contact with the soil for accurate readings.
    • Avoid placing the sensor in waterlogged soil for extended periods, as this may affect accuracy.
  3. Reading the Output:

    • The sensor outputs an analog voltage that decreases as soil moisture increases. Dry soil results in a higher voltage, while wet soil results in a lower voltage.

Important Considerations and Best Practices

  • Calibration: Calibrate the sensor for your specific soil type to improve accuracy. Record the sensor's output voltage for dry and saturated soil, and use these values to map the voltage to moisture levels.
  • Power Supply: Use a stable power supply to avoid fluctuations in readings.
  • Environmental Protection: While the sensor is corrosion-resistant, avoid prolonged exposure to water or extreme conditions to extend its lifespan.
  • Avoid Damage: Do not bend or apply excessive force to the sensor's PCB.

Example Code for Arduino UNO

The following code demonstrates how to read the sensor's analog output using an Arduino UNO and display the moisture level in the Serial Monitor.

// Define the analog pin connected to the sensor
const int sensorPin = A0;

void setup() {
  // Initialize the Serial Monitor for debugging
  Serial.begin(9600);
}

void loop() {
  // Read the analog value from the sensor
  int sensorValue = analogRead(sensorPin);

  // Map the sensor value to a percentage (0% to 100%)
  // Adjust the min and max values based on calibration
  int moisturePercent = map(sensorValue, 1023, 300, 0, 100);

  // Print the moisture level to the Serial Monitor
  Serial.print("Soil Moisture: ");
  Serial.print(moisturePercent);
  Serial.println("%");

  // Wait for 1 second before the next reading
  delay(1000);
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Inconsistent Readings:

    • Cause: Unstable power supply or loose connections.
    • Solution: Ensure all connections are secure and use a regulated power supply.
  2. No Output or Incorrect Values:

    • Cause: Incorrect wiring or damaged sensor.
    • Solution: Double-check the wiring and ensure the sensor is not physically damaged.
  3. Sensor Not Responding:

    • Cause: Soil is too dry or sensor is not properly inserted.
    • Solution: Ensure the sensor is fully inserted into the soil and check the soil condition.
  4. Corrosion or Damage:

    • Cause: Prolonged exposure to waterlogged soil or harsh conditions.
    • Solution: Use the sensor in well-drained soil and avoid submerging it in water.

FAQs

Q1: Can this sensor be used with a Raspberry Pi?
Yes, the sensor can be used with a Raspberry Pi. However, since the Raspberry Pi does not have built-in analog input pins, you will need an external ADC (Analog-to-Digital Converter) module to read the sensor's output.

Q2: How do I calibrate the sensor?
To calibrate, measure the sensor's output voltage in completely dry soil and fully saturated soil. Use these values to map the sensor's output to a percentage or other meaningful scale.

Q3: Is the sensor waterproof?
The sensor is water-resistant but not fully waterproof. Avoid submerging it in water for extended periods to prevent damage.

Q4: Can this sensor measure moisture in other materials?
The sensor is optimized for soil but may work with other porous materials. Calibration is required for accurate results.