blogs

Moisture Sensor interface with Arduino

22 August, 2022 SamkarTech

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 .


About author

SamkarTech

SamkarTech



4 Comments

Androids Apps controlled Robot using Arduino - SamkarTech 2 years ago

[…] Moisture Sensor interface with Arduino […]

Reply

Gas sensor interface with Arduino - SamkarTech 2 years ago

[…] Moisture Sensor interface with Arduino […]

Reply

Ram thapa 2 years ago

Awesome project for beginners

Reply

Working at Walmart 2 years ago

Thanks so much!

Reply

Leave a Reply

Leave a Reply

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