ESP32 Time and Temperature Display
by khinds10 in Circuits > Arduino
143 Views, 0 Favorites, 0 Comments
ESP32 Time and Temperature Display

ESP32 Time and Temperature Display
This project uses an ESP32 microcontroller to display the current time and temperatures on three TM1637 displays. The first display shows the current time in 12-hour format with a blinking colon and PM indicator. The second display shows the indoor temperature from a DHT22 sensor. The third display shows the outdoor temperature fetched from an online weather API.
Using openweather API - https://openweathermap.org/api/one-call-3
Supplies
Components Required
- 1 x ESP32 Development Board
- 3 x TM1637 4-Digit 7-Segment Displays
- 1 x DHT22 Temperature and Humidity Sensor
- Jumper wires
- 5mm Tinted Plexiglas
Connect Components - Flash the ESP32
Wiring Diagram
TM1637 Displays
- Display 1 (Time)
- CLK1: GPIO 22
- DIO1: GPIO 23
- Display 2 (Indoor Temperature)
- CLK2: GPIO 19
- DIO2: GPIO 21
- Display 3 (Outdoor Temperature)
- CLK3: GPIO 32
- DIO3: GPIO 25
DHT22 Sensor
- VCC: 3.3V or 5V
- GND: Ground
- Data: GPIO 18
Notes
- Ensure all components share a common ground with the ESP32.
Software Setup
Prerequisites
- PlatformIO installed on your development environment.
- An internet connection for the ESP32 to fetch weather data.
Check out the Git Repository
https://github.com/khinds10/ESP32-3-Display-Clock
This includes the STL files for 3D printing as well as the code to upload to the ESP32 to get it to run.
Configuration
- Copy Configuration File
- Copy src/config_shadow.h to src/config.h and update the configuration values:
Edit config.h
Update the following configuration values in src/config.h:
Time Settings
Display Brightness (0-7)
Temperature Calibration
WiFi Settings
Data Services Configuration
Create an account on openweathermap.org to get the right weather data for outside conditions.
The API call being used is: https://openweathermap.org/api/one-call-3
Note: Data API is optional
It's built from the following project:
https://github.com/khinds10/DeviceHub
Update Intervals
These settings control how often the device:
- Fetches new weather data (WEATHER_UPDATE_INTERVAL)
- Sends data to your API endpoint (API_UPDATE_INTERVAL)
- Automatically restarts to prevent memory issues (RESTART_THRESHOLD)
Pin Configuration
The default pin configuration is set up for common ESP32 boards. If you need to change the pin assignments, modify these values:
Building and Uploading
- Connect your ESP32 to your computer via USB.
- Open the project in your PlatformIO environment.
- Build and upload the firmware to the ESP32.
Build Process





Using the 3DPrint/ folder 3D print the STL files to create the case for the project.
Mount the Displays using hot glue to the front panel, also cut and hot glue the Plexiglas (the case allows for 5mm thick glass)
Carefully close the case using the inner-box going inside the larger outer frame. It should snap close with friction.
Finished


Finished