Design of A Prototype Local Smart Weather Station Based On Wi-Fi
Design of A Prototype Local Smart Weather Station Based On Wi-Fi
Abstract--
A. and prediction have IoT technology [6,7]. The recording of measured parameters in
Weather status [email protected],
[email protected],
become an important part of human life because of their many a cloud database is important for controlling irrigation; it can
applications in most walks of life. The conventional methods of also be used to predict the status of the climate [8]. Prediction
operating such standard weather stations need expert workers, of weather is an important application of new technologies and
which adds extra cost to running such stations. In this paper, a
science to forecasting the state of the weather for future times
local wireless weather station suitable for installation in a
university campus or other similar establishments has been
[9], such as using machine learning algorithms to predict wind
designed and implemented based on an Arduino Uno speed for power system security and reliability [10]. Additional
microcontroller to measure needed environmental parameters parameters can be expected because of their effect on traveling
such as temperature, rainfall, humidity, wind speed, and wind and agriculture, such as predicting rainfall using a neural
direction. These measured parameters are sent to a web server network [11]. In this paper, weather parameters are measured
that broadcasts the weather status over a wireless local area and transmitted wirelessly over Wi-Fi using a microcontroller
network (Wi-Fi) to the clients as a webpage. The main aim of this and a set of low-cost sensors. Section II describes the system
work is to design and implement a low-cost wireless weather hardware requirements. Section III explains the system design
station that does not exceed 100 USD and compare the
strategy, while Section IV is devoted to the results and
measurement parameters with a standard weather station of the
type (GRWS100). The practically recorded results of such
discussion. Finally, section V gives a conclusion to this paper.
parameters over one week from this designed prototype station
were in good agreement with the standard weather measurements II. SYSTEM HARDWARE REQUIREMENTS
recorded via the typically installed station over the same period.
The proposed system's main tasks are recording weather
Keywords----local weather station, Arduino, Wi-Fi, sensors
parameters such as temperature, humidity, rainfall, wind speed,
and direction. These parameters can be measured using
I. INTRODUCTION dedicated sensors, which are read via a microcontroller and
displayed locally on a liquid crystal display (LCD) and sent to
The automatic weather station is an instrument that performs the local server. This server can then broadcast them over Wi-
measurement and documentation of meteorological conditions Fi as a website that can be shown on any web browser installed
by using special sensors without human intervention. The on personal computers or smartphones without depending on
measured weather conditions are saved in a data logger or sent operating systems such as windows, android, or IOS. Finally,
to a central location. The saved data are then downloaded to a this web server can be connected to the Internet, and the
dedicated computer for next-time processing. Therefore, weather parameters of a location can be monitored from
computer communication networks are essential for an anywhere in the world. The block diagram of the suggested
automatic weather measurement station [1]. The development system is shown in Fig. 1. All components used in the proposed
of automatic weather stations was achieved by interfacing method are available in the local markets, and their prices are
weather condition sensors with microprocessors or within reach.
microcomputers via serial or parallel ports and then printing the
measured parameters [2]. Many strategies have been adopted in
designing weather-sensing systems, such as developing an
embedded system to measure temperature in a building by
using a local area network connected to smartphones where the
temperature is read and sent to the customers to avoid accidents
[3]. Other researchers used sensors that can be added to the
embedded system, which can be extended to the measured
parameters of climate and transfer the measured data via
wireless technology [4]. Other researchers interested in
transition media measured the weather parameters using node
MCU Wi-Fi and IoT technologies [5]. Real-time weather Fig 1. Weather station block diagram
measurements are important for automated systems such as the
computerized irrigation system via the online application using
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
978-1-6654-5193-2/22/$31.00 ©2022 IEEE 559
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
A. Temperature
One of the most critical parameters in weather conditions is
temperature. The LM35 is an analog sensor that produces an
electrical signal proportional to temperature, as shown in Fig.
2. This sensor does not need any external hardware for
calibration as it has a scaling factor which is (0.01V/ºC),
(V=5v) [12].
Symbol Description
MCU pulls low data lines for at least 18 ms. It pulls it up
and waits for DHT's response(20-40µs)
Fig 2. Temperature Sensor DHT responds by pulling the data line low for 80µs and
then pulling it up for another 80µs to indicate RTS (Ready
B. Humidity to send)
For bit 0 DHT pulls a low data line for 50-54µs and pulls
Humidity measures the mass water ratio between moist air up for 24-26µs
and dry air. Humidity measures the mass water ratio between For bit 1 DHT pulls a low data line for 50-54µs and pulls
up for 70-71µs
humid air and dry air. The DHT11 is a digital humidity sensor
that produces a digitally calibrated output signal. It is used in
this project because of its assuring reliability and stability. This C. Rainfall
resistive type humidity sensor can measure the humidity in the This sensor measures moisture conductivity as an analog
output signal (0-5v), and it can provide a digital output signal
range of 20% to 90% with accuracy (±5%). The moisture is
(0 or 1) depending on the threshold level of moisture. This
calculated according to the following formula: sensor comprises an LM393 operational amplifier, electronics
𝑝
𝑅𝐻 = ( 𝑤) ∗ 100% (1) components, and a circuit board for collecting rainwater.
𝑝𝑠
Parallel resistance is connected across this sensor which can be
RH is the relative humidity, 𝑝𝑤 is the density of water vapor, measured through the operational amplifier. The lower value of
and ps is the density of water vapor at saturation. this resistance indicates Heavy Rain, while the high value
This sensor can be interfaced with a microcomputer indicates Light Rain, as depicted in Fig. 5 [14].
depending on digital input-output ports, as shown in Fig. 3. The
sensor sends 40 bits of information to the microcomputer,
which puts low addresses after high addresses, containing 16
bits for humidity data and 8 bits for checking data. Fig. 4
shows the bus timing of data transmitted between DHT11 and
the microcomputer [13]. Table I shows the overall description
of the DHT11 communication process.
D. Wind Speed
An anemometer can be utilized for wind speed
measurement. Such a device is used to measure the Speed of
Fig 3. Humidity sensor Air. The SEN0170 is a (0-5V) voltage type sensor, which can
measure wind speed in the range (of 0-30 m/s) with (0.1m/s)
resolution, as shown in Fig. 6 [15].
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
560
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
The wind direction sensor has a 20 kΩ variable resistor H. W5100 Ethernet Shield
attached to it. The output of the direction sensor is an analog The Ethernet shield allows the microcontroller of the
voltage ranging (from 0 to 5V) for direction (0 to 360º) with a Arduino board to access the Internet via the serial input-output
resolution (of 22.5°) as depicted in Fig. 7 [16]. port. The W5100 Ethernet shield provides a network address
(IP) capable of operating with TCP and UDP protocols. This
Ethernet shield can support four socket connections
simultaneously, as displayed in Fig. 10 [18]. The Ethernet
shield has been used for wired and wireless local area networks
and additional network devices that can be connected for an
extended area of wireless data transmissions, such as routers or
access points. It is noticeable that the shield consists of a
micro-SD card slot, which can be used to record information on
the weather as a dataset.
Fig 7. Wind direction sensor
Fig 8. The 16×2 liquid crystal display This system has been implemented for real-time monitoring
of weather parameters. The core of the weather station is the
G. Arduino Uno Board microcontroller-based Arduino Uno board which is interfaced
with both analog and digital sensors to measure the weather
The Arduino is a microcontroller board to interface with the conditions and display them on LCD for local monitoring, as
weather sensors and displays their LCD information. The shown in Fig. 11. The recorded data are sent to the local server
Arduino can be programmed with C/C++ computer language (Ethernet shield W5100) that is connected to the
and interfaced with a computer via a USB port. It consists of microcontroller and configured as a server. The information on
digital and analog input /output ports [17]. There exist many this server can be transmitted over a wireless local area
types of this device. The Arduino Uno has been used in this network as a web page, as shown in Fig. 12, for monitoring by
research, as shown in Fig. 9. a personal computer, tablet, smartphone, or any other devices
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
561
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
with Wi-Fi that can be connected to the server via a TP-Link All data collected from the proposed system are compared
router as shown in Fig. 13. The system flowchart is shown in with those recorded simultaneously by a standard weather
Fig. 14. The Arduino Uno establishes all required libraries for station of the type (GRWS100) manufactured by Campbell
reading data from sensors and applies the necessary scaling Scientific [19]. GRWS100 is a portable weather station that
mathematical factors for the manipulated data coming from uses (CR1000) data logger and supports all near
sensors to be converted to standard units as will be shown later communications such as RS-485, TCP/IP Ethernet, and
in this section. The Arduino Uno and the web server were wireless RF401A operated with 900 MHz. It can provide many
programmed using C++ IDE Arduino programmer. The measurements (wind speed, wind direction, air temperature,
Arduino Uno reads the output values from the sensors using an relative humidity, rainfall, and some other parameters), as
analog-to-digital converter (10-bit ADC). The analog function shown in Fig. 15.
analogRead() is the software instruction for reading the analog The Mean Absolute Percentage Error (MAPE) is used as an
value. The humidity sensor uses the DH11 library for indication factor for comparison between the measured and
interfacing with Arduino Uno for data measurement serially. standard results as depicted in (6):
The Arduino board calls the library of programming DHT11
with instruction (dht.begin();). 𝑀𝐴𝑃𝐸 =
1
∑𝑛𝑖=1
|𝑇𝑖 −𝐸𝑖 |
(6)
𝑛 𝑇𝑖
5000
𝑇𝑒𝑚𝑝 = (𝑡𝑒𝑚𝑝 × ) ÷ 10 = 0.488 𝑡𝑒𝑚𝑝 (2)
1024
30
𝑆𝑝𝑒𝑒𝑑 = (𝑠𝑝𝑒𝑒𝑑 × ) × 3.6 = 0.105 𝑠𝑝𝑒𝑒𝑑 (3)
1024
Dir is the wind direction in degrees, and dir is the data of the
sensor coming from (10-bit ADC) with a range (0-1024). The
wind direction symbols and their angles are shown in Table II.
100
𝑅𝑎𝑖𝑛 = (𝑟𝑎𝑖𝑛 × ) = 0.0977 𝑟𝑎𝑖𝑛 (5)
1024 Fig 12. Weather station server home page
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
562
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
563
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
Sun 25 23 29 29 34 32 0 0
Mon 19 20 24 24 54 54 75 70
Tue 21 21 12 12 60 59 25 25
Wed 22 22 17 17 52 52 20 23
Thu 23 21 21 21 41 40 10 10
Fri 25 24 14 14 32 32 10 13
Sat 24 24 11 11 37 35 0 0
Fig 16. The observed data for one week compared with the standard weather
measurement equipment
V. CONCLUSION
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
564
2022 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)
components, are in reasonable agreement with the readings of a [13] G. M. Debele, and X. Qian, “Automatic room temperature control system
standard weather station. In this form, this station can serve its using Arduino Uno R3 and DHT11 sensor, ”17th International Computer
Conference on Wavelet Active Media Technology and Information
purpose locally if installed in schools, colleges, or similar Processing (ICCWAMTIP), 2020, DOI:
premises. Furthermore, improvements can be added to this 10.1109/ICCWAMTIP51612.2020.9317307.
[14] S. Kanetkar, A. Rathore, K. Maheshwari, P. Dubey, and A. Saxsena,
system by adding more sensors for detecting dust and other
“Smart helmet wiper,” IEEE International Students' Conference on
types of pollution. This line of research is a subject of a future Electrical, Electronics and Computer Science (SCEECS), 2020, DOI:
topic in this field 10.1109/SCEECS48394.2020.40.
[15] R. S. Singh, D. J. Gelmecha, T. H. Ayane, and D. K. Sinha, “Functional
REFERENCES framework for IoT-based agricultural system,” Chapter 4 in the book
titled: AI, Edge, and IoT-based smart agriculture, Ajith Abraham, Sujata
[1] J. Mabrouki, M. Azrour, D. Dhiba, Y. Farhaoui, and S. El Hajjaji, “IoT- Dash, Joel J.P.C. Rodrigues, Biswaranjan Acharya, and Subhendu Kumar
based data logger for weather monitoring using Arduino-based,” Big Data Pani (Editors), 2022, Academic Press.
Mining and Analytics, ISSN 2096-0654 04/07 pp25–32, vol. 4,1, March [16] S. K. Venkata, B. K. Roy, and N. Nair, “An adaptive calibration technique
2021, DOI: 10.26599/BDMA.2020.9020018DOI: for thermistor with varying temperature coefficient and reference
10.26599/BDMA.2020.9020018. resistance,” F1000Research, 11(281), 2022, DOI link:
[2] A. A. El-Magrous, J. D. Sternhagen, G. Hatfield, and Q. Qiao, “Internet of https://doi.org/10.12688/F1000RESEARCH.109499.1
Things based weather-soil sensor station for precision agriculture,” IEEE [17] M. F. I. U. Haque, S. Sabina, M.M. Khan, and I. Nanda, March,
International Conference on Electro Information Technology (EIT),92-97, “Arduino-based smart design of a cheaper and portable automated
May 2019, DOI: 10.1109/EIT.2019.8833811. cardiopulmonary resuscitation (CPR) device,” 6th International
[3] S. P. Meduri, N. Diwan, and A. Meduri, “Vehicle control simulation Conference on Computing Methodologies and Communication (ICCMC),
system with embedded digital real-time weather station,” 3rd International 2022, (pp. 1098-1105). IEEE, doi: 10.1109/ICCMC53470.2022.9754034
Conference on Intelligent Sustainable Systems (ICISS), 03-05 December [18] A. Goeritno, and F. Hendryan, “Monitoring dan Kendali Tegangan
2020, DOI: 10.1109/ICISS49785.2020.9316129. Jaringan Listrik Fase-tiga melalui Smartphone, (Monitoring and control of
[4] M. Zbieć, and D. Obrębski, “Multipoint wireless humidity and temperature the voltage on a three-phase electrical network by smartphone),” Jurnal
monitoring network for HVAC systems validation,” 27th International RESTI (Rekayasa Sistem Dan Teknologi Informasi), 6(1),pp. 32-40, 2022,
Conference on Mixed Design of Integrated Circuits and System, MIXDES DOI: https://doi.org/10.29207/resti.v6i1.3662.
2020, Wroclaw, Poland, June 25-27, 2020,
DOI:10.23919/MIXDES49814.2020.9155754. [19] Campbell Scientific, “General Research-Grade Weather Station
[5] D. K. Singh, H. Jerath, and P. Raja, “Low-cost IoT enabled weather (GRWS100),” https://www.campbellsci.com.au/grws100 (accessed on 21
station,” International Conference on Computation, Automation and March 2022).
Knowledge Management (ICCAKM), 2020, DOI:
10.1109/ICCAKM46823.2020.9051454.
[6] J. V. Rocha, R. R. Magalhães, L.G.de, Carvalho, A.V. Diotto, and B. H. G.
Barbosa, “Development of a low-cost weather station and real-time
monitoring for automated irrigation management, ”Acta Scientiarum.
Technology, 44(1), e59244, 2022,
https://doi.org/10.4025/actascitechnol.v44i1.59244.
[7] P. B. Leelavinodhan, M. Vecchio, F. Antonelli, A. Maestrini, and D.
Brunelli, “Design and Implementation of an Energy-Efficient Weather
Station for Wind Data Collection,” Sensors, 21(11), 3831, 2021,
https://doi.org/10.3390/s21113831.
[8] T. T. Rajapaksha, A. Alexander,L. Fernando, A. Then, and H. L. Nguyen,
“Real-Time weather monitoring and IoT-based palmtop device for smart
agriculture,” SN Computer Science, 3(1), 1-6, 2022, DOI: 10.1007/s42979-
021-00961-6.
[9] Md. I. Haque, A. H. Md. Shatil, A. N. Tusar, M. Hossain, and H. Rahman,
“Renewable powered portable weather update station,” International
Conference on Robotics, Electrical and Signal Processing Techniques
(ICREST), 2019, DOI: 10.1109/ICREST.2019.8644330.
[10] A. Dolatabad, H. Abdeltawab, and Y. A. I. Mohamad, “Hybrid deep
learning-based model for wind speed forecasting based on DWPT and
bidirectional LSTM network,” IEEE Access vol. 8, pp. 229219 – 229232,
2020. DOI: 10.1109/ACCESS.2020.3047077.
[11] F. Zhang, X. Wang, J. Guan, M. Wu, and L. Guo, “RN-Net: A deep
learning approach to 0–2-hour rainfall nowcasting based on radar and
automatic weather station data,” Sensors, 21(6), 2021, 1981;
https://doi.org/10.3390/s21061981.
[12] T. H. Nasution, and L.A. Harahap, “Predict the percentage error of lm35
temperature sensor readings using simple linear regression analysis,”4th
International Conference on Electrical, Telecommunication and Computer
Engineering (ELTICOM), 2020, DOI:
10.1109/ELTICOM50775.2020.9230472.
Authorized licensed use limited to: Universiti Tun Hussein Onn Malaysia. Downloaded on June 11,2024 at 12:40:13 UTC from IEEE Xplore. Restrictions apply.
565