B Tammetin
B Tammetin
B Tammetin
net/publication/380226214
CITATIONS READS
6 208
1 author:
Serhat Küçükdermenci
Balikesir University
23 PUBLICATIONS 45 CITATIONS
SEE PROFILE
All content following this page was uploaded by Serhat Küçükdermenci on 01 May 2024.
Abstract – Those who work in professions that require evaluating changes in their immediate environment, such as farmers,
sailors, travelers, miners, need to collect data from the real world. Regular monitoring of meteorological parameters such as
precipitation, wind direction and speed, temperature, atmospheric pressure, humidity, light intensity, dust, and altitude is of great
importance in preventing risks or disasters. This study proposes a system consisting of various sensors, a microcontroller
(Arduino Uno), an LCD display and a real-time clock. The proposed system is a cost-effective and reliable weather station for
anyone who wants to regularly monitor environmental changes. The screen shows time and date information, nine environmental
data, and machine learning-generated rain forecasts. Multivariate regression is preferred for machine learning algorithm. Since
humidity, temperature and light intensity are provided from the sensor data, the value of a, b, c, and k from the machine learning
model is provided. To predict the probability of rain in percentage, the steps are explained in detail. Thanks to the up and down
buttons connected to the microprocessor, many data can be observed simultaneously by the user on the 20x4 LCD screen. Unlike
advanced weather observatories that can operate on a large scale, the distinguishing feature of this device is that it can be applied
in any critical situation or local area.
Keywords – Multiple linear regression model, Sensors, Smart monitoring, Rain forecaster, Weather station, Machine learning.
I. INTRODUCTION
Weather forecasting is very important for sailors, travelers, farmers, and mine workers. Sailors use weather
forecasts for ship navigation, routes, and safety. Weather conditions such as storms, fog, wave height and wind speed
affect maritime activities [1]. Weather forecasts help ships travel safely. Travelers take weather forecasts into
consideration when making travel plans. Weather is important for outdoor activities, routes, and clothing. Weather
forecasts are vital, especially in outdoor activities such as hiking, camping, and mountaineering. Farmers plan the
planting, harvesting and maintenance of agricultural products according to weather forecasts. The amount of
precipitation, temperature, and wind speed affect plant growth. Weather forecasts are essential for efficient
agricultural production. Miners must take weather conditions into account when working underground. Temperature,
humidity, and air quality affect working conditions in mines. Weather forecasts are important to keep workers safe
and reduce risks. These professional groups use weather forecasts to do their jobs more efficiently and safely.
Weather is a part of daily life and vital to these professions.
Commonly used traditional forecasting techniques include trend, continuity, climatology rely on a few basic
assumptions to predict weather into the future [2]. Continuous measurement of weather conditions has become
essential for agriculture, forest management, ecophysiology, and many other disciplines. Weather conditions are
important for efficient agricultural production. The amount of rainfall affects plant growth. Temperature determines
the development of products. Wind speed affects dust transport and plant health. Forest fires spread depending on
weather conditions.
Moisture affects the health of forest ecosystems. Wind affects the durability of trees. From an ecophysiological
perspective, plant photosynthesis is sensitive to weather conditions. Temperature affects plant metabolism. Humidity
determines plant water balance. Climate change makes weather conditions even more important in terms of
environmental protection. Water sources vary depending on the amount of rainfall. Natural disasters may increase
depending on weather conditions. These disciplines aim to make more sustainable and informed decisions through
weather forecasts and continuous measurements. Weather is a critical factor for the conservation of natural resources
and the sustainability of human life.
Climate change has become a major problem worldwide. This phenomenon highlighted the need for the public and
local authorities to be better prepared for unexpected weather events. Climate change has increased extreme weather
909
events. These include severe storms, floods, droughts, and heat waves. Risk indices are used to warn the public and
local governments against these unexpected events. Climate change risks directly affect people's lives. It is important
for the public to understand these risks and take precautions. As a result, climate change risk indices are important to
alert the public and local authorities to unexpected events and enable them to be better prepared.
Increasing world population and increasing food demand reveal the need to significantly increase global food
production. By 2050, the world population is expected to increase by more than 25%, reaching approximately 10
billion. Producing enough food for this growing population is a critical issue both to meet people's nutritional needs
and to combat global warming. In this context, technological developments that enable precise monitoring of
meteorological data are needed [3]. Weather conditions directly affect agricultural production. Factors such as
rainfall, temperature, wind speed and humidity determine plant growth and productivity. Precise meteorological data
is used to produce more efficiently in agricultural fields. Weather forecasts help predict natural disasters (e.g. drought,
flood, storm) in a timely manner. In this way, agricultural areas and products can be protected. Meteorological data
is important in the management of irrigation systems. Precipitation forecasts ensure effective use of water resources.
As a result, monitoring meteorological data through technological advances plays a critical role for food security and
sustainable agriculture.
Microcontroller-based intelligent environmental parameter monitoring refers to a system that uses microcontrollers
(small, programmable devices) to continuously monitor and collect data related to various environmental parameters.
These parameters can include factors such as temperature, humidity, light intensity, soil moisture, gas concentrations,
and more. The goal is to create a smart system that provides real-time information about the environment, allowing
for better decision-making and control in various applications. For example, in greenhouse farming, maintaining
optimal environmental conditions is crucial for crop growth. Microcontroller-based systems can monitor parameters
like temperature, humidity, light levels, and soil moisture [4]. By collecting and analyzing this data, farmers can
make informed decisions to enhance crop yield and quality. Urban weather stations use microcontrollers to measure
weather parameters such as temperature, humidity, wind speed, and air quality. The data collected helps in
understanding local climate patterns, pollution levels, and potential health risks. Intelligent systems can provide real-
time updates to users through web interfaces or mobile apps. Microcontroller-based intelligent environmental
monitoring systems play a vital role in agriculture, urban planning, and environmental conservation by providing
accurate and timely information for better resource management and decision-making [5].
The use of multiple sensors in agriculture or weather monitoring stations allows for the evaluation of data analytics,
climate change, changes in rainfall, groundwater resources, and changes in human metabolism, among other factors.
The studies in the literature exhibit a wide spectrum of approaches. For instance, Shaout et al. [6] measured three
meteorological variables, namely temperature, wind speed, and wind direction, and transferred the information to an
LCD screen. Alam et al. [7] utilized an Arduino Uno-based weather station for real-time monitoring. Ioannou et al.
[8] presented a comprehensive review of the technologies currently employed for the implementation of automatic
weather stations. The outcomes encompass test measurements obtained from low-cost sensors installed within the
unit and predictions provided by deep learning algorithms running locally. Kavin et al. [9] proposed a model in which
sensors are deployed to monitor factors such as temperature, humidity, and CO value. The data is collected using an
IDE (Integrated Development Environment). The final client receives the result evaluation over Wi-Fi. At each stage
of sensing, the devices are controlled by an ATMega328 controller, which also collects sensor information and sends
it to the end clients over the cloud. Murthy et al. [10] proposed a system that utilizes Internet of Things (IoT)
technology to construct a weather monitoring and reporting system with the objective of enhancing the precision and
dependability of weather data. The system can monitor a multitude of meteorological variables, including
temperature, humidity, atmospheric pressure, and wind speed. The collected data is then transmitted to a central
processing hub, where it can be subjected to analysis and transformed into real-time weather information. Holovatyy
[11] proposed the construction of a weather monitoring system based on an Arduino and an ESP8266 Wi-Fi module,
to be developed using the Proteus simulation tool. The primary program gathers, processes, and transmits weather
data via the MQTT protocol to either the Mosquitto server or the ThingsBoard IoT platform. Visualization dashboards
for the IoT data received from the Mosquitto server are created using Node-RED, while those for the data received
from the ThingsBoard IoT platform are created using the ThingsBoard Dashboard. In addition to these studies, a
comparative analysis of weather stations is presented in Table 1. The comparison in the table was created with
parameters such as processor, sensor, architecture, connection, low cost, data access.
According to the literature, it is seen that the number of sensors used, and the information collected are limited. In
this study, a real-time smart monitoring system that can monitor many sensors with time and date information and
predict rain is presented. The system allows individuals to observe the environment remotely. The basic factors
discussed here help monitor weather conditions and changes in the environment such as humidity, temperature,
altitude, pressure, wind speed and direction, precipitation, light degree, and dust information. Individually, without
910
depending on forecasting institutions, you can warn farmers about risky weather conditions, improve the wildlife of
animals and people, warn urban residents, protect people from floods. Information can be obtained by monitoring
weather conditions and analyzing changes in the nearby climate.
Even small-scale atmospheric changes can significantly affect the weather. Therefore, constant monitoring is
crucial for accurate weather forecasting. Predicting the weather has been a human endeavour since ancient times.
However, it was not until the advent of modern technology and the development of advanced tools and equipment
that weather forecasting became a more scientific and reliable endeavour. A weather forecast system is essentially
an automated system that monitors various weather parameters and uses a database of past weather conditions to
predict the likelihood of precipitation along with other parameters. This study presents a cost-effective and portable
Arduino-based weather forecasting system.
DHT-22 is a preferred sensor for measuring the temperature and relative humidity of the surrounding environment
due to its ultra-low cost, low power consumption, easy programming, and high accuracy. The slow sampling rate in
DHT-22, equal to 0.5 Hz, sends data readings to the microcontroller every two seconds. Vcc and Data pins are
connected to 5V and Digital pin D6 respectively. The third pin remains open (not connected). The fourth pin, the
GND pin, is connected to GND on the Arduino UNO.
The rain gauge calculates the amount of rainfall in millimetres or inches over a fixed period and records the data
accordingly. A rain gauge has a funnel, two bucket units connected to form a seesaw. Rainwater flows into the funnel
and ends up in the reservoir. The tipping bucket system represents the most common rain measurement system. It
uses a reed switch that is activated when a certain amount of rain (typically 0.2 mm) has collected, allowing the small
bucket to move. Some measuring systems include a piezoelectric transducer for direct measurement of precipitation
drops hitting the surface. This converter provides information about rainfall intensity and frequency. In this study,
the rain gauge in the Proteus simulation program library was used as seen in Figure 2.
Wind speed and direction sensor (DC motor with propeller) is the device used to measure the direction and speed
of the wind. This device, called anemometer, is a typical weather station equipment. A DC motor can be used as a
wind anemometer and the flux change that causes EMF formation on the microcontroller is measured and the
proportional wind speed is calculated. Wind direction can be measured using digital compass-based equipment [19].
The dust sensor is an infrared-emitting diode with a light-dependent resistor (LDR) phototransistor arranged in
hardware. It can be used to detect light reflected from dust in the air. Sharp GP2Y1010AU0F is a typical dust sensor
with analog interface. In the simulation, a potentiometer was used to represent the dust sensor and was connected to
the analog A2 pin of the microcontroller.
LDR is a resistor whose resistance depends on the intensity of light radiation incident on it. LDR can be used to
measure the light intensity of the environment. It is connected to connected to the analog A1 pin of the
microcontroller.
In addition to the sensors mentioned above, a real-time clock (model DS3232) was used to provide current time
and date information with each measurement. Figure 2 shows hardware of the weather monitoring system developed
in Proteus VSM.
B. Software requirements
For the environmental parameter monitoring system to work, each piece of equipment must be configured in
accordance with the schematic diagram and programmed to work with other equipment. The Arduino
microcontroller, which includes the code to manage the operation of all components, serves as the processor of the
system. In this proposed study, Arduino IDE was used to write computer programs that can be transferred directly to
the hardware card. In addition, libraries such as Adafruit_BMP085, LiquidCrystal_I2C, DHT, Wire, RTClib etc.
were used in this study.
912
Fig. 2 Schematic diagram of a smart monitoring system for measuring environmental parameters.
The voltage coming from the dust sensor is converted into a numerical value by the ADC on the A2 pin and
subjected to mathematical processing in the program, and the dust information in the environment in ug/m 3 is
calculated. Linear equation for dust sensor is given below in equation 1.
913
The equation for probability of rain or multiple linear regression model developed is presented in equation 2.
To achieve this equation, three different parameters were used: humidity, temperature, and light intensity. To
predict the probability of rain in percentage, the following steps are followed in machine learning. First, a data set
consisting of humidity, temperature, light intensity, and percentage chance of rain is prepared in csv format as shown
in Table 1. Since the quantity and quality of the data set determines the efficiency of the prediction, the data set must
be prepared carefully. The dataset can be searched based on real data or in online repositories like Kaggle but to keep
the method simple we can prepare our own simple dataset as shown here.
There are many machine learning algorithms to choose from and multivariate regression has been used here.
Equation (3) represents the general multiple linear regression model; where P is the annual percentage probability
that can be achieved. The variables H, T and L are the humidity, temperature and light intensity values coming from
the sensors, respectively. The variables from which the prediction will be predicted are considered as Predictors. The
coefficients of the predictors and the intercept will govern the value of the Predictand. Looking at equation 3, it can
be clearly stated that P is the Predictand, while the variables H, T and L are the Predictors. The coefficients a, b and
c determine the dominance of the relationship between the predictor variables and the probability of precipitation to
be obtained. The term k is the intercept of the regression equation, where it is a constant. The intercept is used to
adjust the shift of the predicted mean value with the observed mean value [20].
𝑃 = 𝑎∗H+𝑏∗𝑇+𝑐∗L+𝑘 (3)
Since humidity, temperature and light intensity can be read from the sensor data, the aim is to predict the value of
a, b, c, and k from the machine learning model. Python IDE like jupyter notebook can be used to import pandas as
pd and import numpy as np learn sklearn import linear model. df which stands for data frame equals to pd.read_csv
file inside quotation. Now if you type df.head the first five data set will be seen. And if you type ds.tail, the last five
data set will be seen as shown in Figure 4.
Reg equals linear_model.Linear_Regression and you should type Reg.fit line as input 4. Type Reg.coef_ to find
the coefficients those are a, b, and c. Type Reg.coef_ to find the intercept in this case d. The Reg.predict to predict
the amount of rainfall and percentage can be used for specific values humidity, temperature, and light intensity which
we pass as an argument for the predict function. Now the coefficients and intercept are found as seen in Figure 4. So,
the equation can be written which our machine learning algorithm used to predict for specific values. As it is seen
form the values of coefficients the coefficient of humidity is positive. Because it is directly proportional to possibility
of raining. Whereas the coefficient values of temperature and sunlight is negative which shows us that the possibility
of raining in sunny and hot day is low. The equation is written, and each value are substituted according to the
equation. The value which you get from the predict function is almost the same as the value which you get via
calculation. The predicted and the calculated values are the same for any points you choose. So, after getting the
coefficient and intercept you can use one of the two methods to predict for specific point.
914
Fig. 4 Steps of finding coefficients and intercept
III. RESULTS
The accurate prediction of rainfall is of great importance for the improvement of water resources planning,
development, and management. Suggested system can give nine different sensor data, rainfall probability with real
time date and time information. Generally, what the code will do is printing out the possibility of raining in percentage
on LCD. To calculate the percentage the equation is used which we got using our machine learning algorithm and
sensors data reading. After making the Proteus hardware connection and after interfacing the Arduino hex file into
the Proteus simulation we have the sensors data reading from the simulation and the equation used to predict the
probability of raining in percentage. So, the prediction becomes a matter of mathematics. The percentage possibility
of raining can be varied by changing the sensors data on the simulation. The result, an accurate percentage-based rain
prediction, can guide decision-making and risk mitigation. Unlike large-scale weather observatories, this device’s
distinguishing feature lies in its adaptability. It can be deployed in critical situations or localized areas, empowering
users with real-time insights for informed actions.
IV. DISCUSSION
The study, which has been successfully revealed in the simulation environment, can be reorganized with the
addition of other sensors, data loggers, GPS modules, etc. according to possible requirements and can be made ready
for use with real circuit elements. The system’s versatility allows for further enhancements and customization to meet
specific requirements. By integrating additional sensors, such as air quality monitors or soil moisture detectors the
system’s scope can be broadened. These sensors provide a comprehensive view of the environment, enabling users
to monitor diverse parameters simultaneously. Incorporating data loggers allows us to capture long-term trends and
historical data. Users can analyse past patterns, identify seasonal variations, and make informed decisions based on
historical context. Adding GPS module enhances the system’s spatial awareness. Users can pinpoint environmental
changes at specific locations, making it valuable for precision agriculture, disaster response, and urban planning.
V. CONCLUSION
This study introduces a cost-effective and reliable weather station system designed for those who seek to monitor
environmental changes consistently. Precipitation forecasting is a fundamental aspect of the optimal utilisation and
appropriate management of resources for different disciplines. A multiple linear regression model was developed
with the objective of predicting the probability of precipitation in percentage terms.
915
View publication stats
REFERENCES
[1] A. Rawat, D. Kumar, and B. S. Khati, “A review on climate change impacts, models, and its consequences on different
sectors: a systematic approach,” J. Water Clim. Chang., vol. 15, no. 1, pp. 104–126, Jan. 2024, doi:
10.2166/wcc.2023.536.
[2] A. Vij, S. Vijendra, A. Jain, S. Bajaj, A. Bassi, and A. Sharma, “IoT and Machine Learning Approaches for Automation
of Farm Irrigation System,” Procedia Comput. Sci., vol. 167, pp. 1250–1257, 2020, doi: 10.1016/j.procs.2020.03.440.
[3] S. H. Muhie, “Novel approaches and practices to sustainable agriculture,” J. Agric. Food Res., vol. 10, p. 100446, Dec.
2022, doi: 10.1016/j.jafr.2022.100446.
[4] Prof. Sathish and Dr. S. Smys, “A Survey on Internet of Things (IoT) based Smart Systems,” J. ISMAC, vol. 2, no. 4,
pp. 181–189, Sep. 2020, doi: 10.36548/jismac.2020.4.001.
[5] W.-S. Kim, W.-S. Lee, and Y.-J. Kim, “A Review of the Applications of the Internet of Things (IoT) for Agricultural
Automation,” J. Biosyst. Eng., vol. 45, no. 4, pp. 385–400, Dec. 2020, doi: 10.1007/s42853-020-00078-3.
[6] A. Shaout, Yulong Li, M. Zhou, and S. Awad, “Low cost embedded weather station with intelligent system,” in 2014
10th International Computer Engineering Conference (ICENCO), IEEE, Dec. 2014, pp. 100–106. doi:
10.1109/ICENCO.2014.7050439.
[7] M. J. Alam, S. A. Rafi, A. A. Badhan, M. N. Islam, S. I. Shuvo, and A. M. Saleque, “Low Cost IoT Based Weather
Station for Real-Time Monitoring,” in 2020 IEEE 2nd International Conference on Circuits and Systems (ICCS), IEEE,
Dec. 2020, pp. 127–133. doi: 10.1109/ICCS51219.2020.9336596.
[8] K. Ioannou, D. Karampatzakis, P. Amanatidis, V. Aggelopoulos, and I. Karmiris, “Low-Cost Automatic Weather
Stations in the Internet of Things,” Information, vol. 12, no. 4, p. 146, Mar. 2021, doi: 10.3390/info12040146.
[9] R. Kavin, K. Lakshmi, S. S. Rani, and K. Rameshkumar, “Weather Monitoring System using Internet of Things,” in
2020 6th International Conference on Advanced Computing and Communication Systems (ICACCS), IEEE, Mar. 2020,
pp. 26–29. doi: 10.1109/ICACCS48705.2020.9074332.
[10] M. S. Murthy, R. P. R. Kumar, B. Saikiran, I. Nagaraj, and T. Annavarapu, “Real Time Weather Monitoring System
using IoT,” E3S Web Conf., vol. 391, p. 01142, Jun. 2023, doi: 10.1051/e3sconf/202339101142.
[11] A. Holovatyy, “Development of IoT Weather Monitoring System Based on Arduino and ESP8266 Wi-Fi Module,” IOP
Conf. Ser. Mater. Sci. Eng., vol. 1016, no. 1, p. 012014, Jan. 2021, doi: 10.1088/1757-899X/1016/1/012014.
[12] J. T. Devaraju, K. R. Suhas, H. K. Mohana, and V. A. Patil, “Wireless Portable Microcontroller based Weather
Monitoring Station,” Measurement, vol. 76, pp. 189–200, Dec. 2015, doi: 10.1016/j.measurement.2015.08.027.
[13] Z. K. Hussein, H. J. Hadi, M. R. Abdul-Mutaleb, and Y. S. Mezaal, “Low cost smart weather station using Arduino and
ZigBee,” TELKOMNIKA (Telecommunication Comput. Electron. Control., vol. 18, no. 1, p. 282, Feb. 2020, doi:
10.12928/telkomnika.v18i1.12784.
[14] P. Y. Muck and M. J. Homam, “Iot Based Weather Station Using Raspberry Pi 3,” Int. J. Eng. Technol., vol. 7, no. 4.30,
p. 145, Nov. 2018, doi: 10.14419/ijet.v7i4.30.22085.
[15] K. S. Sai Ram and A. N. P. . Gupta, “IoT based Data Logger System for weather monitoring using Wireless sensor
networks,” Int. J. Eng. Trends Technol., vol. 32, no. 2, pp. 71–75, Feb. 2016, doi: 10.14445/22315381/IJETT-V32P213.
[16] M. I. Haque, A. H. MD. Shatil, A. N. Tusar, M. Hossain, and M. H. Rahman, “Renewable Powered Portable Weather
Update Station,” in 2019 International Conference on Robotics,Electrical and Signal Processing Techniques (ICREST),
IEEE, Jan. 2019, pp. 374–377. doi: 10.1109/ICREST.2019.8644330.
[17] M. Kusriyanto and A. A. Putra, “Weather Station Design Using IoT Platform Based On Arduino Mega,” in 2018
International Symposium on Electronics and Smart Devices (ISESD), IEEE, Oct. 2018, pp. 1–4. doi:
10.1109/ISESD.2018.8605456.
[18] H. Li, M. K. Ochani, H. Zhang, and L. Zhang, “Design of micro‐automatic weather station for modern power grid based
on STM32,” J. Eng., vol. 2017, no. 13, pp. 1629–1634, Jan. 2017, doi: 10.1049/joe.2017.0608.
[19] A. Pozzebon, I. Cappelli, A. Mecocci, D. Bertoni, G. Sarti, and F. Alquini, “A Wireless Sensor Network for the Real-
Time Remote Measurement of Aeolian Sand Transport on Sandy Beaches and Dunes,” Sensors, vol. 18, no. 3, p. 820,
Mar. 2018, doi: 10.3390/s18030820.
[20] M. Krzywinski and N. Altman, “Multiple linear regression,” Nat. Methods, vol. 12, no. 12, pp. 1103–1104, Dec. 2015,
doi: 10.1038/nmeth.3665.
916