Smart clock that displays day, time, and weather statistics using ESP32 and a TFT display.
Demo video: https://youtu.be/dtuwAKIeJhk
Before uploading the code to your ESP32, you must provide your network credentials and OpenWeatherMap API configuration. All secrets are stored in a single header file: Secrets.h.
You can copy the provided example template:
cp Secrets.h.example Secrets.h
lat/lon: The latitude and longitude coordinates for your weather location.appid: Your OpenWeatherMap API key (sign up at openweathermap.org).units=metric: Mandatory. The parser inAPI.hreads temperatures in Celsius (temp), wind speed in km/h, and precipitation in mm.exclude=minutely,alerts: Recommended to reduce response payload size (the ESP32 allocates a 30KB JSON buffer inAPI.h).
The internal Real-Time Clock synchronizes via NTP in RTC.h. The default timezone is set to Pacific Time:
configTzTime("PST8PDT,M3.2.0,M11.1.0", "pool.ntp.org");If you are in a different timezone, update the POSIX timezone string in RTC.h to match your local timezone.
- Microcontroller: ESP32
- Display: SPI TFT display
- Push Button: Connected to GPIO
14 - Required Libraries:
TFT_eSPIArduinoJson(v6)WiFi(ESP32 built-in)HTTPClient(ESP32 built-in)