The Soil Moisture Sensor Module is a device designed to measure the volumetric water content in soil. It provides real-time data that can be used for irrigation management, plant health monitoring, and various agricultural or gardening applications. Manufactured by Arduino, this module (Part ID: UNO) is widely used in smart farming, automated irrigation systems, and environmental monitoring projects. Its ease of use and compatibility with microcontrollers like the Arduino UNO make it a popular choice for both hobbyists and professionals.
The following table outlines the key technical details of the Soil Moisture Sensor Module:
Parameter | Specification |
---|---|
Operating Voltage | 3.3V - 5V |
Output Type | Analog and Digital |
Current Consumption | < 20mA |
Analog Output Range | 0V (dry soil) to 5V (wet soil) |
Digital Output | High (wet) or Low (dry) |
Dimensions | 60mm x 20mm x 5mm |
Operating Temperature | -10°C to 60°C |
The Soil Moisture Sensor Module has four pins, as described in the table below:
Pin Name | Type | Description |
---|---|---|
VCC | Power | Connect to 3.3V or 5V power supply. |
GND | Ground | Connect to the ground of the power supply. |
A0 | Analog Out | Outputs an analog voltage proportional to the soil moisture level. |
D0 | Digital Out | Outputs a HIGH or LOW signal based on the soil moisture threshold (adjustable). |
Wiring the Sensor:
VCC
pin to the 5V pin of the Arduino UNO.GND
pin to the GND pin of the Arduino UNO.A0
pin to an analog input pin (e.g., A0) on the Arduino UNO.D0
pin to a digital input pin if you want to use the digital output.Adjusting the Threshold:
Reading the Output:
A0
) for precise moisture level readings.D0
) for a simple HIGH/LOW signal indicating wet or dry soil.Below is an example code snippet to read data from the Soil Moisture Sensor Module using an Arduino UNO:
// Define the analog and digital pins connected to the sensor
const int analogPin = A0; // Analog output pin of the sensor
const int digitalPin = 2; // Digital output pin of the sensor
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
// Read the analog value from the sensor
int analogValue = analogRead(analogPin);
// Read the digital value from the sensor
int digitalValue = digitalRead(digitalPin);
// Print the analog value to the Serial Monitor
Serial.print("Analog Value: ");
Serial.println(analogValue);
// Print the digital value to the Serial Monitor
Serial.print("Digital Value: ");
Serial.println(digitalValue);
// Add a delay for readability
delay(1000);
}
No Output or Incorrect Readings:
Corrosion on the Sensor Probes:
Unstable Readings:
VCC
and GND
pins to reduce noise. Calibrate the sensor for your specific soil type.Digital Output Always HIGH or LOW:
Q1: Can this sensor be used for hydroponics?
A1: No, this sensor is designed for soil use and may not provide accurate readings in water or hydroponic systems.
Q2: How do I protect the sensor from corrosion?
A2: Use a corrosion-resistant version of the sensor or apply a protective coating to the probes.
Q3: What is the lifespan of the sensor?
A3: The lifespan depends on usage and environmental conditions. Regular cleaning and proper use can extend its life.
Q4: Can I use this sensor with a Raspberry Pi?
A4: Yes, the sensor can be used with a Raspberry Pi. However, you may need an ADC (Analog-to-Digital Converter) to read the analog output.