The Soil Moisture Module is a sensor designed to measure the volumetric water content in soil. It provides an analog or digital signal that can be read by a microcontroller, such as an Arduino UNO, to monitor soil moisture levels. This module is commonly used in agricultural projects, automated irrigation systems, and environmental monitoring.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Output Type | Analog and Digital |
Analog Output | 0V (dry) to Vcc (wet) |
Digital Output | High/Low (configurable) |
Current Consumption | < 20mA |
Operating Temperature | -40°C to 85°C |
Dimensions | 60mm x 20mm x 5mm |
Pin Name | Description |
---|---|
VCC | Power supply (3.3V - 5V) |
GND | Ground |
A0 | Analog output (voltage proportional to moisture) |
D0 | Digital output (configurable threshold) |
// Soil Moisture Sensor Example Code for Arduino UNO
const int analogPin = A0; // Analog pin connected to A0 of the sensor
const int digitalPin = 7; // Digital pin connected to D0 of the sensor
int analogValue = 0; // Variable to store the analog value
int digitalValue = 0; // Variable to store the digital value
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
analogValue = analogRead(analogPin); // Read the analog value from the sensor
digitalValue = digitalRead(digitalPin); // Read the digital value from the sensor
// Print the values to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue);
Serial.print(" | Digital Value: ");
Serial.println(digitalValue);
delay(1000); // Wait for 1 second before the next reading
}
By following this documentation, users can effectively utilize the Soil Moisture Module in their projects, ensuring accurate and reliable soil moisture monitoring.