24 Hour Binary Clock

Some time ago while on holiday in Italy I came across several shops selling binary watches. I thought they looked really cool and decided that one day I would build a binary clock. Well that day eventually came and here it is. The current trend seems to be for BCD (Binary Coded Decimal) displays where each decimal number of the time is represented in binary, but I have kept to the traditional format where hours, minutes and seconds are each represented by one binary number. The difference between the two is illustrated below, with BCD on the left and traditional binary (as used in this clock) on the right

An animated example of a binary count from 0 to 16

Time is displayed in 24 hour format. This simplifies the design due to the fact that 24 hour clocks always reset to '0' on the 24th count (midnight). 12 hour clocks on the other hand (no pun intended) reset to '1' on the 13th count (1 o'clock) which would add more complexity to the circuit (counters naturally like to go to back to zero when reset). The display section of the clock consists of six 74HC series logic ICs. Counting is carried out by three 74HC393 binary counters. Each IC contains two 4-bit counters which can be combined to make a single 8-bit counter if required, but here we only need 6 bits for minutes/seconds and 5 bits for hours. Two 74HC08 quad AND gate ICs are used to reset the relevant counters when the desired binary number is reached, which in the case of minutes and seconds is '60' and for hours is '24' (60 and 24 are never displayed). The schematic is shown below (note that the IC power pins are decoupled by 100nF capacitors but these and the power connections are not shown for clarity. LED series resistors are 330R)

Click here for PDF schematic

A quartz controlled clock pulse generator (see later) is used to feed 1Hz pulses into the clock input of the top right counter (seconds) which counts to '59' and then resets to '0'. This is achieved because pins 8 & 9 (which represent binary '8' & '4') and pins 3 & 4 (which represent binary '16' & '32') are fed to a series of AND gates so that only when all four of those pins are activated (4 + 8 + 16 + 32 = 60) will the final gate output a HIGH to each reset pin of the counter. The top middle counter (minutes) also counts to '59' and so works exactly the same as the seconds. The top left counter (hours) works in a similar way but because it has to reset at '24' instead of '60', pins 8 & 3 (which represent binary '8' & '16') are fed to a single AND gate so that only when those two pins are activated (8 + 16 = 24) will the gate output a HIGH to each reset pin of the counter

So we've got each stage to count to the correct number but we also want the minutes to advance by '1' when the seconds reach '60' and the same for the hours when the minutes reach '60'. Whereas these counters require a transition from LOW to HIGH on their reset pins to reset everything to zero, the clock inputs require a transition from HIGH to LOW to advance the count, which can be used to our advantage. By connecting the most significant output ('32' in the case of minutes/seconds) to the clock input of the next counter, the right conditions will be met. On the count of 32 the clock input will be primed HIGH but nothing will happen yet as the AND gates are still waiting for their other inputs to go HIGH. When they do, the counter resets and all of its outputs (including 32) go LOW which will clock the next stage. When the time reaches 23:59 the next clock pulse will reset the whole clock to zero and for one second at midnight the display will be completely blank


The display board front and rear

An important part of any clock is setting the time. Here, just 2 push buttons are used to set the hours, minutes and seconds instead of 3. The hours are set first and as they are set, the minutes will be zeroed. The minutes are set next and as they are set the seconds will be zeroed. So just set the time to one minute before you want the clock to start, wait for the signal, and a final press of the minutes button will set the correct time and start the seconds from zero. This approach may seem slightly unconventional but it actually works quite well and adds a little bit of quirkiness

How the time setting function works: To set the hours, every time the set button is pressed, a HIGH state is produced on the clock input of the hours counter much like the HIGH from the '32' output of the previous stage when it becomes active. Again the input is primed but nothing happens. But when the button is released, a LOW state is produced on the clock pin and the count advances by one. The HIGH produced when the set button is pressed is also fed to the reset pins of the previous (minutes) stage to zero its outputs. This is done because the clock input may be LOW if the time showing is early (which is OK) or HIGH due to the '32' priming signal if the time is late (which is not OK). Resetting the outputs of the previous counter to LOW prevents any conflict between the clock pulse from the counter and the 'SET' pulse from the push button. A 74HC14 hex inverting Schmitt trigger IC is used to eliminate switch contact bounce which would otherwise produce unwanted clock set pulses


Rear view showing clock pulse PCB, power socket and SET buttons

The circuit requires a 5 volt power supply and so will run from any standard USB socket or charger. It can be constructed any way you want. I built mine on a 9 x 15 cm prototype board, connecting the components together with 0.25mm 30AWG wire wrap cable and then mounting this in a photo frameI did cheat a little on the timing circuit and opted to use a ready built quartz clock pulse generator PCB as it saved me some time, and this, along with the power socket and time set push buttons is housed in a small plastic project box fitted to the back. A sheet of smoked Black acetate was cut to size and used in place of the glass to add a bit of filtering and hide some of the electronics. It's fascinating to watch the 86,400 different dot patterns produced over a 24 hour period and all in all I think it's a fun bit of 'Geek Tech'

The finished clock