The DFRobot Capacitive Soil Moisture Sensor (V1.0) is an electronic device that measures the moisture level in soil. This sensor uses capacitive sensing technology to detect the dielectric permittivity of the surrounding medium, which in this case is soil. The dielectric permittivity changes with the amount of water in the soil, allowing the sensor to indirectly measure the soil moisture content. This sensor is commonly used in gardening, agriculture, and environmental monitoring to ensure optimal soil moisture levels for plant growth or to conserve water by providing data for irrigation control systems.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3 - 5.5 VDC) |
2 | GND | Ground |
3 | AOUT | Analog output (0 - 3.0V) |
// Define the sensor pin
const int sensorPin = A0;
void setup() {
// Initialize serial communication at 9600 baud rate
Serial.begin(9600);
}
void loop() {
// Read the value from the sensor
int sensorValue = analogRead(sensorPin);
// Convert the analog reading to a voltage value
float voltage = sensorValue * (5.0 / 1023.0);
// Print the voltage value to the serial monitor
Serial.print("Voltage: ");
Serial.println(voltage);
// Wait for a second before reading again
delay(1000);
}
Q: Can the sensor be used with a 5V system? A: Yes, the sensor can operate with a power supply between 3.3V and 5.5V.
Q: Is the sensor waterproof? A: The sensor is not waterproof and should not be submerged in water.
Q: How do I interpret the sensor's output voltage? A: The output voltage increases with the soil moisture level. Calibration is required to correlate voltage readings with actual moisture percentages.
Q: Can the sensor be left in the soil permanently? A: While the sensor is designed for use in soil, leaving it in the soil permanently can lead to corrosion. It is recommended to remove the sensor when not in use for extended periods.