Arduino Tutorials – Lesson 17 – Soil Moisture Sensor Using Arduino UNO

Creating Soil Moisture Sensor program using Arduino UNO

Required Components

  1. Soil sensor -1 no
  2. Arduino UNO -1 no
  3. Connecting Wires -1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect the Soil moisture to the Arduino UNO board.
  3. Connect the Arduino UNO board A0 pin to the Soil moisture(Analog or Digital).
  4. Connect the interfacing to the Arduino UNO board.
  5. Connect Humidity Sensor board VCC, GND to 5V, GND of Arduino Uno Board.
  6. Check the Cicuit Connections.
  7. Check the Arduino program.
  8. Run the Arduino program.

Arduino Program

int sensorPin = A0;
int sensorValue;
int limit = 300;

void setup( )
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop( )
{
  sensorValue = analogRead(sensorPin);
  Serial.println("Analog Value : ");
  Serial.println(sensorValue);
  if (sensorValue<limit)
  {
    digitalWrite(13, HIGH);
  }
  else{
    digitalWrite(13, LOW);
  }
  delay(1000);
}

Usage

  1. Agricultural science and horticulture
  2. Irrigation planning
  3. Climate research
  4. Solute transport studies
  5. Auxiliary sensors for soil respiration

Leave a Reply

Your email address will not be published. Required fields are marked *