Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32
Abstract: This paper is written to represent a web-server based real-time weather monitoring system implemented using the ESP32 module. The system is designed to measure the weather conditions like temperature, pressure, humidity etc, in its vicinity. This system continuously provides real-time data (weather conditions) over limited or controlled areas, for example, agriculture fields, homes or a particular room, industries etc. Although we have satellites for weather monitoring but to perform research over a particular area, the data observed should be highly accurate which is not possible with satellites. To implement an IoT network we need to use a webserver to continuously store and display the real-time data which can be accessed globally. ’ThingSpeak’ is a web service where one can upload and access (globally) with internet-connected devices. ESP32 will be acting as an interface medium between the various sensors and the web-server. ESP32 module is also responsible for collecting, processing and then communicating the data to the server. The real-time data stored on the web server can be further used for research and analysis of weather conditions of a particular place.

Keywords

ESP32, IoT, Temperature sensor, Humidity sensor, Pressure sensor, Altitude sensor, Arduino IDE, ThingSpeak.

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP32AmazonBuy Now

Introduction

The evolving generation of wireless technology has made human life a lot easier. Where everything is online and automatic we can easily monitor multiple things virtually from anywhere in the world. The WSN (wireless sensor networks) and Internet of things or IoT play an important role in implementing and accessing these wireless technologies. Smart homes, smart cities and smart weather monitoring systems are examples of such technologies where things are quite simpler or easier.

In this web-server based weather monitoring system, the weather data (from the surrounding environment or of a particular location) like temperature, humidity, pressure etc. is measured with the help of some sensors and then the collected data will be stored on a server after being processed by a microcontroller. Our daily activities are inseparable from weather conditions and various environmental factors. The real-time data collected can be used in research and analysis and the results can be helpful in human life and for improving environmental conditions as well.

The Internet of Things is a system made up of multiple inter-related computing devices. The main factor ‘things’ in IoT is designated to a component that is capable of communicating data over a network (IoT), the thing could be animals, a digital machine, a sensor, a human being etc. Each component of the Internet of Things network is given an individual or a distinct identity and the ability to communicate data or information over a wireless network that is too without the intervention of a human or a computer [8].

An interface medium capable of collecting, controlling, and communicating data among transmitter and recipient electronic equipment or servers is required to build the IoT network[9].

The ESP32 microcontroller series was developed by Espressif Systems. This module (the ESP32) includes a 2.4GHz Wi-Fi chip, memory, a 32-bit Tensilica microcontroller, an antenna, peripheral interfacing abilities, power management modules, and more. This ESP32 module is excellent for the Internet of things because of all of its technological and infrastructural aspects [10].

DHT11 and BMP280 sensors are used to collect the data from their surrounding environment and then communicate the data to the ESP32 module over a particular protocol [11].

The application of this weather monitoring system can also play an important role in the field of agriculture[12 ] to increase productivity, research application, and reducing manpower (by reducing the need to manually monitor the field status). Sometimes in a particular agricultural zone that is hazardous for a human beings, it is quite difficult to manually (offline) monitor the environment or weather conditions. In such cases, this web server based or online weather monitoring system can be of great importance.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 1

Hardware and Software Components

The list and quantity of the components required to implement the web server based weather monitoring system are shown in Table1.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Table: 1

DHT11

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 2 DHT11 sensor

DHT11 sensor (or temperature and humidity sensor) is a sensor module used to measure humidity and temperature from its surrounding. This sensor module is responsible for monitoring the ambient temperature and humidity of a given area. An NTC (negative temperature co-efficient) temperature sensor and a resistive type humidity sensor make up the sensor. An 8-bit microcontroller is also included. The microcontroller performs ADC (analogue to digital conversion) and outputs a digital signal via the single wire protocol [13].

Some of the technical specifications of the DHT11 sensor are:

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Table:2  DHT11 technical specifications

DHT11 sensors can also be used to create a wired sensor system with up to 20 meters of cable.

To measure temperature and humidity, two DHT modules (DHT11 and DHT22) are available on the market. Both modules serve the same purpose, but they have different specifications. The DHT22 sensor, for example, has a wider range of temperature and humidity sensitivity. However, DHT22 is more expensive than DHT11. As a result, you can choose to use any of the modules as per your needs.

Interfacing DHT11 with ESP32[14]

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Table.3  Interfacing DHT11 with ESP32

BMP280

Another sensor we are using is the BMP280. The BMP280, also known as the barometric pressure sensor, is a temperature, pressure, and altitude sensor. This sensor's small size and low power consumption make it suitable for mobile applications, GPS modules, and battery-powered devices, among other things[15].

The Bosch BMP280 is based on Bosch's validated ‘Piezo-resistive pressure sensor technology’, which features high accuracy, long-term stability, linearity, and EMC robustness.

The barometric pressure sensor (280) is the successor to the BMP180 sensor, and it is mostly preferred in all areas where precise temperature and pressure measurements are required.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig.3  BMP280 Sensor

Fitness, indoor navigation, and GPS refinement are all new technologies which require relative accuracy, and the BMP280 is ideal for them. This module is preferred over the other available modules for temperature records or measurement because of its low TCO (Temperature coefficient of Offset).

The temperature measured with the BMP280 sensor is more accurate than the DHT11 sensor. BMP80 provides a 0.01°C accuracy rate.

Some technical specifications of the BMP280 sensor are:

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Table:4  BMP280 Technical specifications

ThingSpeak web service

A web server is a place where one can store data online and can access that data at any time and from anywhere in the world [16]. A real-time data is created with the help of a web-server. There are various web services available to store real-time data for research and analysis like AWS (Amazon Web Service), Azure, Firebase etc.

We are using the ThinSpeak web service provided by MathWorks which allows us to send sensor readings/data to the cloud. The ThingSpeak is an open source data platform for the Internet of Things (IoT) applications. We can also visualize and act on or access the data (calculate the data) sent to the ThingSpeak server from ESP32. Two different types of channels are available to store data on the ThingSpeak server namely ‘Public Channel’ and ‘Private Channel’ and one can use either of the available channels to store and display data [17].

ThingSpeak is frequently used for IoT prototyping and proof-of-concept systems that require analytics[18].

Software Used

We need to give instructions to our ESP32 module so that it can interface, read data from DHT11 and BMP280 sensors and then finally publish the collected data to the ThingSpeak server. Arduino IDE is an integrated development environment used to write, compile and debug the program for the ESP32 module[19].

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. Arduino IDE

Process Flow

The process flow of our weather monitoring system is shown below in Chart 1. The process starts with the initialization of ESP32 module which is acting as an interface medium between the sensor modules and the web-server. The ESP32 wi-fi module is continuously searching for the network credentials as per the instruction provided. After connecting to the internet the sensor modules will be initialized and the real-time data [22] collected from the surrounding environment will be pushed to the ThingSpeak web server[23].

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Flow Chart: 1

Results

The results observed from the implemented weather monitoring system are shown below. We observed four different environmental conditions which include temperature, humidity, pressure and altitude. The sensor data collected by ESP32 from DHT11 and BMP280 sensors is published to the ThingSpeak web server. On ThingSpeak we have created a channel that contains four fields to store four different environmental factors temperature, humidity, pressure and altitude.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. Hardware

In fig. 4 we can see the ‘Field 1’ which is containing the temperature readings published or communicated from the ESP32 module and saved on the ThingSpeak server.

Similarly, fields 2, 3, and 4 are displaying the humidity, pressure and altitude respectively.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 4 Temperature (°C)

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 5 Humidity

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 6 Pressure (hPa)

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Fig. 7 Altitude

Each factor is monitored at different intervals of time to observe the variations in various environmental factors. From table 5 we can see the various environmental factors and their values at different time intervals for the approximate duration of 24hrs.

Web-Server Based Weather Monitoring System Using ESP32, weather monitoring system using esp32, esp32 weather monitoring system, web server based weather monitoring system, online weather monitoring system using esp32

Table 5 Variations in weather conditions

Conclusion

We observed the weather conditions (that includes temperature, humidity, pressure and altitude) with our “Web-server based weather monitoring system using ESP32”. The observed real time data is stored on the ThingSpeak server which can be accessed globally. The different values of each (mentioned earlier) environmental factor at different intervals in time are also observed (given in table 5) and the observed result clearly shows the changes in the weather conditions for a full day cycle. Hence, we have successfully implemented and tested the web server based weather monitoring system with ESP32 and ThingSpeak web server.

References

  • Maier, A., Sharp, A. and Vagapov,  Y., November  “Comparative  analysis  and practical implementation  of  the  ESP32  microcontroller  module  for  the  internet  of things”  2017 .
  • Prisma Megantoro, Brahmantya Aji Pramudita, Vigneshwaran Pandi, “Real-time monitoring system for weather and air pollutant measurement with HTML-based UI application” June 2021.
  • Foughali Karim, Karim Fathallah, Ali Frihida, “Monitoring System using web of things in precision agriculture” 2017.
  • J.Shah and B. Mishra, “IoT enabled environmental monitoring system for smart cities,” in 2016 International Conference on Internet of Things and Applications (IOTA), 2016.
  • P.Susmitha , G. Sowmyabala, “ Design and Implementation of Weather Monitoring and Controlling System” July 2014.
  • S.Navulur, A. S. C. S. Sastry, M. N.  Giri Prasad,  “Agricultural  management  through  wireless  sensors  and internet of things” .
  • K.Siva, S. Ram, and A. N. P. S. Gupta, “IoT based Data Logger System for weather monitoring using Wireless sensor networks,” 2016
  • Ferdin Joe John Joseph, “IoT Based Weather Monitoring System for Effective Analytics”, 2249 – 8958, Volume-8 Issue-4, April, 2019.
  • A F Pauzi, MZ Hasan, “Development of IoT Based Weather Reporting System”, 2020.
  • ESP32-IoT Development Framework, https://www.espressif.com/en/products/sdks/esp-idf
  • Carlo Guarnieri Calo Carducci, Antonello Monti, Markus Hans Schraven, Markus Schumacher, Dirk Mueller, “Enabling ESP32 based IoT Applications in Building Automation Systems”, 2019.
  • R.K. M. Math and N. V Dharwadkar, “IoT Based Low-cost Weather Station and Monitoring System for Precision Agriculture in India”, 2018 (2nd International Conference on I-SMAC).
  • N. Tianlong, “Application of Single Bus Sensor DHT11 in Temperature Humidity Measure and Control System [J]”, 2010.
  • “Create a Web Server With ESP32”, https://www.theengineeringprojects.com/2021/11/create-a-web-server-with-esp32.html
  • ThinSpeak, https://thingspeak.com/pages/learn_more
  • T. Thilangam. J, T. S. Babu, and B. S. Reddy, “Weather monitoring system application using LabView”, 2nd International Conference on I-SMAC, 2018.
  • J.Weiss and R. Yu, "Wireless Sensor Networking for the Industrial Internet of Things".
  • Gaurav Verma, Pranjal Mittal, Shaista Farheen, “Real Time Weather Prediction System Using IoT and Machine Learning.
  • R.Shete, S. Agrawal, “IoT based Urban Climate Monitoring using Raspberry Pi”, International Conference on Signal Processing and Communication, 2016.