ESP32 CYD World Clock

by mdchaara in Circuits > Microcontrollers

148 Views, 1 Favorites, 0 Comments

ESP32 CYD World Clock

WhatsApp Image 2026-06-06 at 15.15.18.jpeg

I had an ESP32 CYD (Cheap Yellow Display) module at hand and an old powerbank with a damaged PCB, and I thought I would make a desk clock that displays time in different cities.


The module uses a touch screen, so navigation was designed to be by way of clicking on the sides of the screen to move to the next city east or west. The code will read weather data from openweatherMap.org API, and the screen background will change depending on the time of day.


To avoid LCD burn and to save the battery, I coded a screensaver and auto sleep/auto wakeup so that the time will be displayed for 2 minutes, screensaver for 3 minutes, and for the time to show at a 15 minutes interval.


I used Fusion 360 to design an enclosure for the clock, and a TP4065 to charge the battery and power the module.


The module connects to the WiFi, and there is a wifi settings menu that enables access to the module AP.

Supplies

  1. ESP32 CYD Module
  2. TP4056 Li-ion battery charging module
  3. Li-ion battery
  4. Some wires, solder, and a soldering iron.

Wiring the Module

WhatsApp Image 2026-06-06 at 14.44.14-2.jpeg

Start by wiring the VIN and GND to the module itself. In my case I chose to wire them to the 1.4P terminal on the module itself. Test with a 5V power source, but don't wire the battery and the TP4056 just yet.

Coding

Test the code on the device itself to make sure everything is in order. My code is available at https://github.com/mdchaara/CYD_WorldClock

Configurations are at the top of the WorldClock.ino file The README file contains the libraries, code logic, and basic troubleshooting.

When done uploading, use any device to connect to the module using the MDC-WorldClock-AP wifi network, and select the WiFi network you want the device to connect to.

Once the code is uploaded and tested, We can continue with wiring.

Wiring TP4056 Module

WhatsApp Image 2026-06-06 at 14.44.14.jpeg
WhatsApp Image 2026-06-06 at 14.44.14-3.jpeg

First, Wire the GND wire of the module to OUT- pad on the module (Black wire), and VIN wire to OUT+ pad on the module (Red wire).

Then Wire the battery -ve wire (Green wire) to the B- pad on the module, and battery +ve wire (Yellow wire) to the B+ pad on the module.


Once this is done, the module should power on.

Enclosure

Screenshot 2026-06-06 at 3.06.54 PM.png
Screenshot 2026-06-06 at 3.07.04 PM.png
Screenshot 2026-06-06 at 3.07.13 PM.png
WhatsApp Image 2026-06-06 at 14.44.13-3.jpeg
WhatsApp Image 2026-06-06 at 14.44.13-2.jpeg
WhatsApp Image 2026-06-06 at 14.44.13.jpeg

Print the enclosure you want for this clock.

The enclosure I used is specific to the size of the battery I have. I would highly suggest printing a barrier plate between the battery and module to avoid any uncalled for short circuits. I have also printed a holder to make sure the battery is snugly fixed and a space for the TP4056 to remain stationary for charging.

You're Done!

CYD World clock screen saver

Thank you for taking the time to view this instructable. Enjoy your desk clock!