fbpx
Arduino Lesson 17: Soil Moisture Sensor
Arduino Lesson 17

Soil Moisture Sensor

Measure soil moisture

Components Required

Buy

Introduction

Soil moisture sensors typically refer to sensors that estimate volumetric water content. Another class of sensors measure another property of moisture in soils called water potential; these sensors are usually referred to as soil water potential sensors and include tensiometers and gypsum blocks.

Learning outcomes:

  • Using Soil moisture sensor and implement its applications
  • Working principal of soil moisture sensor

Theory

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.

Methodology

Connect the soil moisture sensor to the Magicbit. As usually in here also we connect sensor module to the upper left (D32) connector on the Magicbit. After connect the sensor module put it in to a wet soil mixture for get results. Then connect the Magicbit to your pc and upload the code below

Code

 

int SENSOR = 32;
int output_value ;

void setup() {
   pinMode(32,INPUT);
   Serial.begin(9600);
   Serial.println("Reading From the Sensor ...");
   delay(2000);

}

void loop() {

   output_value= analogRead(SENSOR);
   output_value = map(output_value,550,0,0,100);
   Serial.print("Mositure : ");
   Serial.print(output_value);
   Serial.println("%");
   delay(1000);
}

Explanation

‘output_value = map(output_value, 550,0, 0,100)’ – output_value is an user defined variable. For display a moisture percentage we should map the analog output value of the sensor given according to the sample (the wet soil mixture). From serial monitor we can get our outputs.

Related Posts
Leave a Reply

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