

The YL-83 Rain Sensor is a moisture detection device designed to sense rainfall and trigger a response in electronic circuits. It consists of two main parts: a conductive sensor pad and a control module. The sensor pad detects the presence of water through its conductive traces, while the control module processes the signal and provides both analog and digital outputs.








The YL-83 Rain Sensor is a simple yet versatile component. Below are its key technical details:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V to 5V DC). |
| GND | Ground connection. |
| AO | Analog output pin. Provides a voltage proportional to the water detected. |
| DO | Digital output pin. Outputs HIGH or LOW based on the set threshold. |
| Pin Name | Description |
|---|---|
| S | Signal pin. Connects to the control module for data transmission. |
| + | Power supply input (3.3V to 5V DC). |
| - | Ground connection. |
The YL-83 Rain Sensor is easy to integrate into electronic circuits. Follow the steps below to use it effectively:
Power the Sensor:
VCC pin of the control module to a 3.3V or 5V power source.GND pin to the ground of your circuit.Connect the Outputs:
AO pin if you need an analog signal to measure the intensity of rainfall.DO pin for a digital signal that toggles based on the set threshold.Attach the Sensor Pad:
DO).Below is an example of how to connect the YL-83 Rain Sensor to an Arduino UNO and read both analog and digital outputs:
VCC → Arduino 5VGND → Arduino GNDAO → Arduino A0DO → Arduino D2// YL-83 Rain Sensor Example Code
// This code reads both analog and digital outputs from the YL-83 Rain Sensor
// and prints the results to the Serial Monitor.
#define DIGITAL_PIN 2 // Digital output pin connected to DO
#define ANALOG_PIN A0 // Analog output pin connected to AO
void setup() {
pinMode(DIGITAL_PIN, INPUT); // Set digital pin as input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int digitalValue = digitalRead(DIGITAL_PIN); // Read digital output
int analogValue = analogRead(ANALOG_PIN); // Read analog output
// Print the results to the Serial Monitor
Serial.print("Digital Output: ");
Serial.print(digitalValue); // 0 = no rain, 1 = rain detected
Serial.print(" | Analog Output: ");
Serial.println(analogValue); // Higher value = more water detected
delay(500); // Wait for 500ms before the next reading
}
No Output from the Sensor:
Erratic or Inconsistent Readings:
Digital Output Always HIGH or LOW:
Q: Can the YL-83 Rain Sensor detect the intensity of rainfall?
A: Yes, the analog output (AO) provides a voltage proportional to the amount of water detected, which can be used to estimate rainfall intensity.
Q: Is the sensor pad waterproof?
A: No, the sensor pad is not waterproof. It is designed to detect water on its surface but should not be submerged.
Q: Can I use the YL-83 Rain Sensor with a 3.3V microcontroller?
A: Yes, the sensor operates at 3.3V to 5V, making it compatible with 3.3V microcontrollers like the ESP32 or Raspberry Pi Pico.
Q: How do I clean the sensor pad?
A: Use a soft, dry cloth to gently wipe the sensor pad. Avoid using abrasive materials or liquids.