IoT-Enhanced Weather Monitoring System: Affordable Hardware Solution for Real-Time Data Collection, Storage, And Predictive Analysis

: An IoT-based weather monitoring system that collects and stores weather data allowing easier access and recording is what this project entails. It is also incorporated with the ability to predict future weather data based on previous recordings. Keeping track of weather conditions is one of the most concentrated areas in our current society. Weather monitoring systems are built to collect these data from a wide range of areas. And there exist satellite systems which do similar work over a wider range of area. The goal of this project is to develop an inexpensive weather monitoring system that can gather these same data over a given area over time. The system is made of hardware built with ESP8266 (NodeMCU) and a website. The hardware device and the server transfer data using the industry-standard HTTP connection protocol. There exist various sensors like temperature sensors, humidity sensors, rain sensors and pressure sensor which are suitable for the full functioning of the system. These sensors collect and transmit data to a server via a Wi-Fi module to be stored and can be accessed on the webpage. These data are then analysed and used in predicting future data.


INTRODUCTION
Thanks to high-speed internet, people from all over the world are connected.Humans and technological objects that are capable of communication and are linked by the Internet of Things.Smart devices that can recognize and react to changes in energy usage at the local and global levels are being created using IoT (Asghar et al., 2015).In order to provide information on the weather at a particular location, weather stations use science and engineering.Weather stations gather climatological information about the current weather in a particular area and forecast the local weather.However, the weather varies every day.Recording recent weather updates are necessary to get an accurate result.Before, people were cooped up in their homes, preoccupied with household chores or working in offices, and unaware of the economic and environmental boundaries and changes taking place outside of those structures.They were unaware of the outside climate's estimated moisture content, the temperature outside, whether it was rainy or not, or whether it was normal or extremely high or low.This gadget can offer a useful resolution in these circumstances.Human life is significantly impacted by the weather.Collecting different weather components has many advantages for humans.To make it simple to check climate parameters, the study installed a framework for climate monitoring.Numerous sensors, such as humidity, temperature, and others, are included in this framework.
Climate parameters are preserved by clouds.As a result, anyone who has been verified can use the internet to access climate data from any location.The information is passed to verified people in the event of a disaster, such as a meaningful downpour, fire, temperature, unbearable wind, or soaker, which is very helpful in returning to the previous state.Several variables, such as air temperature, air pressure, moisture, and rainfall, affect a location's weather.By considering these elements, we can easily comprehend how the external environment is impacted (Shahadat et al., 2020).
Weather monitoring holds great importance in society as it plays a crucial role in various areas.It enables the collection of information about weather changes, which is essential for agricultural field weather conditions, industrial conditions monitoring, and event planning (Al-Furati, Al-Assfor and Abdul Zahra, 2023;Sutar, 2020).Weather monitoring helps guide pharmacists, farmers, and others in making appropriate decisions based on precise statistics (Firmansyah et al., 2020).Additionally, it is important for space technology research and development, as weather is constantly changing and difficult to predict using human senses (Keyanfar, 2022).Weather variables such as wind speed, temperature, humidity, and rainfall are crucial in determining the course of events in agriculture and water resource management (Bhanaria, Sen and Karothia`, 2022).Furthermore, monitoring weather conditions is essential for optimizing industries, preventing accidents, and conserving energy in portable weather stations.Overall, weather monitoring is vital for understanding the present climate, detecting changes in climate, and predicting future environmental changes.

LITERATURE REVIEW
The Internet of Things is defined as an open and extensive network of intelligent objects with the ability to self-organize, share information, data, and resources, and act and react in response to situations and changes in the environment (Madakam et al., 2015).Most common domains are now being impacted by the application of the Internet of Things.IoT systems have been developed to manage, control, and keep an eye on routine human behaviours, environmental conditions or animal behaviours (Mabrouki et al., 2021).For many years, people have tried to understand their surroundings.As a result, people have created a wide range of tools to measure different parameters.To measure temperature, atmospheric pressure, and solar radiation, respectively, humans created thermometers, barometers, and pyrometers.Conversely, using traditional tools necessitates taking direct readings from instruments.On the other hand, thanks to the development of IoT, humans can now remotely measure all environmental parameters.Therefore, it is now easier than ever to quantify and measure environmental parameters.
Weather monitoring is extremely important and is used in a variety of fields, including agriculture and industry.Weather monitoring allows us to keep an eye on factors like temperature, humidity, atmospheric pressure, light rain, wind speed, and wind direction.To keep the industrial and agricultural sectors in balance, all weather variables must be present.Several different human activities are impacted by the weather.Although they have some similarities, people often confuse weather and climate.
Climate is the average of various weather patterns over many years for a particular location, as opposed to weather, which represents the daily changes in the state of the atmosphere over a short period.Farmers can monitor weather parameters on their farms with the help of weather monitoring.This is also useful for industrial processes such as planning, working days, and the effects of weather conditions on productivity.Finally, weather monitoring is very important and has a positive impact on society (Iswanto and Muhammad, 2012).
Rao unveiled an IoT-based system for weather monitoring in 2016.In the same year that the system was developed, Ram and Gupta created a weather visualization system that used wireless sensor networks.The system measured a variety of parameters including temperature values, light intensity, and carbon dioxide level.This latter can record information about humidity, light, and temperature.The collected data is then uploaded to a website for monitoring.
Kumar created a new system in 2017 using the Raspberry Pi card and internet of things technology.The system was designed to measure the parameters of the air, including temperature, carbon monoxide and dioxide levels, air pressure, and humidity.
Reddy et al. proposed an inexpensive weather monitoring system based on internet-of-things technology in 2018.For sensing the air quality, the proposed system made use of several electronic sensors, including those that could detect hydrocarbons, sulphur dioxide, nitrogen oxides, and others.The system activated the warning alarm if it received dangerous gas values.Additionally, it can send a Short Message Service (SMS) message to the end user.Finally, it was linked to a distance database created to keep track of previous measurements.Following that, Kumari et al. proposed an IoT-based, Android-based system for monitoring the environment.The system's capabilities include measuring some of the soil, water, and air factors that are used to assess the environment.The system has some sensors connected to a Raspberry Pi card because of these factors.After receiving the measured parameters, the card uses a wireless network to send its values to a remote database.
Durrani put forth a smart weather station in 2019 to track weather variables.Numerous sensors built into this system gather data from users' locations and send it to the cloud.

SYSTEM ARCHITECTURE
This project involves the creation of an IOT-based weather station that collects weather data over time to detect weather conditions, stores them in a cloud system, and predicts future weather conditions based on those values.The project is split into two parts: an Arduino-based IoT weather station and a web application.The IoT weather monitoring system is made up of a NodeMCU ESP8266 Development board, jumper wires, a DHT11 temperature/humidity sensor, a rain sensor, and a battery power source.Thingspeak is the IoT platform for displaying sensor data which is the platform being considered in this project.
The method is split into two parts, hardware engineering and software development, as was previously mentioned.The hardware development process includes both the steps of creating circuits and creating prototypes.Also included in the software are circuit simulation, schematic diagrams, data acquisition, and IoT coding.The system is able to display the weather by analysing the current conditions using sensor value data.Three types of sensors-temperature, humidity, rain, and pressure is used to track the weather parameters.A microcontroller called NodeMCU is in charge of managing all the data, and an Esp8266 serve as the client, getting sensor data from NodeMCU and displaying it online.IoT technology is generally suggested to be used as a medium of communication for this project as was mentioned in the preceding section.
After the microcontroller ESP8266 is set up all of the sensors and has started reading data from them, the system process starts.The data is then wirelessly transferred to the Thingspeak IoT platform over the ESP98266 Wi-Fi network.The system's controller, the ESP8266, gathers all of the data collected by the sensors that are connected to it.(Kamble et al., 2017).Figure 1 shows the block diagram of the entire system design.

SYSTEM COMPONENTS
The components used in any system have a significant impact on its design and implementation.A system's design can be significantly impacted by poor component selection.When choosing components, keep the following things in mind: i.
The necessary performance and capacity.ii.
The initial capital and continuous costs.iii.
Utilization and reliability.The components selected for the proposed model are; NodeMCU ESP8266 development board.ii.
Rain Water sensor.iv.
Power source.

NodeMCU ESP8266 Development Board
The  an object and transmit a signal to a specially calibrated electronic circuit, which establishes the object's temperature.Hydrocarbon polyelectrolyte is used as a moisture sensor material in forced air humidity sensors, on the other hand, for humidity sensing.The DHT11 sensor is a popular temperature and humidity sensor that features an 8-bit microcontroller for serial data output of temperature and humidity values and a dedicated NTC for temperature measurement.The DHT11 temperature and humidity sensor contains a temperature and humidity sensor complex with a validated digital signal output.Through the use of a unique digital signal acquisition technique as well as temperature and humidity sensing technology, it ensures high reliability and excellent long-term stability (Fujimoto, 2000).Figure 3 shows an image of DHT11.

Figure 3 DHT11 Sensor Rain Sensor
A device that senses rainfall is called a rain sensor.It performs similar duties to a switch.The system relies entirely on internal reflection to function.The detection pad and the sensor module are the two parts that make up this sensor.The sensor module reads the data from the surface of the sensing pad when rain is present in order to process and convert it into analog or digital output.The sensing pad's resistance varies in direct proportion to the amount of water present on the surface.As a result, conductivity improves with increased water content and decreases with decreased water content.The device works like a potentiometer, so the amount of water having fallen on the sensing pad causes a change in the sensing pad's resistance.The rain sensor is shown in figure 4 below;

Figure 4
Rain Sensor

BMP180 Sensor
One of the sensors in the BMP XXX series is the BMP180.These sensors are intended to gauge both atmospheric and barometric pressure.It is a consumer-focused sensor with a high level of precision.
Everywhere there is air, there is barometric pressure because the air has weight and exerts pressure on everything.This pressure is sensed by the BMP180 sensor, which then outputs the data digitally.The five-pin module and the four-pin module are its two available modules.This project uses a five-pin module instead of a four-pin module because it has an extra +3.3V pin. Figure 5 shows the image of BMP180 sensor.

SYSTEM CIRCUIT DIAGRAM
The way the system operates is by sending data gathered by the sensor to thingspeak, an IoT webserver.The NodeMCU Esp8266 WIFI module is connected to all of the system's components.Two pins connect the rain sensor module to the sensing pad.The module's A0 pin is then linked to the Node MCU's A0 pin.Its ground pin is grounded and its VCC pin receives 3V from the NodeMCU 3V pin.
The ground pins of the BMP180 and the DHT11 are both grounded, and 3V is supplied to each device's VCC pins.The data pin of the DHT11 is connected to the microcontroller's D3 pin, and the SCL pin of the BMP180 is connected to the D1 pin. Figure 6 shows the circuit diagram.

COMMUNICATIONS WITHIN THE SYSTEM
The IoT weather station is built with an Arduino IDE using a NodeMCU for the hardware aspect and using Thingspeak, jupyter notepad, Microsoft Excel and python for the software aspect.

IoT-Based Weather Reporting System
This IoT-based weather reporting system collects weather parameters over time to detect weather conditions, stores them in a cloud system, and predicts future weather conditions based on those values.The project is split into two parts: an Arduino-based IoT weather monitoring system and a web application or web server known as Thingspeak.

Hardware Layout of System
The system's hardware layout demonstrates how the cables, sensors, and microcontroller are connected.The complete incorporation of the hardware components is depicted in Figure 8. Hardware Design of Prototype Webserver ThingSpeak is the webserver used to track the system readings.You can gather, visualize, and analyse real-time data streams using ThingSpeak, a cloud-based IoT analytics platform.This website receives data from the hardware device that is collected and sent to channels that allow viewers to view the data.The interface of a ThingSpeak channel that has been set up for data collection is shown in Figure 9.

Figure 9
Webserver interface for collecting weather data

Live Data Stream on Thingspeak
The data collected by the weather monitoring system automatically uploads to the thingspeak which can be viewed live.The data is progressive as long as the system is connected to a power source as shown figure 10 below.

Figure 10
Real time readings from system

PREDICTIVE ANALYSIS
Predictive analytics involves utilizing data to anticipate future outcomes.This research methodology employs data analysis, machine learning, artificial intelligence, and statistical models to identify patterns that have the potential to predict future behaviour.

ARIMA Models
ARIMA, short for 'Auto Regressive Integrated Moving Average,' is a category of models that can be used to estimate future values by following a particular time series using its own previous data, that is, its very own delays and forecast errors.The standard notation for ARIMA models is ARIMA (p, d, q), where p denotes the order of the autoregressive model or the lag, d the degree of differencing, and q the order of the moving average.In the forecasting of collected data, ARIMA models was used.

Working Principle of the Model
ARIMA models transform a non-stationary time series into a stationary one via differencing and then estimate future values from the past.In order to predict future values, these models employ "auto" correlations and moving averages over residual errors in the data.
The models operate on stationary data, these data have their statistical properties such as mean, variance, autocorrelation etc. constant over time.This stationary data makes predictions relatively easier because of its consistent values making it valid to assume the same trend in future data.This model works on the basis of the following three principles: This part of the model deals with subtracting one observation from another observation in previous time step in order to make the time series stationary in case of non-stationary data.The general dth order differencing is given by:   ′ = (1 − )    Where B = backshift operator Moving Average: The moving average model MA(q) is focused on using previous errors in the auto regressive model to make future predictions.It uses a regression-like model to improve upon errors made in previous predictions back in the auto regression model.The linear equation is given by:   =  +   +  1  −1 +  2  −2 + ⋯ +    − Each value of Yt can be considered as a weighted moving average of the past few forecast errors.

Model Training and Prediction
The ARIMA model is put through series of training in order to enhance the exactness of its forecasting.Its role is to be fed with a series of data for it to predict the future values of the data.The first set of data was fed into the model for prediction, the algorithm runs the example data set and made it first predictions which has a large root mean square deviating broadly for the actual existing future data.Different set of example data was also fed into the model for prediction and based on the previous errors and margin of deviation, the model adjusted to predict better future values which were closer to the actual values as compared to the initial run.This method was repeated numerous times for different dataset to a point where the root mean square became minimal.
The model was then used to predict future values of a collected temperature data.The figure below is the graphical representation of data demonstrating the prediction made by the model.A temperature dataset of a weather data was collected and fed to the model after series of training the model.Based on the values of the data, the model was able to predict approximately the next two (2) months of temperature values.After a period of time the actual collected data was compared to the model's prediction and the variation is insignificant.

CONCLUSION
The research involves developing an IoT-driven weather monitoring system that acquires continuous weather data, identifies weather conditions, stores the information in a cloud-based system, and predicts upcoming weather based on the gathered values.Upon completion, the IoT-enabled weather monitoring system efficiently gathered and stored diverse weather data on the Thingspeak web server at a specific location, implementing the model for forecasting future weather conditions.Furthermore, it facilitates real-time monitoring of local weather from any global location and operates with low power consumption.The system is both cost-effective and recommends establishing a private web server for data storage and monitoring, connecting the model to this server for forecasting future values Online ISSN: 2054-0965 (Online) Website: https://www.eajournals.org/Publication of the European Centre for Research Training and Development -UK 44 ://www.eajournals.org/Publication of the European Centre for Research Training and Development -UK 45 Online ISSN: 2054-0965 (Online) Website: https://www.eajournals.org/Publication of the European Centre for Research Training and Development -UK 47 i.
ESP8266 is a low-cost System-on-a-Chip, and the NodeMCU is an open-source environment for developing hardware and software.The ESP8266 comes with a CPU, RAM, Wi-Fi, modem operating system, and a Software Development Kit (SDK).With the Arduino Integrated Development Environment (IDE), the NodeMCU ESP8266 Development Board can be programmed.A Wi-Ficapable ESP8266-based microprocessor unit on an Arduino-UNO footprint is shown in Figure 2.
Figure 2NodeMCU V3 ESP8266 WiFi Module Figure 7Flow Chart of Weather Monitoring System Figure 8Hardware Design of Prototype Webserver ThingSpeak is the webserver used to track the system readings.You can gather, visualize, and analyse real-time data streams using ThingSpeak, a cloud-based IoT analytics platform.This website receives data from the hardware device that is collected and sent to channels that allow viewers to view the data.The interface of a ThingSpeak channel that has been set up for data collection is shown in Figure9.
://www.eajournals.org/Publication of the European Centre for Research Training and Development -UK 53 Auto Regression: It entails auto regressive model which uses past data values to determine future data value of a working system.The model takes in the data and uses the dependent relationship between an observation and some lagged observations of the data.The linear equation defining the predictions of lagged value of Y until a number of times in the past (p) which is an AR(p) model, an Auto Regressive in order of p is given by:  =  +  1(−1) +  2(−2) +. . .+ (−) +   Where p = number of lagged observations in model C = Constant  = Parameters  = white noise at time t Integrated: Integrated(d) deals with the difference of raw data value observations that allows time series to be implemented.The data values are substituted with the continuous change in data values and previous values.Differencing is taken d times until the original series becomes stationary.
Figure 11Graphical display of actual dataset Fig.11is a full dataset of a weather data collected and fed to the model.Fig.11is the initial half of dataset.After a series of training the model, this example had the smallest root mean square, therefore, making the predicted data in Fig.12very close to the future values of Fig.11which appear in blue in Fig.12.

Figure 12
Figure 12 Graphical display of Predicted dataset