Weather Forecasting on ESP32

In any power utility corporation ash dyke management is a huge issue. For fugitive dust control huge sprinklers that spray water all along the dry portion of the dyke are used but maintenance of these sprinklers is a problem as we really don’t have any idea when it’s going to rain or when it will be windy. So the operators in such corporations were demanding for a weather forecasting terminal to overcome this issue easily.

While a $600 laptop is enough to get data from openweather.org to have an idea when it’s going to be rainy or windy, the more better option was an ESP32  which would do the same job pretty well and that too at a fraction of cost.

One might think a better option is a simple google search, but Internet also repletes with weather servers. Finding the site, signing in and then get weather data is also hectic. Some provide data in plain http output while others prove in json or xml format. Almost all sites provide free data for few days but for more data or for archive data one needs to sign-in and buy eventually.

Of all the data servers openweathermap.org is one of the most user friendly and easy to put into ESP32. They provide data in json. The Arduino has a json library which is pretty good enough to decode data from json.

Process

Step 1: Go to openweathermap.org
Step 2: Do a sign-in and find your city code from the site.
Step 3: The site will provide an API key.
Step 4: Use this API key in the Arduino code to get json streaming data.

The simple HTTP string is supplied by the ESP32 which is received through GET protocol. The data is then processed through json, segregated and reprinted on a TFT ILI9341 screen link.

Design

We have used a cheap DS3231 real-time clock to keep track of time. The DS3231 is better than most other RTC as it has an inbuilt precision temperature correction to take care of the quartz frequency correction over a very long time drift. For display, we have used TFT ILI9341 2.5”X2.0” display. The site provides free data for 5 days at a time. So much data cannot be placed on one screen, therefore, we have placed the data in two screenshots with a time division of approximately one minute each.

Schematic

Schematic is very simple and straightforward. For construction, use a small double sided Vero board.

Software

The json library & sketch is attached

Prototype

City code

City codes are like the ones given below. You can also enter the exact GPS position of your city. The full city guide is also country_code for your ready references.

Singrauli, IN
Victoria,US
Bolocovo,RU
Almaty,KZ
Darlinghurst,AU

Aftermath

While the ESP32 based display is perfectly alright to use in place of the laptop, the laptop is not removed from the site. The maximum and minimum temperature is not very precise at times but the mean temperature, wind and cloud condition is perfectly right and helps to take maintenance of these sprinkler systems.

Download Source Folder

Read More Detail :Weather Forecasting on ESP32


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top