The Soil Sensor (Manufacturer Part ID: Soil Sensor) is a device designed to measure the moisture content in the soil. Manufactured in China, this sensor is widely used in agricultural and gardening applications to monitor and optimize watering schedules. By providing real-time data on soil moisture levels, it helps in maintaining the health of plants and conserving water.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Operating Current | < 20mA |
Output Type | Analog and Digital |
Interface | 4-pin (VCC, GND, A0, D0) |
Dimensions | 60mm x 20mm x 5mm |
Material | Corrosion-resistant metal |
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin. Connect to 3.3V or 5V. |
2 | GND | Ground pin. Connect to the ground of the circuit. |
3 | A0 | Analog output pin. Provides an analog voltage proportional to soil moisture. |
4 | D0 | Digital output pin. Provides a high/low signal based on a threshold setting. |
Powering the Sensor:
Reading Analog Values:
Reading Digital Values:
// Soil Sensor Example Code
// This code reads the analog value from the soil sensor and prints it to the serial monitor.
const int soilSensorPin = A0; // Analog pin connected to the soil sensor
int soilMoistureValue = 0; // Variable to store the sensor value
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
}
void loop() {
soilMoistureValue = analogRead(soilSensorPin); // Read the analog value from the sensor
Serial.print("Soil Moisture Value: ");
Serial.println(soilMoistureValue); // Print the value to the serial monitor
delay(1000); // Wait for 1 second before taking another reading
}
Inconsistent Readings:
No Output:
Corrosion on Probes:
By following this documentation, users can effectively utilize the Soil Sensor in their projects, ensuring accurate soil moisture measurements and optimal plant care.