Soil Moisture Sensor on Arduino

Viewing a single blog post

Soil Moisture Sensor on Arduino


Detailed Tutorial

1. Introduction:

This tutorial explains how to read soil moisture data using Analog Soil Moisture Sensor on Arduino Platform.

Robo India offers Soil moisture sensor that gives analog signal. So here in this tutorial we are reading data from Analog Moisture Sensor, so we will get reading in the range 0 to 1023. Lesser the value means lesser the moisture in soil.

2. Circuit

Make following connections of Analog Soil Moisture Sensor to Arduino in the following manner.


3. Programming

You may download following code from here.

const int soil_sensor = A0;  // Analog input pin that the soil moisture sensor is attached to
int sensorValue = 0;         // store sensor input value

void setup() {
  // initialize serial communications at 9600 bps:

void loop() {
  // read the sensor:
  sensorValue = analogRead(soil_sensor);            
  // print the sensor results to the serial monitor:
  Serial.print("Moisture Value = " );                       

  // delay of one second

6. Output

Run the following code and you will get the following output.


This is how to use analog soil mositure sensors on Arduino

Posted in Arduino on Aug 01, 2017


Please sign in to comment!