Soil Moisture Sensor
The soil moisture sensor is used to sense the moisture of soil.
Moisture is volumetric water content of soil which is measured by soil moisture sensor and is provided as an output in form of percentage.
Soil moisture sensor ideal for performing projects on agriculture or soil science.
Project description:
In this project we are going to work with soil moisture sensor and will be recording its output on serial monitor.
Specifications:
- Accuracy: ±4% typical
- Typical Resolution: 0.1%
- Power: 3 mA @ 5VDC
- Operating temperature: –40°C to +60°C
PIN Description:
Soil Moisture sensor FC-28 has four pins
- VCC: For providing power
- A0: For Analog output
- D0: For Digital output
- GND: For providing Ground
Steps:
Step 1:
Connect soil moisture sensor to Arduino
Connections:
- Connect VCC to 5v of Arduino
- Connect GND to GND of Arduino
- Connect A0 pin of sensor to A0 pin of Arduino
Step 2:
Upload the code
- Copy the code below in Arduino IDE
int sensor_pin = A0;
int output_value ;
void setup() {
Serial.begin(9600);
Serial.println(Reading From the Sensor ...);
delay(2000);
}
void loop() {
output_value= analogRead(sensor_pin);
output_value = map(output_value,550,0,0,100);
Serial.print("Mositure:");
Serial.print(output_value);
Serial.println(%);
delay(1000);
}
- Press the upload icon to upload code to UNO
Step 3:
Open serial monitor
Conclusion:
You can see the value being printed on serial monitor which is amount of moisture in the soil.