Code

Important note: when running this code, you should probably use an external power supply (say 9VDC into the Arduino). When I ran the code on USB power, the NeoPixels drew too much current and this caused the RTC to provide strange numbers to the Arduino.

Download the code and uncompress in your Arduino sketch folder.

This Arduino sketch relies on a few Arduino libraries:

Follow the DS1307 RTC breakout tutorial to learn how to install the RTC library and set the time on the DS1307 RTC.

You will also need to install the NeoPixel library.

The DST_RTC library is used to keep the time accurate for Daylight Saving Time. 

See the following tutorial to learn how to install Arduino libraries.

You can edit the #define DAYBRIGHTNESS value to change the maximum brightness. This value can be from 0-255 although with 0 you won't be able to see anything.

The clock will be dimmer at nighttime. You can adjust the settings to define between which hours the clock should operate at a dimmer setting.

This guide was first published on Jul 01, 2014. It was last updated on Jul 01, 2014. This page (Code) was last updated on Sep 20, 2019.