Electronics | Binary Clock

This clock shows the current time in binary. To that end, it gives separate indications for the current second, minute, and hour. These are each second updated and shown as a sum of powers of two. Because there are in total 6 + 6 + 5 = 17 LEDs to be controlled, we use a 74HC595 parallel shift register to have extra controls. The code running on the Arduino gets the current time from a connected DS1307 real-time clock (RTC). There is also a pushbutton connected to the system, allowing for switching between whether or not to show the running seconds. Pushing the button for a longer period of time allows to toggle all the LEDs on the display on or off. Pressing it longer switches the clock between showing the time or giving a small lightshow. Pushing the button even longer, puts the Arduino into sleep mode.

The code running on the Arduino continuously checks the button's status. Depending on this, it will take different actions. One of them is the updating of the LEDs to reflect the time obtained from the DS1307 RTC. In case the lightshow is active, the code shows various effects in succession. Because of the limited amount of SRAM memory on the Arduino, each effect is loaded into memory as a sequence of steps, and deleted when the effect has played. During each cycle of the loop() function, the code keeps track of the current effect and the current step within the effect. When an effect has been played fully, the code automatically moves to the next one.

Arduino sketch

LinkedList library

ButtonDebouncer library

RTCDS130x library

Demonstration of clock (mp4, 16.88 MiB)

Demonstration of lightshow (mp4, 20.58 MiB)


Electrical diagram:


Assembled and soldered protoshield/circuit board: