The SEN0159 is a capacitive soil moisture sensor manufactured by DFRobot (Part ID: 1738-1125-ND). This sensor is designed to measure the volumetric water content in soil using capacitive sensing technology. Unlike resistive soil moisture sensors, the SEN0159 is corrosion-resistant, ensuring a longer lifespan and reliable performance in outdoor environments.
This sensor outputs an analog voltage that corresponds to the soil's moisture level, making it easy to interface with microcontrollers such as Arduino. It is widely used in agricultural applications, automated irrigation systems, and environmental monitoring projects.
Below are the key technical details of the SEN0159:
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5.5V |
Output Voltage Range | 0V - 3.0V (analog output) |
Current Consumption | < 20mA |
Interface Type | Analog |
Dimensions | 98mm x 23mm |
Operating Temperature | -40°C to 85°C |
Sensor Type | Capacitive |
Cable Length | 1 meter |
The SEN0159 has a 3-pin interface. The pinout is as follows:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.3V to 5.5V) |
2 | GND | Ground connection |
3 | AOUT | Analog output voltage proportional to soil moisture |
VCC
pin to a 3.3V or 5V power source, depending on your microcontroller's operating voltage.GND
pin to the ground of your circuit.AOUT
pin to an analog input pin on your microcontroller (e.g., A0 on an Arduino UNO).The following code demonstrates how to read the analog output of the SEN0159 using an Arduino UNO and display the soil moisture level on the Serial Monitor.
// Define the analog pin connected to the SEN0159 sensor
const int sensorPin = A0;
void setup() {
// Initialize the Serial Monitor for debugging
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
int sensorValue = analogRead(sensorPin);
// Map the sensor value to a percentage (0% to 100%)
// Assuming 0 corresponds to dry soil and 1023 to wet soil
int moisturePercent = map(sensorValue, 0, 1023, 0, 100);
// Print the sensor value and moisture percentage to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(sensorValue);
Serial.print(" | Soil Moisture: ");
Serial.print(moisturePercent);
Serial.println("%");
// Wait for 1 second before the next reading
delay(1000);
}
No Output or Incorrect Readings:
AOUT
pin is connected to an analog input pin on the microcontroller.Fluctuating Readings:
VCC
and GND
pins to stabilize the power supply.Low Sensitivity:
Sensor Not Responding:
Q: Can the SEN0159 be used with a Raspberry Pi?
A: Yes, the SEN0159 can be used with a Raspberry Pi. However, since the Raspberry Pi does not have built-in analog input pins, you will need an external ADC (Analog-to-Digital Converter) module to read the sensor's output.
Q: How do I interpret the analog output voltage?
A: The analog output voltage is proportional to the soil moisture level. A higher voltage indicates wetter soil, while a lower voltage indicates drier soil. You can map the voltage to a percentage for easier interpretation.
Q: Is the SEN0159 suitable for outdoor use?
A: Yes, the SEN0159 is corrosion-resistant and can be used outdoors. However, it is recommended to protect the wiring and connections from water exposure.
Q: Can the sensor measure moisture in other materials?
A: The SEN0159 is optimized for soil moisture measurement. While it may work with other porous materials, the readings may not be accurate without proper calibration.
By following this documentation, you can effectively integrate the SEN0159 into your projects and ensure reliable soil moisture measurements.