How to Use Soil Moisture Sensore Using Arduino

Introduction: How to Use Soil Moisture Sensore Using Arduino

About: someone who likes electronics Yt channel : IG 1 : sottong_teknik

Soil Moisture sensor is a sensor that can be used to measure moisture in the soil. Suitable for making prototypes of Smart farming projects, Irrigation controllers projects , or IoT Agriculture projects.

This sensor has 2 probes. Which is used to measure soil resistance.

When the soil is moist or wet the resistance will be different than when the soil is dry. The sensor will read the resistance in each circumstance and convert it into humidity data.

Step 1: Required Components

The following components are required:

Step 2: Assemble All Components

Connect the Arduino board to Soil Moisture Sensore. See the picture or instruction that I wrote below:

Soil Moisture to Arduino

VCC ==> +5V


AO ==> A0

Step 3: Make a Sketch

Soil moisture sensors can be directly read without using an additional library. You can use analog input to read the sensor value.

This is the Sketch that I made to read the sensor value:

int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {

Serial.begin(9600); }

void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); Serial.println(sensorValue); delay(1000); }

or download the file I include below

Step 4: Results

When I put the sensor outside the bottle, the displayed value is around 700 to 1023.

When I put the sensor in a water bottle, the displayed value is around 250 to 700.

can be concluded that:

  • a value of 250 to 700 means moist
  • value 700 to 1023 means dry

You can calibrate it, when you try it

Be the First to Share


    • Paint Challenge

      Paint Challenge
    • Unusual Uses Contest

      Unusual Uses Contest
    • Made with Math Contest

      Made with Math Contest