IoT-based Sun and Rain Detection System

. The field of IoT has made significant advancements by using software and sensors to collect and share data about device usage and the surrounding environment. This data analysis can be used to identify potential problems before they occur and provide solutions. This technology is applicable to various industries, including healthcare, automation, and wearable technology. Our research shows that there is a correlation between atmospheric pressure, humidity, and rain. To address the issue of people getting caught in unexpected rain, we have used the Bosch BMP280 environment monitor to predict rain and high temperatures. By measuring temperature, atmospheric pressure, and altitude and using an IoT interface with a Magnetic switch sensor, we record and transfer the data to Firebase. We notify the user with a beep if they need to carry an umbrella.

The primary goal of IoT is to facilitate communication and collaboration between people and machines.

Existing methods
A project proposal called "Smart rain" published in September 2014, presents an approach to improve the functionality of existing umbrellas. The current design requires users to manually adjust the head of the umbrella to block rain falling at different angles due to wind. The proposed project aims to extend the functionality of the umbrella by automatically adjusting the head to block the maximum amount of rain based on wind flow speed and direction. The project has several objectives, as outlined in the proposal [1].

Proposed method 2.1 Problem statement
In modern times, weather patterns have become increasingly unpredictable, especially in major cities such as Bangalore where it can shift from sunny to rainy within a few hours. This puts individuals at risk of being caught in the rain or being exposed to excessive sunlight. Despite checking weather apps, the accuracy of these predictions may not be specific to one's exact location. Implementing IoT technology can address this issue and significantly improve individuals' quality of life. Getting caught in the rain can result in various health problems like fever, cough, and flu, while excessive sun exposure can lead to dehydration, sunstroke, and other illnesses. By integrating a group of IoT projects, individuals can improve their daily routine and reduce the likelihood of such occurrences, such as carrying an umbrella.

Objectives
The Smart Umbrella Project is an IoT project with a practical application. Its main sensor, the BMP280 Environment Monitor, measures temperature and pressure in real-time and sends the data to a real-time database called Firebase. The project also includes a Magnetic Switch Sensor on the main door of the house, which records when the door is opened or closed. Whenever the Magnetic Switch Sensor detects that the door has been opened, it checks the real-time data on the Firebase to see if it's going to rain or be too sunny using the recorded average values. If the conditions are met, the Buzzer on the Umbrella will sound, prompting the user to take the umbrella with them when they leave. The project incorporates a variety of sensors and databases to make it functional.

Architecture diagram
The BMP 280 sensor along with the magnetic switch are connected to the GISMO-VI board and the GISMO-VI is connected to the firebase and the values are compared with the ideal temperatures are compared with the obtained values and then the buzzer activates if there is need for the person opening the door to carry the umbrella. Flow of the project is as follows; • The status of the magnetic switch is observed.
• Based on the status of the switch the sensor calculates the values.
• The values which are calculated are collected in the database.
• The values are then compared with the ideal values and then the condition is satisfied.
• If the condition is satisfied the buzzer buzzes else, it won't do anything.

Modules connectivity diagram
The system uses an ESP32 board as the central controller, which collects data from the BMP280 sensor and the magnetic switch sensor. The BMP280 sensor is used to measure temperature, atmospheric pressure, and altitude, while the magnetic switch sensor detects the presence or absence of an umbrella. The ESP32 board analyzes the data and sends it to the Firebase cloud platform for further processing or visualization The system is designed to notify users when there is a possibility of rain, based on the data collected from the BMP280 sensor. If rain is predicted and the umbrella is not present, the system will send a notification to the user via a beep song. The system demonstrates the potential of IoT-based solutions in providing real-time insights into weather patterns and improving our decision-making abilities.
Magnetic switch sensor: This sensor is used to detect whether an umbrella is present or not. It consists of a magnet and a magnetic sensor that detect the presence or absence of the magnet. When the umbrella is opened or closed, the magnet is moved away from or towards the magnetic sensor, causing a change in its output. ESP32 board: This is a microcontroller board that provides connectivity and processing power for the IoT system. It is programmed to read data from the BMP280 sensor and the magnetic switch sensor, and to send the data to the Firebase cloud platform. BMP280 sensor: This is an environment monitor that measures temperature, atmospheric pressure, and altitude. It is used to detect changes in weather conditions that may indicate the need for an umbrella. The ESP32 board acts as the main controller for the system, receiving data from the BMP280 sensor and the magnetic switch sensor. When the BMP280 sensor detects a change in weather conditions that may indicate rain, the ESP32 board checks whether the umbrella is present using the magnetic switch sensor. If the umbrella is not present, the ESP32 board sends a notification to the user via a beep song. The ESP32 board also sends the data to the Firebase cloud platform, where it can be analysed and used for further processing or visualization. Overall, the components work together to create a smart IoT system that can detect changes in weather conditions and notify users when they need to bring an umbrella with them.

Module 1: Collection of data
• In this module the major focus of the project is to collect data from the used sensor and the GISMO-VI board. • The data from the magnetic switch will be collected into the firebase.
• Based on the results of the Magnetic switch the BMP 280 will start calculating the temperature, pressure and humidity. • These readings will be stored in the firebase and are saved for future uses and for reference purposes. • As the backbone of any project is the data obtained from the project so, this modules plays a crucial role in building our project

Module 2: Notify/prompt the user
• The data stored on to the fire base is then tinkered and the temperature and pressure readings are stored into an array. • The first element in the array is the temperature reading.
• The second element in the array is the pressure reading • Now the status of the magnetic switch is observed and recorded.
• Then the switch status is updated into an if statement and the working of the BMP280 sensor is ordered. • Then the reading of the BMP280 sensors are compared with the ideal temperature and pressure.

Description about dataset
Rainfall prediction requires taking into consideration many different parameters like pressure, temperature, humidity etc. This dataset captures all possible variables that can affect the rainfall. The following dataset was obtained from National Center for Atmospheric Research (NCAR) for rainfall prediction in different regions around the globe given the atmospheric conditions over a period of time [4]. The dataset contains atmospheric variables over different latitude and longitude starting from the year 1948 to 2018. Details about the variables can be found at NCAR website. There are 21 features [4]. The Realtime data of the sensors is updated to Firebase. The following is the brief explanation about the Experimental Results of the Smart Umbrella when being in use. As of now we can expect two outputs based on the magnetic switch which are switch open and switch closed .The magnetic switch here is attached to the main door of the house. Depending on the output there are various outcomes that are displayed below accordingly with the help of the Serial Monitor Tool that is available in the Arduino IDLE.

When the switch is open
The Figure 5

Conclusion
This project helps the user to carry his umbrella when he goes outdoors for some work. The combined work of 3 to 4 sensors and a regular tool in our house combined by the Arduino board can result in a lifesaving product. The parameters like temperature, humidity and atmospheric pressure can help in providing or help the user in making the job of the user of our product easy and simple. The product can be effective in calculating the probability of rain even for short intervals of times. The whole ideology of the project is to make the most of just some IoT components board and a simple umbrella. The umbrella is a household object but not everyone will try to carry that umbrella when they go outdoors. This IoT interface can make the job easy for the user and just the board and some sensors like BMP 280 and magnetic switch. This solution can make the job easy for the user of the product to make sure that the user won't get sun-drenched and get wet in rain.