How to Connect Rain Sensor Module with Arduino UNO?


Today, we are with a very easy project on rain sensor with arduino. Rain sensor used here is for detecting the rain before its incidence. We’ll notice through the rain alarm. This depicts a simple but interesting project.  However, number of applications can be performed through its exposure and receive unique outcomes…

Here, we’ll be using a pre-wired rain sensor module with an Arduino. Rain Sensor module has a LM393 chip demonstrating their technical specifications which comprise of:

  • Indicators: Power indicator & Output indicator LEDs.
  • User Control: Onboard sensitivity adjustment potentiometer.
  • Output: Digital (DO) & Analog (AO).
  • Working Voltage: 5V.

Now the analog output of the rain sensor module is associated to one analog input (A0) of the Arduino, so that the microcontroller can read an analog voltage between 0 and 5 volts to process a number between 0 and 1023, where 0 representing 0 volt, and 1023 representing 5 volt.




Analog output (AO) from the module is received 5V, if the rain sensor plate of the rain sensor module is in dry state. During rain, the sensor plate elements are bridged by the rain water. Consequently, this analog output steadily changes from 5V to 0V, based on the moisture level between the sensor pads. Through this technique, the sensor reports the absence and presence of the rain in an analog way help us to determine whether the rain is light or strong by analyzing the outputted analog signal. The approximation is handled by a simple Arduino sketch. An additional function is delaying of the alert generation. Arduino elevate an alert only when raining with a certain threshold is detected, within a pre-defined time interval. This extra feature helps in reducing false alarm counts to some extent. In the given sketch, rain threshold is 300, and the time delay is 30 sec.

When it’s raining and Arduino detects it, D8 output of the Arduino board goes to High level. This D8 output can be used to energize an audio sound (piezo buzzer) or an electric switch (electromagnetic relay).


As usual, power up the Arduino from an external 9V DC power supply unit. The buzzer/relay driver circuit may be used for voltages in the range 5-12V. However, the Vcc must be adapted to the exact voltage and current demand of the connected buzzer/relay.

Stay Connect with ROBOMART.COM for More Informative Blog..