The rain sensor is used to detect water and it can detect beyond of what a humidity sensor do. This article explains how to use the FC-37 rain sensor module with the Arduino.
The FC-37 rain sensor (or other versions like YL-83) is set up by two pieces: the electronic board (at the left) and the collector board (at the right) that collects the water drops, as you can see in the following figure:

The rain sensor has a built-in potentiometer for sensitivity adjustment of the digital output (D0). It also has a power LED that lights up when the sensor is turned on and a digital output LED.

You can also read this guide for the Soil Moisture Sensor YL-69 or HL-69 with the Arduino.
Basically, the resistance of the collector board varies accordingly to the amount of water on its surface.
When the board is:

This is a simple example for you to understand how you can use the rain sensor in your projects with Arduino.
In this example, you will just read the analog sensor values using the Arduino and printing those readings in the Arduino IDE serial monitor.
For this example, you’ll need:
You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!
Wiring your sensor to the Arduino is pretty straightforward:
| Pin | Wiring to Arduino |
| A0 | Analog pins |
| D0 | Digital pins |
| GND | GND |
| VCC | 5V |
Follow these schematics to complete the project:

Upload the following sketch to your Arduino board (feel free to adjust the variable thresholdValue with a different threshold value):
/* All the resources for this project: https://randomnerdtutorials.com/ */ int rainPin = A0; int greenLED = 6; int redLED = 7; // you can adjust the threshold value int thresholdValue = 500; void setup(){ pinMode(rainPin, INPUT); pinMode(greenLED, OUTPUT); pinMode(redLED, OUTPUT); digitalWrite(greenLED, LOW); digitalWrite(redLED, LOW); Serial.begin(9600); } void loop() { // read the input on analog pin 0: int sensorValue = analogRead(rainPin); Serial.print(sensorValue); if(sensorValue < thresholdValue){ Serial.println(" - It's wet"); digitalWrite(greenLED, LOW); digitalWrite(redLED, HIGH); } else { Serial.println(" - It's dry"); digitalWrite(greenLED, HIGH); digitalWrite(redLED, LOW); } delay(500); }
Open the Arduino IDE serial monitor to see the values. Then you can start adding drops of water to the collector board.
When the value goes below a certain threshold, a red LED will turn on, and when the value goes above a certain threshold, a green LED will turn on.
Copyright ©2025. All Rights Reserved Emblab THE RAVE INNOVATION