Arduino Rain Sensor FC-37 or YL-83

Arduino Rain Sensor FC-37 or YL-83

Cover Image



The FC-37 rain sensor (or other versions like YL-83) is set up by two pieces: the electronic board (at the right) and the collector board (at the left) that collects the water drops, as you can see in the following figure:



FC-37 Pin out

How does it work? Basically, the resistance of the collector board varies accordingly to the amount of water on its surface.

When the board is:

Wet: the resistance increases, and the output voltage decreases


Image description


In this example, we will just read the analog sensor values using the Arduino and printing those readings in the Arduino IDE serial monitor.

Parts required

  • 1x Rain Sensor: FC-37 or YL-83 (eBay link)
  • 1x Arduino
  • 1x Breadboard
  • 2x 220 Ohm Resistors (eBay link)
  • 1x Red LED
  • 1x Green LED
  • Jumper wires

Pin wiring

Pin Wiring to Arduino
A0 Analog pins
D0 Digital pins


FC-37 Arduino Wiring diagram


Open the Arduino IDE and upload the following sketch, open serial monitor to see the values. Then you can start adding drops of water to the collector board.


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);

void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(rainPin);
  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);