Ialready had an Arduino Uno microcontroller, an IR detector/sensor, and an IR remote control available, so the only part I was lacking was a real time clock (RTC). I decided to use a battery backed-up RTC to make the clock accurate, reliable, and impervious to power failures. I chose the ChronoDot ultra precise
RTC module spec'ed at less than a minute of drift per year.
Designing the LED clock circuitry was easy because of the small number of parts involved. To simplify
the design, I decided to power the clock via USB so no power supply components (internal to the clock)
would be required. With all of the parts in hand, I breadboarded the circuitry and wrote the software
for this unique LED clock using the Arduino 1.0.5 IDE (Integrated Development Environment) on my
As mentioned, the hardware for this
unique LED clock is quite simple and is
shown in Figure 1. The clock is powered
by an external USB power supply
connected via a USB cable plugged into
the Arduino Uno’s USB connector. All of
the clock’s components run on the five
volts provided by the Arduino Uno board.
The IR detector/sensor’s output is
connected to pin 6 of the Arduino which
is configured as a digital input in software.
The two Arduino digital outputs on pins 4
and 5 drive the RGB LED strip via some
bit-banging performed in the software.
Finally, the ChronoDot RTC assembly
is connected to the Arduino’s I2C/TWI
interface via pins A4 (SDA) and A5 (SCL).
NOTE: If you use a different Arduino
model for this clock, the pins for the
I2C/TWI interface will almost certainly be
different and must be taken into
All of the components are wired
directly to the Uno board via inline
connectors; no shield is involved, though
you could use a prototyping shield if you
like. Once you have the hardware wired
up, insert the RTC battery into the socket.
According to the specification, this battery should keep
the RTC running for at least seven years.
That’s about it for the hardware. As you may now
realize, most of the clock’s functionality is provided by
The Clock Software
The software consists of two files: datatypes.h and
AUniqueLEDClock.ino. Both are available at the article
link. These files must be moved into a directory called
AUniqueLEDClock you create in the Arduino
development area on your computer.
Two Arduino libraries are needed by the clock. The
wire library for I2C/TWI communication and the
IRremote library for remote control operation. The wire
library is part of the standard Arduino IDE and doesn’t
34 March 2014
; FIGURE 1.