Introduction: Arduino Rain Sensor Sketch
This project explains how to interface rain sensor with arduino. It is very simple project as reading analog signal from sensor just one code like “analogRead“. But the applications of this project has widest possibilities.
The rain sensors available in different size and categories depends on sensing area and comparator module. So many online vendors are selling it with reasonable cost, just google it as rain sensor you will get best one.
Step 1: Rain Sensor Module
The rain sensor uses FR-04 high quality double side materials for widest sensing, it uses LM393 low voltage comparator with output driving ability over 15mA. Operating voltage of this module varies between 3.3 volts to 5 Volts, best to give 5 V from arduino power pins.
Step 2: Hookup Guide
Connect the rain sensor and buzzer with arduino as shown in the hookup image, in this project we taken buzzer device as a alarm output device. You can choose any output device depends on your need, remember to change the arduino code as well
Step 3: Arduino Code
Get Arduino Code for Rain sensor here: http://www.theorycircuit.com/arduino-rain-sensor-sketch/
The rain sensor Analog output terminal is connected with arduino (A0) pin, and the output taken from digital pin D10. the 5V and Gnd power source applied to the sensor module, when the rain falls the analog output varies from 5V to 0. If the sensor remains try then output will be 5V, you can invert this output voltage range using single transistor if you want. In this project we used serial monitor to just show the rain sensor reading you can introduce formulas or any thing you want to make it more informative.