How Digital Clocks Work

Building Your Own Digital Clock

The best way to understand the different components of a digital clock and how they work together is to actually walk through the steps of building your own clock. Here we will build just the "seconds" part of the clock, but you can easily extend things to build a complete clock with hours, minutes and seconds. To understand these steps, you will need to have read How Boolean Logic Works and How Electronic Gates Work. In particular, the electronic gates article introduces you to TTL chips, breadboards and power supplies. If you have already played around with gates as described in that article, then the description here will make a lot more sense.

The first thing we need is a power supply. We built one in the electronic gates article. That time, we used a standard wall transformer that produced DC (direct current) power and then regulated it to 5 volts using a 7805. For our clock, we want to do things slightly differently because we are going to extract our 60-Hz timebase from the power line. That means that we want an AC rather than a DC transformer, and we will use a part called a bridge rectifier to convert the AC to DC. Therefore, we need the following parts for our power supply:


  • 12-volt AC transformer (Jameco part #115602)
  • Bridge rectifier (Jameco part #103018)
  • 7805 5-volt regulator (TO-220 case) (Jameco part #51262)
  • Two 470-microfarad electrolytic capacitors (Jameco part #93817)
  • 5.1-volt zener diode (Jameco part #36097)
  • 1-K-ohm resistor (Jameco part #29663)            

A few notes on the parts used:

  • The difference between the AC transformer we are using here and the DC transformer we used in the article on gates is that the AC transformer preserves the 60-Hz sine wave found in 120-volt household current. If you want to use your volt-ohm meter to measure the voltage of an AC transformer, be sure you use an AC voltage range rather than a DC range.
  • We use the bridge rectifier to convert the AC to DC. One of the terminals on the rectifier will be marked with a "+" -- from that you can find the minus and AC inputs. There is no polarity to an AC transformer, so it does not matter which transformer lead you connect to which AC lead of the rectifier.
  • The 7805 and capacitors are wired just like they were in the electronic gates article.
  • The resistor and the zener diode extract a 60-Hz signal from the transformer's sine wave. A diode is a one-way valve for electrons. A zener diode is also a one-way valve, but it also passes electrons in the other direction if they are above a certain voltage. The zener diode therefore turns a 10-volt sine wave into a clipped wave oscillating between 0 and 5 volts. This is perfect for clocking the TTL counters. The 1-K-ohm resistor makes sure that the current to the zener diode is limited so we do not burn out the diode. The diode will have a band painted on one end -- this band should be the end connected to the resistor.