Moisture Sensor interface with Arduino

Tutorials
Moisture Sensor

The ability to measure soil moisture levels accurately is an essential aspect of modern farming. Moisture sensors are used to provide farmers with real-time information on the moisture content of their soil, helping them to make informed decisions about irrigation, fertilization, and other farming practices. Arduino is a popular open-source electronics platform that can be used to interface with moisture sensors and other agricultural sensors, making it an ideal tool for modern farming.

In this article, we will explore how to interface a moisture sensor with an Arduino. We will discuss the materials and tools you will need, the steps to follow, and some tips and tricks to ensure success.

Also read

Component Required 

  1. Moisture Sensor Module
  2. Arduino UNO
  3. Motor for irrigation(here we use LED for Testing) 
  4. PC 

Objectives

  1. To Calculate the Moisture Level in Soil
Fig:- Circuit Diagram

Connect the component as shown in the figure.Connect A0 pin of sensor to A0 pin of Arduino , VCC to 3.5V  and GND pin to GND pin of Arduino. Connect led in 12 pin of arduino to view the output.

Code

 int led =13;
int Moisture_sensor = A0;
void setup()
{ pinMode(led,OUTPUT);
   pinMode(Moisture_sensor,INPUT);
   Serial.begin(9600);
}
void loop()
{
  int value = analogRead(Moisture_sensor);
{
   Serial.println(value);
  if (value>500)
 {
  digitalWrite(led,HIGH);
 }
else
 {
 digitalWrite(led,LOW);
}
}
}

Sensor show its value low in the presence of moisture and its value is gradually increase in the absence of moisture. When the sensor reading is higher then 500 then the LED is turn ON .

Discussion (5)

How to controlled LEDS from Webpage using ESP8266
July 7, 2025
[…] Moisture Sensor interface with Arduino […]
Androids Apps controlled Robot using Arduino - SamkarTech
February 24, 2023
[…] Moisture Sensor interface with Arduino […]
Gas sensor interface with Arduino - SamkarTech
February 24, 2023
[…] Moisture Sensor interface with Arduino […]
Ram thapa
January 14, 2023
Awesome project for beginners
Working at Walmart
October 29, 2022
Thanks so much!

Share Your Thoughts

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