

The KY-036 is a capacitive soil moisture sensor designed to measure the moisture content in soil. Unlike resistive soil moisture sensors, the KY-036 uses capacitive sensing, which reduces corrosion and increases the sensor's lifespan. It outputs an analog signal that corresponds to the soil's moisture level, making it ideal for applications requiring precise and reliable moisture detection.








| Pin Name | Pin Type | Description |
|---|---|---|
| VCC | Power Input | Connect to 3.3V or 5V power supply. |
| GND | Ground | Connect to the ground of the circuit. |
| AOUT | Analog Output | Outputs an analog voltage proportional |
| to the soil moisture level. |
// KY-036 Soil Moisture Sensor Example Code
// Reads the analog output of the KY-036 and prints the moisture level to the Serial Monitor.
const int sensorPin = A0; // Connect AOUT pin of KY-036 to A0 on Arduino
int sensorValue = 0; // Variable to store the sensor reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(sensorPin, INPUT); // Set the sensor pin as input
}
void loop() {
sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
float moistureLevel = map(sensorValue, 0, 1023, 0, 100);
// Map the sensor value to a percentage (0% to 100%)
Serial.print("Soil Moisture Level: ");
Serial.print(moistureLevel);
Serial.println("%");
delay(1000); // Wait for 1 second before taking the next reading
}
No Output or Incorrect Readings
Fluctuating or Noisy Readings
Sensor Not Responding in Wet Soil
Output Voltage Does Not Change
Q: Can the KY-036 be used outdoors?
A: Yes, but ensure the electronic components are protected from water and weather conditions.
Q: How do I calibrate the sensor?
A: Measure the output voltage in completely dry soil and fully saturated soil. Use these values to map the sensor's output to a percentage scale.
Q: Can I use the KY-036 with a 3.3V microcontroller like ESP32?
A: Yes, the KY-036 is compatible with both 3.3V and 5V systems.
Q: How deep should I insert the sensor into the soil?
A: Insert the sensor fully into the soil for accurate readings, ensuring the probe is in contact with the soil at all points.