Rain Sensor – How to use with Arduino

A rain sensor, as the name implies, allows sensing or detecting if it’s raining. This can be particularly helpful for projects where you need to take action (or not take action) based on the presence or absence of rain. It could be as simple as turning on an LED when rain is detected.

Rain Sensor Components

The Rain Sensor has two main components:

  • Sensor pad.
  • Sensor circuit board.

The sensor pad is what will make contact with the rain in order to detect it, while the sensor circuit board will process the sensor pad’s signal and output it through the analog output pin. The circuit board will also generate a digital output which generates a HIGH or LOW depending on the potentiometer setting.

Rain sensor components.

Rain Sensor Size

The sensor pad is approximately 2 inches x 1.5 inches (50mm x 38mm).

Rain sensor size

Sensor Pins

VCC – Connected to Arduino UNO 5V output.
GND – Connected to Arduino GND.
DO – Digital Output
AO – Analog Output
Connection pins from probe to sensor circuit board

Rain sensor pins

Connection to Arduino

The sensor can be used through use of the analog output or the digital output. Both options shown further down.

Note that if the digital output option is used, you will need to adjust the sensitivity of the sensor through the potentiometer included in the sensor circuit board. All you have to do is take a small screwdriver and turn the potentiometer to adjust the sensitivity. This is best done while connected to Arduino IDE so you can see the change in results as the potentiometer is adjusted.

Analog Output Option

Rain sensor connections (analog output option)

Click to enlarge

Digital Output Option

Rain sensor connections (digital output option)

Click to enlarge

Arduino Code – Analog Output Option

Arduino Code – Digital Output Option

Run Arduino Code – Testing Rain Sensor

All you need to do now is run the code that was provided above, in either configuration, and open the Serial Monitor.

Result for Analog Output Option

Click to enlarge

Result for Digital Output Option

Click to enlarge

Components used in this example

*As an Amazon & Ebay Associate I earn from qualifying purchases.

ComponentLink
Arduino UNOhttps://amzn.to/3uYVAMC
https://ebay.us/veZdKX
Rain Sensorhttps://amzn.to/3e9uzQ3
https://ebay.us/SJqf5a

5 Replies to “Rain Sensor – How to use with Arduino”

  1. Having read this I thought it was extremely enlightening. I appreciate you taking the time and effort to put this information together. I once again find myself personally spending way too much time both reading and posting comments. But so what, it was still worthwhile! Lee Gareth Jakoba

  2. Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to figure out if its a problem on my end or if it’s the
    blog. Any feed-back would be greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *