Digital Auto Correcting Clock With Chimes and Daylight Savings Time

1,255

12

3

Introduction: Digital Auto Correcting Clock With Chimes and Daylight Savings Time

About: Our grandkids keep me busy!

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!

Be the First to Share

    Recommendations

    • Pets Challenge

      Pets Challenge
    • Backyard Contest

      Backyard Contest
    • DIY Summer Camp Contest

      DIY Summer Camp Contest

    3 Comments

    0
    AlexanderS290
    AlexanderS290

    7 months ago

    the keyword or rather keyphrase seems to be "wifi internet adjusted clock".
    it wont adjust anymore when out there in the woods. i can not guess how precise it will then be.

    0
    efoster6
    efoster6

    Question 2 years ago

    Great idea. Where did you get the battery

    0
    gzumwalt
    gzumwalt

    Answer 2 years ago

    Thank you very much, I'm glad you enjoyed it.

    The battery is an old Adafruit 3.7li I had laying around. The Feather ESP32 will charge it, but for longer battery backup, I suggest using an external phone backup battery.

    Thanks again!

    Greg