The Arduino Soil Moisture Sensor is a device designed to measure the volumetric water content in soil. It is an essential tool for applications such as agriculture, gardening, and automated irrigation systems. By providing real-time data on soil moisture levels, this sensor helps in maintaining optimal soil conditions for plant growth, ensuring efficient water usage, and preventing overwatering.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Output Voltage | 0V - 4.2V (analog) |
Current Consumption | < 20mA |
Interface | Analog |
Dimensions | 60mm x 20mm x 5mm |
Operating Temperature | -40°C to 85°C |
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | GND | Ground |
3 | AOUT | Analog output voltage proportional to moisture |
4 | DOUT | Digital output (high/low) based on threshold |
// Soil Moisture Sensor Example Code
// This code reads the analog value from the soil moisture sensor
// and prints the moisture level to the Serial Monitor.
const int sensorPin = A0; // Analog input pin for the sensor
int sensorValue = 0; // Variable to store the sensor value
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 bps
}
void loop() {
sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
Serial.print("Soil Moisture Level: ");
Serial.println(sensorValue); // Print the sensor value to the Serial Monitor
delay(1000); // Wait for 1 second before taking another reading
}
By following this documentation, users can effectively integrate the Arduino Soil Moisture Sensor into their projects, ensuring accurate and reliable soil moisture measurements.