Design of Rainwater Detection System Based on Arduino

By using Arduino development board and rain sensor connection, a simple rain detection system can be easily made. The sensor will detect any rainfall and the Arduino development board will sense it and perform the required operations. Such a system can be used in many different fields, such as agriculture and automobile. Rainfall detection can be used to automatically adjust the irrigation process. Moreover, continuous rainfall data can help farmers use the intelligent system to automatically water crops only when needed. Similarly, in the automotive field, the wiper can be fully automated by using the rain detection system. Moreover, the home automation system can also use the rain detection function to automatically close the windows and adjust the room temperature. In this article, we will use Arduino and buzzer to make a simple rain sensor. You can then make whatever you want based on this setting. In addition, please note that the rain sensor module is also called raindrop sensor or rain sensor according to the use, but in this paper, they all refer to the same sensor and the working principle is the same.

Materials required

● Arduino uno development board

● rain sensor

● buzzer

● bread board

● connecting wires

rain sensor

The rainfall detection module consists of two circuit boards, namely, the rainfall sensor circuit board and the control board.

The rain sensor circuit board module (rain sensor) consists of two copper wires, which are designed so that they can provide high resistance to the power supply voltage under dry conditions, and the output voltage of the module is 5V. With the increase of humidity on the circuit board, the resistance of the module decreases gradually. As the resistance decreases, the output voltage will also decrease relative to the humidity on the module. The rain sensor circuit board module consists of two pins for connection to the control board, as shown below.

The control board module controls sensitivity and converts analog output to digital output. If the analog value is lower than the threshold of the control board, the output is low level; If the analog value is higher than the threshold, the output is digital high. For comparison and conversion, LM393 operational amplifier comparator is used. Operational amplifier comparator is an interesting circuit that can be used to compare two different voltage values.

As shown below, the rainfall control module consists of four pins for connecting Arduino, namely VCC, GND, d0 and A0, and the other two pins are used to connect the rainfall sensor circuit board module. In short, the rain sensor circuit board module detects rain, and the control board module is used to control sensitivity and convert analog values into digital values.

Working principle of rain sensor

The working principle of the rain sensor module is easy to understand. During sunny days, because the module is dry, it has a high resistance to the power supply voltage. The voltage is 5V on the output pin of the module. If read by the analog pin of Arduino, this 5V reads 1023. During rain, rain will increase the humidity of the rain sensor module circuit board, resulting in a decrease in resistance. As the resistance decreases, the output voltage begins to decrease.

When the rain sensor module is completely wet and the resistance provided by it is the smallest, the output voltage will be as low as possible (about 0). If read by the analog pin of Arduino, this 0V will be read as a value of 0. If the module is partially wet, the output of the rain panel module will depend on the resistance it provides. If the output of the resistor supplied through the rain shield module is 3V, the analog value read will be 613. The formula for finding ADC can be obtained by the following formula: ADC = (analog voltage value x 1023) / 5. By using this formula, you can convert any analog voltage to an Arduino analog read value.

Circuit diagram

The following circuit diagram shows the circuit connection between Arduino and rain sensor.

The rain sensor module shown in the circuit diagram is connected to the control board. The VCC pin of the control board is connected to the 5V power supply. The ground pin is grounded. If necessary, the D0 pin can be connected to any digital pin of Arduino, and the pin must be declared as an input pin in the program. Since d0 pin outputs high and low level signals, we cannot obtain the exact output voltage value of d0 pin. If the output pin exceeds the threshold voltage, the control module can monitor the change of the output. Even if the output voltage in the rain sensor module changes a little, we need to operate the buzzer. For these reasons, we use the A0 pin and connect it to the analog pin of Arduino, which makes it easy to monitor output changes. The buzzer can be connected to any digital pin of Arduino. If the buzzer requires more than 5V, try using relay circuits or transistors.

Code description

The Arduino code of the rain sensor is written using the Arduino ide. The complete code of the project is given at the end of this article.

#define rainfall A0

#define buzzer 5

int value;

int set=10;

Define pin A0 as raincall, pin 5 as buzzer, declare variables "value" and "set" as integers, and set its variable set value to 10. You can change this value according to the actual situation. If you want to start the buzzer even if it rains very little, set the variable value to the minimum value.

void setup()

Serial.begin(9600);

pinMode(buzzer,OUTPUT);

pinMode(rainfall,INPUT);

Initialize the serial communication, set the buzzer as the output pin and the raincall pin as the input pin.

void loop()

value = analogRead(rainfall);

Serial.println(value);

value = map(value,0,1023,225,0);

In the loop function, the function analysisread reads the value of the rain sensor. Serial.println (value) prints the value on the serial port monitor, which is very helpful in debugging. The map function maps the value of the rain sensor on the output pin and assigns a value to the variable, ranging from 0 to 225.

if(value>=set)

Serial.println("rain detected");

digitalWrite(buzzer,HIGH);

If the read sensor value is greater than the set value, the program enters the cycle, prints a message on the serial port monitor and turns on the buzzer

else

digitalWrite(buzzer, LOW);

Only when the value is less than the set value, the program enters the else function. When the set value is greater than the value of the sensor, the buzzer will be turned off, indicating that there is no rain.

Work of rainwater detection system based on Arduino

The working mode of the system is: when it rains, the rain acts as a trigger to trigger the buzzer. In the Arduino code of the raindrop sensor, we define pin 5 as the buzzer and A0 as the raindrop sensor pin.

This is one of many application scenarios of rain sensor, and the same principle will be seen in wiper, other home automation, agricultural departments, etc. I hope you understand the project and like to make it.

Editing: hfy

Design of Rainwater Detection System Based on Arduino 1

get in touch with us
recommended articles
What Are Some Ways to Keep My Hair Really Healthy?
Use professional shampoo & conditioner. I know it may seem like a rip-off, however all the shampoos like Pantene, Garnier, etc. have a high alcohol content....since the normal pH of your hair is 4.5-5.5, things containing high amounts of alcohol throw your hair all out of whack and cause breakage, split-ends, fly-aways, etc. The reason these shampoos make your hair feel soft is because they contain high amounts of humectants, which are just a cover for how damaging they really are! Another tip is ALWAYS use a thermal protector while applying heat. Heat appliances cause tons of damage to your hair. Usually this is a cream/clear gel you apply before blow drying. Never use a flat iron on hair that is not completely dry!1. Split End Help. ( 10 Points) !!!!!!!!!!!!!!!!!!!!!!?For sure you should get a trim and maybe even cut your hair as short as you are comfortable doing it. You should for no reason straighten or dye your hair. Look for some Garnier Fructis or Pantene shampoos and conditioner for curly hair so that it extra moisturizes it and helps the split ends repair themselves. I say from experience that ppl with curly hair have really bad split ends, which is why we have special stuff in our hair products. The split ends wont magically go away in like a month or a few weeks, but you will see improvement after a while. Oh, and for sure DO NOT PICK THEM OFF!! It will just make it worse. Every two months until your hair is healthy get a trim. just maybe half an inch or an inch will be just fine. Eventually your hair will go back to normal. Good luck with that!.2. Whats the best shampoo conditioner for cheap?clever or V05 are solid inexpensive ($a million) shampoos, yet whilst it is composed of conditioner i could bypass Tresemme ($6) it does an somewhat solid interest. i take advantage of salon shampoo because of the fact i am form of a hair snob, yet I nonetheless use the cheap conditioner. Pantene is undesirable on your hair (too plenty protein and reasons alot of greater build up on the hair) so i does not bypass there. desire this permits! My hair is oily, superb, and colour-taken care of if that helps you any!3. How can I get my curly hair to be nice like Taylor Swift?Haha i have the same hair long and curly..but not pretty curly! im completely obsessed with taylor and her hair so i did so playing with it and what you really NEED to get is the conair hot sticks!! they are these little flexible curlers and they are not very expensive and i would look like a frizz ball without them!! you can like get them at walmart. anyways what i do when iwear my hair curly is like i get up and get in the shower and wash it and condition it and this may sound weird but dont use a whole lot of conditioner just enough to get it done cause it will help your hair hold the curl the just get out and towel dry your hair till it is just damp and then put a curling mouse in it and frizz serum then finish blow drying it straight! and you know have the curlers on like when your gettin in the shower and then just make sure the little light is on meaning that they are hot enough and then seperate your hair into pretty small peices (if you have really thick hair then you might need to buy two sets cause they only have 14 in them and you use small sections) and then start from the botom of your hair and role it through your hair and pin it together youll see the instructions on how to pin them together and make sure you wrap it all the way to the top of your head and leave them for like 15 or 20 minutes while your finishin gettin ready and then use like a light hairspray about 5 minutes before you take them out then your done. i know this thing was really long but its not that hard lol!!!! hope i helped good luck!!!!!!!!
How to Choose a Satisfactory Sweeping Robot
Research and Design of Home Gateway System Based on ARM9
Three Different Classifications of BMS System
How Was the First Sale of Vivo X60 Series?
Huami Technology Held a Press Conference on August 27, and Amazfit Smart Sports Watch 3 Officially A
Connect to Nonencrypted Wireless Network Using Ubuntu Commands
Is Time Travel Possible? Can We Travel Back in Time?
Which Is a Better Design to Put on a Beer Pong Table?
What Else to Do on PS3?
related searches
How to Choose a Satisfactory Sweeping Robot
Research and Design of Home Gateway System Based on ARM9
Three Different Classifications of BMS System
What Are Some Ways to Keep My Hair Really Healthy?
How Was the First Sale of Vivo X60 Series?
Huami Technology Held a Press Conference on August 27, and Amazfit Smart Sports Watch 3 Officially A
Connect to Nonencrypted Wireless Network Using Ubuntu Commands
Is Time Travel Possible? Can We Travel Back in Time?
Which Is a Better Design to Put on a Beer Pong Table?

Copyright © 2020 Coffee bag - Guangzhou tianci packaging industry Co,. Ltd. | Sitemap