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.

soil_moisture_sensor_circui

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:
  Serial.begin(9600); 
}

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

  // delay of one second
  delay(1000);                     
}

6. Output

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

_soil_moisture_sensor_circu

This is how to use analog soil mositure sensors on Arduino

Posted in Arduino on Aug 01, 2017


Comments

Please sign in to comment!