How to make Rain Detection System
Rain Alarm System
Now a day’s vehicle parking is an
important issue and day by day its necessity is increasing. In Bangladesh we
are still using the manual vehicle parking system and that is why we are facing
problems like wastage of time and fuel finding free space around the parking
ground when we need to park our car which requires a good amount of lighting.
Another issue is chaos that happens while parking because there is no
particular system anyone can park anywhere that sometime causes damage to the
vehicles while moving out or in the parking lot. Security is also an issue
there.
To solve these problems we are
introducing new car parking system.
List of Materials
1. Arduino Uno
2. Buzzer
3. LCD 16x2
4. Power Supply
5. Rain Sensor
Specification
of Materials
Arduino Uno
The arduino uno is a microcontroller. It
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started. The Uno differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega8U2 programmed as a USB-to-serial
converter."Uno" means one in Italian and is named to mark the
upcoming release of Arduino 1.0. The Uno and version1.0 will be the reference versions
of Arduno, moving forward. The Uno is the latest in a series of USB Arduino
boards, and the reference model for the Arduino platform.
LCD 16x2
LCD modules are vey commonly used in most embedded projects, the
reason being its cheap price, availability and programmer friendly. Most of us
would have come across these displays in our day to day life, either at PCO’s
or calculators. The appearance and the pinouts have already been visualized
above now let us get a bit technical.
16×2 LCD is named so because; it has 16 Columns and 2 Rows. There
are a lot of combinations available like, 8×1, 8×2, 10×2, 16×1, etc. but the
most used one is the 16×2 LCD. So, it will have (16×2=32) 32 characters in
total and each character will be made of 5×8 Pixel Dots. A Single
character with all its Pixels is shown in the below picture
Buzzer
Buzzer.
A buzzer or beeper is an audio signalling device, which may
be mechanical, electromechanical, or piezoelectric (piezo for short). Typical
uses of buzzers and beepers. We are using as a signal of front
sensor.
Rain sensor
A rain sensor is composed of a rain
detection plate with a comparator who manages intelligence.
The rain sensor detects water that
comes short circuiting the tape of the printed circuits.
The sensor acts as a variable
resistance that will change status : the resistance increases when the sensor
is wet and the resistance is lower when the sensor is dry.
The comparator has 2 outputs
connected to the rain sensor, a digital output ( 0/1 ) and an analog output ( 0
to 1023 ).
Power Source
To Operate the System we need a power
Source. For this Project we are using 18650 Lion battery and Charging Board of
this.
The 18650
battery is a lithium-ion cell classified by
its 18mm x 65mm size, which is slightly larger than a AA battery.
They're often used in flashlights, laptops, and high-drain devices due to their
superior capacity and discharge rates.
Charging Board Details
Power supply: 3.2V-5V
Output Voltage: 5V/1.6A
4 Led Indicator, Switch
Circuit Diagram
Working
Steps
1.Fix the track on Hardboard. you can fix this by using hot melt glue,
screw, rubber strip.
2.Connect all the connection as shown in circuit.
3.Writing program
2.Connect all the connection as shown in circuit.
3.Writing program
4.Upload program to arduino .
5.Disconnect arduino in pc
6.Then Power to circuit and arduino
Program
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // RS, En, D4, D5, D6, D7
int rainSen_pin = A1;
int Buzzer_pin = 13;
void setup() {
lcd.begin(16,2);
Serial.begin(9600);
pinMode(rainSen_pin, INPUT);
pinMode(Buzzer_pin, OUTPUT);
digitalWrite(Buzzer_pin,LOW);
lcd.setCursor(2,0);
lcd.print("Rain Detector");
lcd.setCursor(5,1);
lcd.print("System");
delay(3000);
}
void loop() {
int RainSenReading = analogRead(rainSen_pin);
Serial.print("SensorValue:");
Serial.print("\t");
Serial.print(RainSenReading);
Serial.print("\t");
if (RainSenReading <= 400)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(4, 1);
lcd.print("Heavy Rain");
Serial.println("Rain");
digitalWrite(Buzzer_pin, HIGH);
delay (500);
digitalWrite(Buzzer_pin, LOW);
delay (500);
}
if (RainSenReading <= 800)
{
digitalWrite(Buzzer_pin, HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(8, 1);
lcd.print("Rain");
Serial.println("Rain");
}
else
{
digitalWrite(Buzzer_pin, LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(8, 1);
lcd.print("No Rain");
Serial.println("No Rain");
}
delay(250);
}
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // RS, En, D4, D5, D6, D7
int rainSen_pin = A1;
int Buzzer_pin = 13;
void setup() {
lcd.begin(16,2);
Serial.begin(9600);
pinMode(rainSen_pin, INPUT);
pinMode(Buzzer_pin, OUTPUT);
digitalWrite(Buzzer_pin,LOW);
lcd.setCursor(2,0);
lcd.print("Rain Detector");
lcd.setCursor(5,1);
lcd.print("System");
delay(3000);
}
void loop() {
int RainSenReading = analogRead(rainSen_pin);
Serial.print("SensorValue:");
Serial.print("\t");
Serial.print(RainSenReading);
Serial.print("\t");
if (RainSenReading <= 400)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(4, 1);
lcd.print("Heavy Rain");
Serial.println("Rain");
digitalWrite(Buzzer_pin, HIGH);
delay (500);
digitalWrite(Buzzer_pin, LOW);
delay (500);
}
if (RainSenReading <= 800)
{
digitalWrite(Buzzer_pin, HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(8, 1);
lcd.print("Rain");
Serial.println("Rain");
}
else
{
digitalWrite(Buzzer_pin, LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Rain Water Alam");
lcd.setCursor(0, 1);
lcd.print("Status: ");
lcd.setCursor(8, 1);
lcd.print("No Rain");
Serial.println("No Rain");
}
delay(250);
}
কোন মন্তব্য নেই