Rain Detector Using Arduino and Raindrop Sensor

Introduction

This article will learn how to make a Rain Detector project using Arduino and Raindrop sensors.

In this project, we use a Raindrop sensor for detecting the rain and a dc motor for covering the roof. If you are new to this field please do check out more projects on Arduino.

Arduino is a microcontroller that uses ATmega328p IC for its functioning. There are many types of Arduino boards available in the market but we use Arduino UNO for this project. For controlling the dc motor we use the L293D motor driver module. Make the connections as given below in the circuit diagram and upload the Arduino code.

The system starts working as soon as you power the Arduino and motor driver by using 9 volts dc batteries. Also, check Weather Station with Arduino.

rain newlllll

How Does the System Work?

The Rain Detector Using Arduino and Raindrop Sensor is used to alert the surrounding when it’s raining outside. The system is controlled with Arduino UNO. If the waterfalls on the Raindrop sensor it detects that it’s raining outside and a led connected with it will glow and alert the surroundings.

The dc motor starts moving when it rain and covers the roof s that rainwater can’t come inside the home in this Arduino project.

For controlling the dc motor L293D motor driver is used. So whenever it’s raining outside your roof will automatically cover with a shelter.

Arduino interface with rain Drop sensor

IMG 20220222 110831

Components Required

Arduino UNOBUY LINK
Raindrop sensorBUY LINK
BreadboardBUY LINK
Jumper WiresBUY LINK
L293D Motor driverBUY LINK
DC motorBUY LINK
LEDBUY LINK
Resistor 220 ohmBUY LINK
USB cable for uploading code into Arduino UNOBUY LINK
9-Volt BatteriesBUY LINK
IMG 20220222 115317

 

Circuit Diagram of the Project

rain detector using Arduino circuit

Connection Table

Arduino UNORain Sensor
( +5V ) VCC
GND GND
D4 Pin  ( SDA )D0 Pin
Arduino UNO9 Volt Battery
VinPositive  Terminal
GND Negative  Terminal
ArduinoLED 220 Ohm Resistor
D3 PinAnode Pin 
 Cathode PinTerminal 1
Arduino UNOL293D Motor Driver9 Volt Battery
 VCCPositive
GNDGNDNegative
D6 PinM 1 
D7PinM 2 

Make the connections according to the given diagram for the Arduino project. Connect the positive pin of the 9 Volt battery to the Vin pin of Arduino and the negative to the ground(GND) pin of Arduino.

From Arduino connect 5v to the positive rail of the breadboard and ground to the negative rail.

Connect the A0 pin of the Raindrop sensor to the digital 4 pins of the Arduino, VCC to the positive rail, and GND to the negative rail.

Connect the L293D motor driver pins with Arduino digital 6 and 7 pins as shown and motor 1 pins to the dc motor. Now connect 9 volts battery to the VCC and GND of the motor driver module.

Connect digital 3 pins of the Arduino to the positive leg of the LED and negative leg to breadboard ground via a 220-ohm resistor. After completing the circuit upload the given code.

IMG 20220222 115358
IMG 20220222 115436

 

Code of the Project

NOTE: Upload the Arduino code given below as it is. Click here if you don’t know how to upload the code.

 int val = 0 ;  
 void setup()  
 {  
  Serial.begin(9600);  
  pinMode(4,INPUT); // rain sensor output pin connected  
  pinMode(3,OUTPUT); // led pin  
  pinMode(6,OUTPUT); // motor  
  pinMode(7,OUTPUT); // motor  
 }  
 void loop()   
 {  
  val = digitalRead(4); // rain sensor output pin connected  
  Serial.println(val); // see the value in serial mpnitor in Arduino IDE  
  delay(100);  
  if(val == 1 )  
  {  
  digitalWrite(7,HIGH);  
  digitalWrite(6,LOW);  
  digitalWrite(3,HIGH);  
  }  
  else  
  {  
   digitalWrite(7,LOW);  
   digitalWrite(6,HIGH);  
   digitalWrite(3,LOW);  
  }  
  }  

What is Rain Sensor? Rain sensor explanation, Working & Uses

What is Rain Sensor? Rain sensor explanation, Working & Uses

Rain sensor Arduino Mini Project

DHT11 Temperature and Humidity Sensor | DHT11 sensor

Soil Moisture Sensor Working, explanation, Schematic

Thanks for visiting hope you learn the project well. Please do check out more Arduino tutorials.

HAPPY LEARNING!

Video sample

Related Posts

Bluetooth Controlled Car

How to Make an Arduino Bluetooth Controlled Car | Easy DIY Tutorial

Introduction In this section, introduce the project by explaining what an Arduino Bluetooth Controlled Car is. Highlight that it’s a smart car built using an Arduino microcontroller…

Pestiside Sprinkler robot

Pestiside Sprinkler robot for Farming | Autonomous Farming Robot

Hey guy, welcome back to the Techatronic. In this article we are making a Pesticide Sprinkler robot or we can also say this robot an Autonomous robot….

Colour sorting machine Project

Colour Sorting Machine Project Arduino and TCS3200

Today we are going to make a colour sorting machine using arduino and TCS 3200. The colour sorting machine Project is very unique and useful project. So we are…

Sun Tracking Solar Panel using an Arduino

Sun Tracking Solar Panel using an Arduino

An energy source that is obtained from nature without harming the environment is called renewable energy. Solar energy is one of the most well-known forms of renewable…

Top 10 Engineering Projects

Top 10 Engineering Projects

Hey guys, welcome back to Techatronic. Today we are presenting you “Top 10 Engineering Projects” The need for solutions to common issues is driving up the complexity…

NRF24L01 Wifi Gateway with Arduino

ESP8266 NRF24L01 Wifi Gateway with Arduino NRF24L01 Node

Hello guys. Welcome back to Techatronic. This tutorial will show you how to connect an Arduino board to a NodeMCU ESP8266 wirelessly using the NRF24L01 transceiver module….

This Post Has One Comment

  1. It’s not working
    Motor are continuously forward direction rotate and rain drop sensor module are two LEDs is directly on without water drop sense

Leave a Reply

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