INTERFACING SOIL MOISTURE SENSOR USING BHARAT PI

by madhankarthick in Circuits > Sensors

262 Views, 1 Favorites, 0 Comments

INTERFACING SOIL MOISTURE SENSOR USING BHARAT PI

probeInSoil_lg_cropped.jpg

In this instructable, we are going to interface a Capactive Soil moisture sensor v2.0 with Bharat-PI. This sensor measures the volumetric content of water inside the soil and gives us the moisture level as output. The sensor is equipped with digital output, so it can be used in digital mode. In this article, we are going to interface the sensor in digital modes. So let’s begin our tutorial on interfacing Bharat-pi and Soil moisture sensor.

Working of Soil Sensor

The soil moisture sensor consists of two probes which are used to measure the volumetric content of water. The two probes allow the current to pass through the soil and then it gets the resistance value to measure the moisture value. When there is more water, the soil will conduct more electricity which means that there will be less resistance. Therefore, the moisture level will be higher. Dry soil conducts electricity poorly, so when there will be less water, then the soil will conduct less electricity which means that there will be more resistance. Therefore, the moisture level will be lower. This sensor can be connected in digital mode. 

The specifications of the soil moisture sensor v2.0 are as follows

  1. Operating Voltage: 3.3 ~ 5.5 VDC.
  2. Operating Current: 5mA.
  3. Interface: PH2.54-3P.
  4. Dimensions mm(LxWxH): 98 x 23 x 4.
  5. Supports 3-Pin Gravity Sensor interface
  6. Analog output.
  7. Weight (gm): 15.


Soil Moisture Capacitive Pinout

soil_pin.jpg
  1. Gnd : Power GND(0V)
  2. Vcc :Power VCC(3.3~5,5V)
  3. A OUT:Analog Siganl Output(0~2.3V)

Requirements

fefefg43.jpg
Artboard-1-e1686767346235.jpg
wires.jpg
OIP (4).jpeg

1.Bharat pi

2.Jumper wires for connection

3.Soil for testing

4.Soil Moisture Sensor`

5.Arduino IDE

 

Interfacing With Bharat Pi

WhatsApp Image 2023-09-04 at 13.25.25.jpg
Screenshot 2023-09-15 165646.png

Connections:

  1. Vcc pin : 5v
  2. gnd pin : ground
  3. A out pin to : pin 4

UPLOAD CODE FOR AURDINO - IDE

1649279368-Ent-2022Python.jpeg

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

 

void setup() {

 Serial.begin(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) * 10 ) );

 Serial.print("Moisture Percentage = ");

 Serial.print(moisture_percentage);

 Serial.print("%\n\n");

delay(1000);

}

 

Code avilable at git hub:https://github.com/Madhankarthick/interfacing-soil-sensor-wit-bharat-pi/blob/07944eed6fa17038532f2122e3af5816b98d81bf/soil%20sens.txt

Downloads

CHECK THE OUTPUT AT SERIAL MONITOR

Screenshot 2023-09-15 170315.png

Apllications

OIP (5).jpeg
_DSC8417.jpg
0c856c888523da6127f5a322edcd8b43.jpg
  1. Agriculture: to optimize irrigation, increase crop yields, save water, energy, and fertilizer costs, and protect water resources from runoff.
  2. Landscape irrigation: to maintain healthy plants and lawns, and conserve water.
  3. Research: to study soil properties, climate change, environmental science, biofuel, and drought forecasting.
  4. Simple sensors for gardeners: to monitor the soil moisture of plants and flowers, and water them accordingly.
  5. Archeology: to detect buried artifacts and structures based on soil moisture variations.


Video

interfacing soil moisture sensor