Interfacing Soil Moisture Sensor Module with Arduino


Today we Interfacing Soil Moisture Sensor Module with Arduino, Maintaining optimal soil moisture levels is vital for plant health and successful agriculture. The Soil Moisture Sensor Module offers a practical solution for monitoring soil moisture, helping gardeners and farmers make informed decisions about irrigation and plant care. In this comprehensive guide, we will explore the working principle and features of the Soil Moisture Sensor Module. Additionally, we will learn how to interface it with an Arduino UNO to create a soil moisture monitoring system. By the end of this tutorial, you will have the knowledge and skills to integrate the sensor into your gardening or farming projects, ensuring your plants receive the right amount of water for healthy growth. So, let’s delve into the world of soil moisture sensing with Arduino and nurture thriving plants!

Hardware Required

You will require the following Hardware Components for Interfacing Soil Moisture Sensor Module with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Now
Soil Moisture Sensor Module1Buy Now
9v DC Adapter (Optional)1Buy Now
Jumper WiresFewBuy Now
Breadboard1Buy Now

What is Soil Moisture Sensor?

The Soil Moisture Sensor Module is an analog sensor designed to measure the moisture content in the soil. It typically consists of two probes that are inserted into the soil. As the soil moisture changes, the electrical conductivity between the probes changes as well. The sensor then translates this change in conductivity into an analog voltage output, which can be read by the Arduino UNO through its analog input pins. By calibrating the sensor with dry and wet soil readings, you can accurately determine the soil’s moisture level and make irrigation decisions accordingly.



Pin Configuration

Pin NamePin Type
VCCModule power supply – 2-5 V
GNDGround Pin
OUTAnalog Voltage Output


  1. Moisture Detection Range: The Soil Moisture Sensor Module can measure soil moisture levels within a specified range, enabling precise readings.
  2. Analog Output: The sensor provides analog output, making it compatible with Arduino UNO’s analog input capabilities.
  3. Operating Voltage: The sensor operates within the voltage range suitable for Arduino UNO, ensuring seamless integration into projects.
  4. Compact Size: The small form factor of the Soil Moisture Sensor Module allows for easy insertion into soil.


  1. Non-Destructive Soil Testing: The sensor’s non-destructive nature allows for repeated testing without harming the plants or soil.
  2. Fast Response Time: The sensor exhibits a fast response time, enabling real-time monitoring and quick adjustments to irrigation schedules.
  3. Cost-Effective: The affordability of the sensor makes it accessible to gardeners, farmers, and hobbyists alike.

Circuit Diagram

The following circuit shows you the connection of the Interfacing Soil Moisture Sensor Module with Arduino, Please make the connection carefully


Circuit Connections


Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow


//For more Projects:

#define SensorPin A0 
float sensorValue = 0; 
void setup() { 
void loop() { 
  for (int i = 0; i <= 100; i++) 
    sensorValue = sensorValue + analogRead(SensorPin); 
  sensorValue = sensorValue/100.0;
  float soil_Pin_voltage = sensorValue * 5.00 / 1023.0;  //calculate sensor output voltage
  Serial.print(" Soil Moisture Sensor Voltage: ");
  Serial.print(soil_Pin_voltage);       //display sensor output voltage
  Serial.println(" V");

Output Result

This code reads the analog output voltage from the sensor every second and displays it in the Serial Monitor. To ensure accuracy and stability, it takes an average of 100 sensor data for each soil moisture measurement.



  1. Smart Irrigation Systems: The Soil Moisture Sensor Module can be used in smart irrigation systems to regulate water supply based on soil moisture levels, conserving water resources and optimizing plant health.
  2. Greenhouses and Indoor Gardens: The sensor is valuable in greenhouse and indoor gardening setups to ensure plants receive adequate moisture for optimal growth.
  3. Plant Watering Alarms: By incorporating the sensor into plant watering systems, users can receive alerts when soil moisture levels drop below a specified threshold, prompting timely watering.
  4. Agricultural Research: The sensor is used in agricultural research for studying soil moisture variations and their impact on crop growth and yield.
  5. Soil Moisture Mapping: In large agricultural fields, the sensor can be employed for soil moisture mapping to identify areas with varying water retention capabilities.


You have now gained valuable insights into the Soil Moisture Sensor Module and its applications in plant health monitoring. By interfacing the sensor with Arduino UNO, you can create smart irrigation systems, indoor gardening setups, and more, promoting efficient water usage and thriving plant growth. The sensor’s fast response time and accurate readings make it a valuable tool for agriculture, gardening, and research projects. Armed with this knowledge, you can now embrace the power of soil moisture sensing and nurture healthy, vibrant plants with the Soil Moisture Sensor Module and Arduino

Leave a Comment