0% found this document useful (0 votes)
7 views3 pages

Soil Moisture Sensor Interfacing With Arduino UNO

The document explains how to interface a soil moisture sensor with an Arduino UNO to measure the moisture content in soil. It describes the working principle of the sensor, which uses two conducting probes to measure resistance that inversely correlates with moisture levels. An example code is provided to display the moisture percentage on the serial monitor using an analog output processed by an ADC.

Uploaded by

mihonay217
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Soil Moisture Sensor Interfacing With Arduino UNO

The document explains how to interface a soil moisture sensor with an Arduino UNO to measure the moisture content in soil. It describes the working principle of the sensor, which uses two conducting probes to measure resistance that inversely correlates with moisture levels. An example code is provided to display the moisture percentage on the serial monitor using an analog output processed by an ADC.

Uploaded by

mihonay217
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Soil Moisture Sensor Interfacing with

Arduino UNO
Source: [Link]
arduino-uno

Introduction

Soil Moisture Sensor

Soil moisture is basically the content of water present in the soil. This can be measured using a
soil moisture sensor which consists of two conducting probes that act as a probe. It can measure
the moisture content in the soil based on the change in resistance between the two conducting
plates.
The resistance between the two conducting plates varies in an inverse manner with the amount of
moisture present in the soil.

For more information about soil moisture sensor and how to use it, refer the topic Soil Moisture
Sensor in the sensors and modules section.

Interfacing Diagram

Interfacing Soil Moisture Sensor With Arduino UNO

Example
Measuring soil moisture in terms of percentage.

Here, the analog output of soil moisture sensor is processed using ADC. The moisture content in
terms of percentage is displayed on the serial monitor.
The output of the soil moisture sensor changes in the range of ADC value from 0 to 1023.

This can be represented as moisture value in terms of percentage using formula given below.

Moisture in percentage = 100 – (Analog output * 100)

For zero moisture, we get maximum value of 10-bit ADC, i.e. 1023. This, in turn, gives 0%
moisture.

Sketch
const int sensor_pin = A1; /* Soil moisture sensor O/P pin */

void setup() {
[Link](9600); /* Define baud rate for serial communication */
}

void loop() {
float moisture_percentage;
int sensor_analog;
sensor_analog = analogRead(sensor_pin);
moisture_percentage = ( 100 - ( (sensor_analog/1023.00) * 100 ) );
[Link]("Moisture Percentage = ");
[Link](moisture_percentage);
[Link]("%\n\n");
delay(1000);
}

You might also like