My mind in a cloud of lily-white..

binary clock

Just for fun I made a binary clock. A lot of the binary clocks you can find on the net use 555-timers. Since I'm a software oriented man, I used a PIC microcontroller for my clock. This allows me to write code in C which can then be loaded into the microcontroller.

The clock displays the time in BCD format using six colums of 2 to 4 rows. It is possible to set the hour of the day, the minute of the hour. It is also possible to set the brightness of the display, or to disable the display of the time.

Basic Version

Because I didn't want to make it too difficult for myself, I first created a simple version driving 24 leds. The microcontroller I chose is able to source 25mA per IO-pin, which is exactly what we need for a led. We don't even need a current limiting resistor.


A movie and the full schematics/sourcecode are available for download. See the bottom of this page for details.

Extended Version

The extended version of the clock is able to drive a display which requires more current. To be able to do this the design of the basic version was adapted so that each column and row is controlled by a transistor.

The image below shows a development version I make it easier to debug. I'm aiming for about half the size of the development version.


As you can see there are some pinheaders on the board. To those I can connect some form of lighting. The basic version is connected to the development board so we can easily see if everything works ok without connecting other lights to the pinheaders.

Below you can see the finished version of the clock. The first picture shows the front, and the second picture the back. As you can see there are a lot of wires.

binclock-pic.jpg binclock-pic2.jpg

Timekeeping is done using Bresenham's Algorithm. The algorithm is described on its wikipedia entry. How it applies in this situation is explained at the webpage of Roman Black.

A movie and the full schematics/sourcecode are available for download. See the bottom of this page for details.

Used software

The following software was used. All this software is open source, unless noted otherwise.

  • Piklab Piklab is an integrated development environment for applications based on Microchip PIC and dsPIC microcontrollers similar to the MPLAB environment.
  • gEDA The gEDA project is developing a full GPL'd suite of Electronic Design Automation tools. These tools are used for electrical circuit design, schematic capture, simulation, prototyping, and production.
  • PICC lite compiler (not open source, but free).

Some of these software packages may have Windows versions available.


The sourcecode is distributed under the GPL 2 license, of which a copy is included in the piklab project tarball. It is also available here

The schematics are licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License. To view a copy of this license, visit this link. A copy is also included in the gEDA project tarball.


Creative Commons License