Hello Hive community! In my last video i promised share my weather station project with ESP32 microcontroller, so here it is! My simple ESP32 Internet Weather Station!
I will show you how to make this project using TTGO T-Display ESP32 microcontroller but this project will also work on any ESP32 board and any TFT display is supported by TFT_eSPI library. But first, let's see what we have here...
This is a simple Internet Weather Station, which can show current time date and, of course, seconds, town name, temperature in that town and humidity in that same town. All data are gathered from internet because i'm not using any sensor or real-time clock module.
You can also see my IP address and the level of brightness of the screen. I can change the brightness level with the right button and with the left button i can invert colors if i want. For example, white background and black text. It also have an little animation that adds motion to this project it looks better with it.
If you don't own this board, i highly recommend you buy it, because this is my favorite ESP32 board, because this built-in TFT display and it costs around $20 so you can buy it. It is not expensive and this is great board.
Now let's talk about the code... You can find code in my Github ESP32-Internet-Weather-Station, feel free to download it.
You will also need to install some libraries here. The libraries that are needed for this project are:
- TFTeSPI - https://github.com/Bodmer/TFT_eSPI/releases
- ArduinoJson - https://github.com/bblanchon/ArduinoJson.git
- NTPClient - https://github.com/taranais/NTPClient
Then you will need to make some changes to code:
- Line 26: Edit SSID
- Line 27: Edit Password
- Line 28: Edit Town
- Line 29: Edit Country
- Line 31: Edit API KEY
I'm using OpenWeather Map API and all weather data comes from that API. So first we will visit https://openweathermap.org/ website and create an account. API key is free don't worry! You need to fill registration form and you will get a verification email after a few seconds. Just verify your email address and you will receive other email with your API key. Now you can copy that API key and paste it in the code.
Now you will also need make some adjustments... First find the line #119 and edit it to adjust your timezone.
- GMT +1 = 3600
- GMT +8 = 28800
- GMT -1 = -3600
- GMT 0 = 0
Now you are ready to compile and upload code to your ESP32 TTGO board.
If you need help to add ESP32 board to your Arduino IDE please check my previous post The Resistor Calculator with ESP32
I hope you like this project! If you need help feel free to comment!
Thank you for watching and i will see you in the next video!