Arduino Full Course
About Lesson

Prerequisite

  • Basic knowledge of soil and plant growth
  • Current
  • Voltage
  • Resistor
  • Conductor

Learning Objectives

  • Learn terminologies like resistivity ,electrical conductors, conductivity.
  • Understand the importance of soil moisture for plant growth.
  • Learn how to use and interpret data from a soil moisture sensor to make informed decisions in gardening or agriculture.

Applications of soil moisture sensor.

  1. Is soil a conductor of electricity or not?
  2. why soil moisture is important for plants?
  3. What are the primary applications of soil moisture sensors in agriculture and environmental science, and how do they contribute to efficient resource management?
  4. How do soil moisture sensors distinguish between different soil types and adjust irrigation recommendations accordingly?
  5. What are the challenges and limitations of soil moisture sensors in providing accurate measurements, especially in varying soil conditions and climates?
  6. How do soil moisture sensors support ecological research and environmental monitoring, such as assessing drought conditions or studying plant-soil interactions?
  7. What ethical considerations are associated with using soil moisture sensors, particularly concerning water conservation and sustainable farming practices?
  8. How do soil moisture sensors contribute to precision agriculture and the responsible use of water resources in farming?

How do soil moisture sensors measure the moisture content of soil.

Resistor

A resistor is an electrical component that regulates the flow of electrical current in a circuit. It is a passive component, it means resistor doesn’t generate electrical energy but rather dissipates it as heat. Resistors are essential in electronic circuits for controlling voltages and currents, adjusting signal levels, and protecting components.

Formulation

R=V/ I

ā€‹where:

R is resistance in ohms,

V is voltage in volts,

I is current in amperes

Ā 

Ā 

Ā 

Resistivity

Resistivity decreases as water content increases because water reduces the soil’s resistance to the flow of electrical current.

What is use of resistor in soil moisture sensor?

Ā 

A soil moisture sensor uses a resistor to measure soil moisture by measuring the change in electrical resistance of the soil.

How resistor works?

A soil moisture sensor has two or more electrodes that are buried in the soil.Ā When an electric current passes through the electrodes, it creates an electromagnetic field in the soil.Ā The sensor measures the soil’s moisture content by measuring the change in resistance value.Ā 

The sensor’s probe acts as a variable resistor, and its resistance changes based on the soil’s water content.Ā If more water in the soil, the lower the resistance, and the better the conductivity.Ā 

Ā 

Electrical Conductor

electrical conductor is defined as materials that allow electricity to flow easily through them.

Some examples of conductors of electricity are:

  • Water
  • Copper
  • Silver
  • Gold

Ā 

Ā 

Conductivity

This property of conductors that allow them to conduct electricity is known asĀ conductivity. The flow of electrons in a conductor is known as theĀ electric current. The force required to make that current flow through the conductor is known asĀ voltage.

ConductivityĀ  increases when the soil contains more water because water is a conductor (especially if it contains dissolved salts).

Ā Based on these measurements, the sensor infers the moisture level in the soil, giving an estimate of how much water is present.

Ā 

Ā 

Soil Moisture Sensor

  • A soil Moisture sensor is an instrument which, when placed in a soil for period of time, provides information related to the soil water status of the soil.
  • The sensors which are used to measures the water content of soil are called Soil moisture sensors.
  • Water plays an active role in the development of the crops. Better crops leads to the high yields.
  • It is important to know when to water and how much to water constantly for the better production of corps.
  • Use of correct Soil moisture sensors helps to ease out the pain which can monitors and keep records about the changes in soil moisture starting form cultivation to harvesting period of crops.
  • Proper water management is possible through the use of this sensor technology.

Working Principle of Soil Moisture Sensor

  • Strictly speaking moisture sensor does not measures moisture but measures conductivity or resistivity of soil.
  • Moisture sensor has two probes to pass current through the soil then it reads resistance (conductance) in the soil.
  • Less moisture (water) in soil results in higher resistance i.e., dry soil.
  • More moisture (water) in soil results in lesser resistance and sensor thus relates moisture content.

Ā 

Several types of soil moisture sensors:

Capacitance sensors: These sensors measure the dielectric constant of the soil, which changes as the moisture content of the soil changes.

Ā 

Tensiometers: These sensors measure the suction pressure of the soil, which is related to the moisture content of the soil.

Ā 

Ā 

Time Domain Reflectometry (TDR) sensors: These sensors measure the time it takes for a high-frequency pulse to travel through the soil, which is related to the soil moisture content.

Ā 

Ā 

Scientific principle of soil moisture sensor

Principles of Conductivity: Soil moisture sensors typically rely on the scientific principle that water conducts electricity better than dry soil. By measuring the electrical conductivity between two metal probes, the sensor can determine the moisture content of the soil.

ConductivityĀ  increases when the soil contains more water because water is a conductor (especially if it contains dissolved salts).

Ā Based on these measurements, the sensor infers the moisture level in the soil, giving an estimate of how much water is present.

Ā 

Mathematical calculation

Ā 

Formulation of soil moisture content:

soil moisture content=W/M*100%

whereĀ Ā Ā Ā Ā Ā 

M = weight of soil moisture before drying
W= W is the weight of soil moisture, that is, the difference between M and the weight of soil after Ā  drying Mā€™.
W= Mā€™-M
Mā€™= weight of soil after drying

Ā 

Features of Soil Moisture Sensor

  • This sensor has low power consumption and high sensitivity. (Sensitivity should not be confused with accuracy)
  • Operates on low voltage of 5V.
  • Operates on low current <23mA.
  • Weighs only 3 gram.

Applications of Soil Moisture Sensor

  • Irrigation management: Soil moisture sensors can be used to determine when plants need to be watered, reducing water waste and increasing plant growth.
  • Environmental monitoring: Soil moisture sensors can be used to monitor soil moisture levels in natural ecosystems, helping to identify areas that may be at risk of drought or other environmental stressors.
  • Crop management: soil moisture sensor can be used to optimize crop yields by providing precise information on soil moisture levels and ensuring that crops are not over- or under-watered.

Other Applications

  • Gardening
  • Construction (Determine soil compaction levels for construction projects)
  • Weather Forecasting
  • Research (scientific studies on soil behavior)
  • Sports Turf Management
  • Horticulture and Nursery Management
  • Hydrology and Watershed Management

Ā 

Pin configuration

  • VCC: The sensor receives power from this pin. Normally, it is wired to a positive supply voltage, like 3.3V or 5V.
  • GND: This pin serves as the sensor’s connection to the ground potential or reference voltage. It ought to be connected to the system’s or power supply’s ground.
  • Analog output: Some soil moisture sensors offer an analogue output that is directly related to the amount of soil moisture. To read the moisture level, this pin is used to connect the sensor’s analogue output to an analogue input pin on a microcontroller or other device.
  • Digital Output: A digital output option is available with some soil moisture sensors. The digital output of the sensor is connected to a digital input pin of a microcontroller or other device using this pin. A binary signal (for example, high/low) indicating a threshold moisture level may be provided by the digital output.

Ā 

Ā 

Activity ā€“ Moisture (Water) measurement in Soil by using Soil Moisture Sensor

Components used in this activity ā€“

  • Arduino UNO
  • Soil Moisture Sensor
  • 16X2 LCD Display with I2C Module

Ā 

Ā 

Ā 

Ā 

Ā 

Ā 

Ā 

Ā 

Ā 

Ā 

Circuit Diagram

Ā 

Steps to Follow Connections

  • Connect ā€˜VCCā€™ of sensor to ā€˜+5Vā€™ pin of Arduino.
  • Connect ā€˜GNDā€™ of sensor to ā€˜GNDā€™ pin of Arduino.
  • Connect ā€˜A0ā€™ pin of sensor to ā€˜pin A0ā€™ of Arduino.
  • Connect ā€˜VCCā€™ of LCD display to ā€˜+5Vā€™ pin of Arduino.
  • Connect ā€˜GNDā€™ of LCD display to ā€˜GNDā€™ pin of Arduino.
  • Connect ā€˜SCLā€™ of LCD display to ā€˜SCLā€™ pin of Arduino.
  • Connect ā€˜SDAā€™ of LCD display to ā€˜SDAā€™ pin of Arduino.

Processing Code

int sensorPin = A0;

int sensorValue = 0;

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

byte degree[8] =

{

0b00011,

0b00011,

0b00000,

0b00000,

0b00000,

0b00000,

0b00000,

0b00000

};

void setup()

{

lcd.begin(16,2);

lcd.createChar(1, degree);

lcd.setCursor(2,0);

lcd.print("Arduino Point");

lcd.setCursor(2,1);

lcd.print("Soil Moisture");

delay(2000);

lcd.clear();

Serial.begin(9600);

}

void loop()

{

sensorValue = analogRead(sensorPin);

Ā 

Ā Serial.print("Moisture Sensor Value:");

Ā Serial.println(sensorValue);

Ā 

Ā float moisturePercentage;

Ā moisturePercentage= (sensorValue/1023)*100;

Ā Serial.print("Moisture Percentage = ");

Ā Serial.print(moisturePercentage);

Ā Serial.print("%n");

Ā 

Ā 

Ā if(sensorValue < 300){

Ā  Serial.println("I am thirsty, please give me water");

Ā }

Ā else if(sensorValue > 300 && sensorValue < 700){

Ā  Serial.println("I feel so comfortable");

Ā }

Ā if(sensorValue > 700){

Ā  Serial.println("Too much water, I might get hurt");

Ā }

Ā 

Serial.print("n");

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Soil Moisture");

lcd.setCursor(0,1);

lcd.print(sensorValue);

lcd.setCursor(6,1);

lcd.print("&");

lcd.setCursor(8,1);

lcd.print(moisturePercentage);

lcd.print(" %");

delay(500);

}

Ā 

Exercise Files
soil moisture.pdf
Size: 1.03 MB
Join the conversation
0% Complete
Skip to toolbar