Digital Auto Correcting Clock With Chimes and Daylight Savings Time

About: You fail only when you decide to quit learning.

A digital version of my "3D Printed Mantel Style Clock" designed for those who may be interested in making an auto correcting clock with chimes and daylight savings time, but without 3D printing.

The clock requires the following parts:

I followed the assembly and library installation instructions for the ESP32, Feather Music Maker and OLED display at the Adafruit links shown above.

I then connected the assembled ESP32 via USB to my computer, opened the file "DigitalClock.ino" in the Arduino environment, and performed the following code changes:

  • Changed the source code variable "chSSID" to my wifi router SSID.
  • Changed the source code variable "chPassword" to my wifi router password.
  • Set the source code constant "TIME_ZONE" to my time zone (Oklahoma is -6).
  • To disable daylight savings time, I set both source code variables nDstStartMonth and nDstEndMonth to zero.
  • To enable daylight savings time, I set the source code variables as follows:
    • nDstStartMonth to the starting month (1 - 12, Oklahoma is 3 or "March") when daylight savings time begins
    • nDstEndMonth to the ending month (1-12, Oklahoma is 11 or "November") when daylight savings time ends.
    • nDstStartDay to the starting day of the starting month (0 for second Sunday, 1 through 28-31 for specific day of the month, Oklahoma is 0) when daylight savings time begins,
    • nDstEndDay to the ending day of the ending month (0 for first Sunday, 1 through 28-31 for specific day of the month, Oklahoma is 0) when daylight savings time ends.
    • nDstStartHour to the hour on the starting day of the starting month when daylight savings time begins (0 through 23, Oklahoma is 2 or 02:00AM).
    • nDstEndHour to the hour on the ending day of the ending month when daylight savings time ends (0 through 23, Oklahoma is 2 or 02:00:00AM).

With all settings completed, I downloaded "DigitalClock.ino" to the ESP32, then disconnected the ESP32 from the USB cable.

Next I plugged the components together as shown in the video, and applied power to the ESP32. After connecting to my WIFI network and obtaining time from an NTP time server, the clock displayed the correct time and date.

And that's how I assembled, programmed and tested Digital Clock With Chimes and Daylight Savings Time.

Hope you enjoy it!

Share

    Recommendations

    • Big and Small Contest

      Big and Small Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • PCB Contest

      PCB Contest

    Discussions