You are on page 1of 4

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/344050318

Real Time Weather Prediction System Using IOT and Machine Learning

Conference Paper · March 2020


DOI: 10.1109/ICSC48311.2020.9182766

CITATIONS READS

9 4,295

3 authors, including:

Gaurav Verma
Jaypee Institute of Information Technology
76 PUBLICATIONS   342 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

DESIGN OF ULTRA LOW POWER CMOS TEMPERATURE SENSOR FOR AEROSPACE APPLICATIONS View project

High Performance Computing View project

All content following this page was uploaded by Gaurav Verma on 22 September 2020.

The user has requested enhancement of the downloaded file.


Real Time Weather Prediction System Using IOT
and Machine Learning
Gaurav Verma Pranjul Mittal Shaista Farheen
Department of Electronics & Department of Electronics & Department of Electronics &
Communication, Communication, Communication,
Jaypee Institute of Information Jaypee Institute of Information
Dayananda Sagar College of
Technology, A-10, Sector-62, Technology, A-10, Sector-62,
Engineering,
Noida (U.P.)-India Noida (U.P.)-India
gaurav.verma@jiit.ac.in pranjulmittal97@gmail.com Bangalore(Karnataka)-India
shaistafarheen7997@gmail.com

recorded data values of temperature, humidity and light


Abstract—Today’s the focus has been shifted towards intelligent intensity. Further, it is used for prediction.
technologies like IoT and Machine Learning. Many IoT hardware
platforms are available for IoT implementations. ESP8266 chip is one
II. LITERATURE REVIEW
of them. This paper implements the real time weather prediction
system that can be used in number of applications like homes, Jitcha Shivang et al. developed a simulated system to predict
industries, agriculture, stadiums etc. for predicting the weather weather condition of Indian subcontinent using Machine
information. The system utilizes a temperature and humidity sensor Learning. Data for training was collected from data.gov.in,
i.e. DHT11 and a light intensity sensor i.e. LDR. The sensed data ncdc.noaa.gov and UCI machine learning data repository. The
from the sensors are uploaded to a ThingSpeak cloud server using system utilizes a linear regression algorithm for data training
NodeMCU and ESP8266-01 module. The data is also displayed on a
[1]. Zaheer Ullah Khan et al. utilized different information
customized HTML webpage for monitoring the real time values. A
logistic regression model is used for setting up the machine learning digging methods for expectation of climate determining
environment. This model is trained using the pre- recorded values of including diverse groupings like K-Nearest Neighbor,
sensor data. Further, NodeMCU records the data from sensors i.e. Decision Trees. Among the order algorithms, decision tree has
temperature, humidity and light intensity and then the values are accomplished promising outcomes contrasted with different
transferred to the Jupyter notebook that utilizes a python calculations. In this paper they have achieved an accuracy of
environment. This real time data is used to test the model and 82% [2]. Siddharth S. et al. have utilized information mining
prediction is done for a particular value by blinking the led connected strategy and Decision tree calculation to group climate
to NodeMCU. parameters like least temperature and most extreme
Keywords—NodeMCU, Jupyter Notebook, DHT11, ThingSpeak,
temperature as far as day, month and year [3]. Radhika et al.
LDR.
presented a paper on the use of Support Vector Machines for
I. INTRODUCTION climate forecast. Time arrangement information of every day
greatest temperature at an area was dissected to anticipate the
Will it rain and the match gets dismissed or will it be bright
most extreme temperature of the following day at that area
and sunny? How can it be determined that whether the
dependent on the day by day most extreme temperatures for a
conditions are suitable for conducting a cricket match or not?
range of past n days alluded to as request of the info.. Non
The temperature is too high this summer, will it be rain or not?
straight relapse technique was utilized to prepare the SVM for
The answer to these types of questions is only given by the
this application [4]. Divya Chauhan et al. utilized information
concept of machine learning in conjunction with IoT. To
mining, an instrument that predicts practices and future
develop an IoT system, a thing is required which should be
patterns, enabling organizations to settle on proactive choices.
equipped with necessary sensors, actuators and a
This paper introduces the survey of data mining techniques for
communication interface. The communication interface is
weather prediction and concentrates the advantage of utilizing
needed to connect the thing to the internet that allows them to
it. The paper can be utilized to foresee meteorological
send the data to cloud or at remote machine for monitoring and
information that is climate expectation. The paper gives a
also for analytics purpose. The thing can also receive the
review of accessible writings of a few calculations utilized by
control information based on some analytics and take some
various specialists to use different information mining
actuating decision. In the proposed system, the things refer to
methods for weather prediction [5]. After studying all the
the NodeMCU that includes firmware, which runs on the
papers, it has been concluded that the training data is taken
ESP8266 Wi-Fi SoC. The cloud refers to the ThingSpeak
from some external source. But in this paper, all the data is
platform for monitoring the data. The analytics refers to the
measured in different conditions using a set of sensors. In this
machine learning algorithm i.e. a logistic regression
paper, two sensors viz. LDR and DHT11 have been used that
mathematical model. This model is trained with the pre-
measures temperature, humidity and light density.

978-1-7281-5493-0/20/$31.00 ©2020 IEEE

322

Authorized licensed use limited to: Cornell University Library. Downloaded on September 08,2020 at 05:31:31 UTC from IEEE Xplore. Restrictions apply.
III. COMPONENTS AND SOFTWARE REQUIRED (words, pictures, and other media) and code written in HTML,
ESP12/NODE MCU (CP2102) CSS, and JavaScript to control the look and behavior of that
NodeMCU is an updated version of Arduino with inbuilt wifi content. Jupyter notebook is a very popular and flexible tool
chip as shown in Fig.1. It is cheaper than other modules which helps put the code, output of the code and any kind of
performing the same function. visualization or plot etc. in the same document.

Fig.1. NodeMCU Board Fig.4. Circuit Diagram


DHT sensor
It is a module used for measuring temperature and humidity as
shown in Fig. 2. It uses a capacitive humidity sensor and a
thermistor to measure the surrounding air’s humidity and
temperature.

Fig. 2. DHT11 Module

LDR Sensor
It is a device used for measuring the light density. It works on
principle of photoconductivity. When LDR exposed in dark, Fig.5. Schematic Diagram
its resistance decreases and when exposed in light its
resistance increases as shown in Fig. 3.

Fig.3. LDR Module


Breadboard
It is typically a hand wired circuit using a pegboard with press
in terminals. Wire wraps or hand soldered wires connect
discrete components together. Connecting Wires/Jumpers are
used to connect NodeMCU to the LDR and DHT11.

IV. SOFTWARE USED Fig.6. Block Diagram of the Complete IoT System
The Arduino IDE (Integrated Development Environment) is V. WORKING
the environment, where code is written, compiled and
uploaded to the Arduino or Arduino compatible board. Two different sensors are connected with NodeMCU, which
ThingSpeak is an Internet of Things platform that lets the user measure temperature, humidity and light intensity as shown in
to collect and store sensor data in the cloud. An HTML web Fig. 4 and Fig. 5. LDR is connected to analog I/O pin and the
page is a plaintext document with an .html or .htm file name remaining sensors are connected to digital I/O pins. The
extension. Typically, it also contains multimedia contents complete block diagram of the system is demonstrated in Fig.

323

Authorized licensed use limited to: Cornell University Library. Downloaded on September 08,2020 at 05:31:31 UTC from IEEE Xplore. Restrictions apply.
6. Using NodeMCU data is sent to the ThingSpeak cloud TABLE I. COMPARISON WITH EXISTING SYSTEMS
server (database) as shown in Fig. 8. Further, Thingspeak S. S. Bhatkande1 Y. Radhika et al.
Proposed
sends data to the NodeMCU in form of a JSON file, so that et al. [3] [5]
data can now be displayed on a HTML Web Page that reflects Accuracy 84% 82.62% 80%
measured readings of different sensors as shown in Fig. 9. At
the same time, a Google spreadsheet is also used to record the Max and Min
Temperature, Max and Min
Temperature,
different values of temperature, humidity and light intensity in Parameters
Humidity Temperature,
Rainfall, Cloud
a csv file format [6]. This recorded data is used to train the and Humidity
used Conditions
Light and
machine learning algorithm. A model based on Logistic Intensity Wind Speed
And
Regression [8] in Jupyter Notebook (Python IDE) is used and Wind Stream
Algorithm Logistic Artificial Neural
trained with the pre-recorded values stored in the Google used regression
Decision Tree
Network
spreadsheet. Further, NodeMCU records the real time values
of temperature, humidity and light intensity of a particular
place or location that are used to test the model and take
CONCLUSION
decision. These values are sent to the Jupyter Notebook using
serial communication between NodeMCU and Jupyter The real time weather prediction system presented in this
Notebook. With the help of the model an attempt to predict the paper has been developed around low cost IoT board and
feasibility of a match is made. After that, either logic ‘0’ or ‘1’ sensors. The temperature, light and humidity are the three
is sent by the Jupyter Notebook to the NodeMCU as a important parameters that are monitored and uploaded on
predicted result [7]. A LED is used to predict the match result. thingspeak cloud [9]. The system has been deployed in an
The accuracy of this model is approx 84% as shown in Table I. indoor environment and values of the parameters have been
recorded in Google spreadsheet. A Logistic regression model
RESULTS has been used in Jupyter notebook environment that is trained
with prerecorded values of parameters and used to predict the
weather parameters in real time environment. The result of the
model is also compared with the other works available in
literature and the proposed system is slightly better in terms of
accuracy. Further, the system can be modified to be used at
commercial level and have many applications in smart homes,
buildings, sports, hospitals etc.

REFERENCES
[1] J. Shivang, S. S. Sridhar, “Weather prediction for indian location using
Machine learning,” International Journal of Pure and Applied
Mathematics, vol. 118, no. 22 pp. 1945-1949, 2018.
[2] Z. U. Khan and M. Hayat, “Hourly based climate prediction using data
Fig.7. HTML Webpage mining techniques by comprising entity demean algorithm” Middle-East
Journal of Scientific Research 21, vol. 8, pp. 1295-1300, 2014.
[3] S. S. Bhatkande1, R. G. Hubballi2, “Weather Prediction Based on
Decision Tree Algorithm Using Data Mining Techniques.” Belgaum
India: International Journal of Advanced Research in Computer and
Communication Engineering, vol. 5, no.5, pp. 483-48, 2016.
[4] Y. Radhika, and M. Shashi, “Atmospheric temperature prediction using
support vector machines.” International Journal of Computer Theory and
Engineering 1.1, vol. 1, no. 1, pp.1793-8201, 2009.
[5] D. Chauhan, J. Thakur, “Data mining techniques for Weather Prediction:”
International Journal of Computer Science Trends and Technology
(IJCST), vol. 6, issue 3, pp.249-254, 2018.
[6] S.S. Badhiye, B. V. Wakode, P. N. Chatur, “Analysis Of Temperature
And Humidity Data For Future Value Prediction” International Journal Of
Computer Science And Information Technologies , vol. 3, no.1 pp.3012-
3014, 2012.
[7] F. Olaiya, Adesesan Barnabas Adeyemo, “Application of Data Mining
Techniques in Weather Prediction and Climate Change Studies”, IJCSNS
International Journal of Computer Science and Network Security, vol.17,
no.6, pp 22-25, 2017 .
[8] G. J. Sawale, S. R. Gupta, “Use of Artificial Neural Network in Data
Mining For Weather Forecasting”, International Journal Of Computer
Science And Applications vol. 6, no.2, pp.383-387, 2013.
[9] A. Gautam, G. Verma, S. Qamar, S. Shekhar, “Vehicle Pollution
Monitoring, Control and Challan SystemUsing MQ2 Sensor Based on
Internet of Things”, Wireless Personal Communications (An International
Journal of Springer with impact factor of 1.2), November 2019.
https://doi.org/10.1007/s11277-019-06936-4

Fig.8. Thingspeak Cloud Platform

324

Authorized licensed use limited to: Cornell University Library. Downloaded on September 08,2020 at 05:31:31 UTC from IEEE Xplore. Restrictions apply.
View publication stats

You might also like