What is Raindrop Sensor?
The Raindrop sensors are used for the detection of rain and also for measuring rainfall intensity. Raindrop sensors can be used for all kinds of weather monitoring.
A raindrop sensor is a board on which nickel is coated in the form of lines. It works on the principle of resistance. The raindrop sensor measures the moisture via analog output pins and it provides a digital output when a threshold of moisture exceeds.
The rain sensor module is based on the LM393 op amp. It consists of an electronics module and a printed circuit board that “collects” the rain drops.
As raindrops are collected on the circuit board, they create paths of parallel resistance that are measured via the op-amp. It also has a power indicator LED and an adjustable sensitivity through a potentiometer.
Pin Configuration of Rain Drop Sensor
The raindrop control sensor is embedded with an LM393 voltage comparator, and current limiting resistors to adjust signal states and divide the voltage and capacitors as biasing elements.
The raindrop sensor control board is usually of the size 3.2cm x 1.4cm. The pin configuration is as detailed below:
VCC: This is the positive power supply pin that powers the rain detector sensor.
GND: This is the reference potential pin.
D0: This is the digital output pin of the internal comparator circuit.
A0: This is the analog output pin that gives analog signals between 0-5 Volts.
+/-: This is where the rain pad is connected to the LM393.
Raindrop Sensor Features
- The LM393 uses a wide voltage comparator.
- The rain detector sensor provides both digital and analog output.
- It has an output LED indicator.
- It is compatible with Arduino.
- It is TTL Compatible.
- The rain detection sensor uses the high-quality FR – 04 double material, a large area of 5.5 * 4.0 CM
- Treatment of nickel plating and surface, has fight oxidation, electrical conductivity, and life has more superior performance.
- The comparator output, signal clean, good waveform, and driving ability is strong, for more than 15 mA.
- It has a potentiometer sensitivity adjustment.
- The output format: digital switch output (0 and 1) and analog AO voltage output.
- It has a fixed bolt hole, which is convenient for installation.
- Adopts high-quality of RF-04 double-sided material.
How to use the Raindrop Sensor
We can interface it with Arduino. To do so we need the following components:
- Arduino Board
- Rain sensor
- Pin connectors
- USB cable
Make the following connections:
- Raindrop Black Board +ve to the Integrated Chip +ve
- Raindrop Black Board –ve to the Integrated Chip –ve
- Vcc with Arduino Board +5V
- GND with Arduino Board GND
- Integrated Chip D0 with Arduino Board Digital pin 2
- Integrated Chip A0 with Arduino Board Analog pin A1
Raindrop sensor connected to an Arduino Uno
Use the above circuit as a reference for the connections.
Procedure:
- Connect the components based on the figure shown in the wiring diagram and the instructions given earlier using pin connectors. The pin number will be based on the actual program code.
- After the hardware connection, insert the sample sketch into the Arduino IDE.
- Using a USB cable, connect the ports from the Arduino to the computer.
- Upload the program.
- See the results in the serial monitor
Raindrop Sensor Arduino Code:
void setup()
{
// put your setup code here, to run once:
Serial.begin (9600);
pinMode (2 , INPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
int value = analogRead(A1);
int digital = digitalRead(2);
Serial.println (value);
Serial.println (digital);
delay(2000);
}
Code Explanation:
This code consists of two main functions: setup() and loop(). Let's explain each part of the code:
setup()
- The setup() method executes once when the Arduino board is turned on or reset.
- The Serial.begin(9600) statement in this function sets the serial transmission's baud rate to 9600 bits per second. This enables the Arduino to communicate with a connected computer or other serial devices.
- The pinMode(2, INPUT) instruction on the Arduino sets pin 2 as an input pin. This is used to determine the digital status of the raindrop sensor.
loop()
- The loop() method is the main part of the code that runs repeatedly in a cycle.
- The code begins by reading the analog value from the sensor connected to analog pin A1 using the analogRead() method. This function returns an integer between 0 and 1023 that indicates the quantity of moisture detected by the sensor.
- The code then calls the digitalRead(2) method to get the digital state of the sensor attached to pin 2. This method returns either HIGH or LOW depending on whether the sensor detects raindrops (water).
- The code transmits the analog value (value) and digital state (digital) to the serial monitor using Serial.println().
- Finally, a 2000 millisecond (2 second) delay between loop rounds enables the sensor to settle and keeps the Arduino from reading data too often.
Rain Drop Sensor Working
A raindrop sensor has a board on which nickel is coated in the form of lines. It works on the principle of resistance.
The principle is that when there is no rain drop on board, the resistance is high so we get high voltage according to V=IR.
When raindrops are present the resistance is reduced as water is a conductor of electricity and its presence connects nickel lines in parallel so the reduced resistance and there is a voltage drop across it.
Control Circuit
In addition, the raindrop module has a potentiometer that is responsible for adjusting the output of the digital pin.
This potentiometer is calibrated to receive accurate readings. The potentiometer is connected to the inverting end of the LM393 comparator and sets the reference or threshold voltage meanwhile the input analog voltage is applied to the non-inverting side of the comparator.
Then the respective comparator compares both the voltages. This leads to two conditions and gives the output accordingly.
If the voltage given as an input is more than the reference voltage then the comparator shows a high state.
Copper Pads
The working of the raindrop sensor module is easy and straightforward. The rain detector sensor has a series of exposed copper paths that act as variable resistors whose resistance varies according to the amount of water on its surface.
Generally, they are not connected but are bridged through the water. This resistance is inversely proportional to the amount of water.
The more water on the surface of the rain pads the better the conductivity and this results in lower resistance. The sensor produces an output voltage which is used to determine whether it is raining or not.
Sensor Module
The raindrop sensor module consists of a control sensor and a rain-sensing pad which can be connected to any microcontroller.
The module produces an output voltage according to the resistance of the sensing pad and is given at the analog output pin.
The same signal is also passed over to the LM393 high-precision comparator to digitize and is made available at the TTL digital output pin.
Indication LED
Whereas if the threshold voltage is more than the applied voltage then the comparator output will be low.
Apart from these, the module has two LEDs, a power LED and a status LED. The power LED will light up when the module is powered and the status LED glows and indicates the digital output pin status.
Applications of Raindrop Sensor Module
The following are a few applications of raindrop sensors:
- It is used as a water preservation device and this is connected to the irrigation system to shut down the system in the event of rainfall.
- It is used to support the regular windscreen wiper’s mode and to protect the internal parts of an automobile.
- This rain detection sensor is used in specialized satellite communications aerials for controlling and activating a rain blower over the opening of the aerial feed, to get rid of water droplets from the mylar wrap to keep pressurized as well as dry air within the waveguides.
Conclusion
In this blog post, We learned that the Rain Sensor is a reliable and useful instrument for detecting rainfall.
Because to its simple PIN setup and user-friendly features, it provides reliable data and has several uses in agricultural, weather monitoring, and other industries.
The raindrop sensor provides consistent and precise meteorological data for study or to control your irrigation system. Get a raindrop sensor today and enjoy the benefits of precipitation!
If you appreciate our work don't forget to share this post and leave your opinion in the comment box.
Please do check out other; blog posts about Popular electronics
Make sure you check out our wide range of products and collections (we offer some exciting deals!)