Introduction: The Logical (song) Clock

About: Interested in retro clocks and time itself. What we call 'time' is really not time. Its the measurement of the period between 2 events. Most of my working life was spent as an Electronics engineer at a UK broa…

If you've seen my profile, you'll know I have a passion for clocks and have shared a couple of my designs.


This one is a circular clock designed to mimic an analogue one using LEDs.


No microprocessor involved.

Back in 1972, during my final year of school, TTL technology was the latest innovation. That’s when I built my first clock using TTL and nixie tubes. This project uses variants of the original TTL family, with a circular layout representing seconds, minutes, and hours, just like an analogue clock.


Ease of Build.

By "ease of build," I mean no SMD components, though there's a small exception noted later. While SMD devices aren't impossible to work with, I prefer the old-school approach. This design features over 240 components and more than 820 soldering points.


No exotic or expensive parts.

All parts are readily available from standard amateur sources.


The title is inspired by a 1979 Supertramp song, though this clock has no audio. I also considered naming it the Analogical Clock.


Presentation.

The components and circuit board are intentionally visible, showcasing working electronics.


I'll walk you through my thought process to give you insight into how I approach a project. You won't need any specialized tools—just a decent soldering iron with a fine tip, 0.7mm solder (I still use 60/40 lead solder), long-nose pliers, side cutters, and a plastic-handled "tweaker" screwdriver to adjust the trimmer capacitor. An oscilloscope is helpful but not essential, though a multimeter or voltmeter is necessary.


This project is still a work in progress. The clock is complete and functional but could use improvements, and so could this article. I’m publishing it as is and welcome any feedback or suggestions for improvement.

Supplies

74HC00 2 input NAND x 1

74HC04 hex inverter x 3 *

74HC153 data selector x 1

74HC164 8bit bit shift register x18

CD4013D D flipflop x 1

CD4060 Ripple counter x 1

ICL7673 Battery backup switch x 1

IRF9024 MOSFET x 2

1N914 diode x 3

5mm LED x 120

5mm bi colour LED x 12

Buck/boost module x 1 (see picture)

LiPo charger module x 1 (see picture)

Cap ceramic 12.5pF x 1

Cap ceramic 22pf x 1

Cap ceramic 100nF see text

Cap variable 10pF see text

Electrolytic capacitor see text

Electrolytic capacitor 470uF x 1

Resistor 10M x 1

Resistor 150K x 1

Resistor 10K x 2

Resistor 47K x 8

Resistor 100K x 1

Resistor 220K x1

Resistor 330K x 1

Resistor 470R x14

Resistor 580R x 12

Switch tactile x 2

Switch slide x 2

Crystal 32.768kHz x 1

DIP socket 8 pin x 1

DIP socket 14 pin x 23

DIP socket 16 pin x 2

LiPo battery 3.7v x 1

PCB x 1

  1. This may be replaced with 74HC14 a Schmitt trigger input inverter

The components 'see text'. I am not 100% happy with the timing and power on reset so these are still being refined. I will update when I am happy


Shock horror for some. Nearly all the components were sourced from AliExress. I have not received any freebies or discount from AliExpress. I only mention them as a source of components I often use. Some components were sourced from CPC Farnell 'Other suppliers are available'. I would suggest that the 32.768Khz crystal and the load capacitors be quality components.

Step 1: Disclaimer

This project, including the design, Gerber files, and finished board, is provided "As Is." The clock functions as described, but I cannot take responsibility for others' builds or any potential errors in this published project. All information is shared in good faith. I will do my best to assist anyone who builds it and encounters an issue. Updates are posted whenever significant changes or additions are made; refer to the "Updates" section for details.

Step 2: Circuit Principles

A simple power input that works independently of mains frequency.

The clock circuit concept isn’t entirely my own; I drew inspiration from an article called '72 LED clock.' I did, however, expand on it to include seconds. Elektor magazine has also been a helpful resource. My formal education, 27 years as an electronics engineer in a broadcast TV station, and 71 years of life experience played a significant role as well.

The time base is standard.

Time setting is managed through fast forward/stop, keeping it straightforward.

It uses logic chips, either 74HCxxx or CDxxx, one slightly unfamiliar IC, a couple of MOSFETs, numerous LEDs, a good mix of capacitors, resistors, and a couple of modules to avoid reinventing the wheel.

.

Step 3: Project Blocks

Lets break the project down into blocks and look at how it works.

The power supply

Timebase

Clock Logic

Power on reset

Adjust

Step 4: The PSU

The idea was to use a standard mobile phone charger since these are easy to find, even tucked away in a drawer, along with a micro or USB-C cable. The power supply also needed to be battery-backed so that the clock would continue to keep time during a brownout or short power disruption. I decided to use a lithium-ion battery, specifically one from a game controller that I already had. This battery is rated at 3.65V with a capacity of 3000mAh and, when tested on the clock, lasted over 13 hours. It was perfect because it’s slim and could be attached to the back of the board with self-adhesive hook-and-loop tape. However, any 3.7V battery would work. I found a nice module with a micro or USB-C input socket that charges a single cell and provides a separate load output. Everything seemed great except for two issues: the li-ion cell's maximum voltage is only 4.2V, but 5V is needed to power the logic, and you can’t charge the battery and use the load simultaneously.

There’s plenty of information online about dealing with the charge/load problem, so I won’t delve into that. Instead of the common method, I used a source selector IC, the ICL7673.

The battery backup IC itself can only deliver about 30mA at its outputs, but a couple of p-channel MOSFETs manage the power requirements. The status outputs, which go low depending on which of the two inputs has the higher voltage, are used to select one of the two MOSFETs. The MOSFETs are fed either the incoming 5V USB or the battery. The selector IC8 is supplied by the USB or battery and switches the appropriate MOSFET on. The drains of the MOSFETs are connected together and feed the boost module, which regulates the voltage to 5V to power the rest of the circuit. When ordering the boost module, I mistakenly received a buck/boost version, which required me to design the PCB accordingly. However, there’s also space for the module I originally intended to use.

Two switches are included to allow complete power removal from the circuit and to disconnect the battery. I mentioned avoiding SMD components, but the ICL7673 is becoming harder to find in through-hole format. However, it is available as an 8-pin SOIC, and using the SMD version with a breakout board could be an option.

Step 5: Timebase

Since this is a clock, it requires a time base, and there were several options to consider while adhering to the original concept of avoiding microprocessors or programming.

One option is the mains frequency. While it may vary slightly at any given moment, it is accurate enough over time. However, there are two primary frequencies globally, 60Hz and 50Hz, which means the circuitry must handle both. Additionally, in the event of a power outage, the clock would stop but not completely lose the time. Once power is restored, however, the clock would run slow.

Another option is the classic 555 timer, though it lacks precision.

A crystal and divider circuit stood out as a practical choice. It’s a well-established solution using standard components. Additionally, it offers the benefit of providing various frequencies for other parts of the clock, such as setting the time.

The circuit features a standard CD4060 with a 32.768KHz crystal, load capacitors, and associated components. This oscillator design has been widely documented. The chip outputs three frequencies: 2Hz, 4Hz, and 64Hz. When designing the PCB, the footprint of the trimmer capacitor was made to accommodate both 2-pin and 3-pin trimmers. This layout is not ideal, as using a 3-pin trimmer requires either trimming one of the stator pins or bending it out of the way.

The 2Hz output is fed into a CD4013 to divide it further to 1Hz, which is then sent to the data selector (74HC153). The data selector also receives 4Hz and 64Hz inputs.

Step 6: Clock Logic

The clock operates by using a '1' placed in a 60-bit shift register, composed of 8 x 74HC164 ICs. This '1' shifts at a rate of 1Hz until it reaches 60, then it returns to the start. This action increments another 60-bit shift register, also loaded with a '1'. This second register shifts 60 times before resetting and incrementing a third shift register, which is 12 bits long. The third register repeats the process, completing the cycle. The first register counts 60 seconds and triggers the next register (minutes), which in turn triggers the next register (hours) after completion. This forms a 12-hour clock.

The shift registers' outputs control LEDs arranged to form the clock. Each bank of registers has its cathodes connected together, as only one LED is lit at a time, except for the hours register. The hours register outputs are connected to an inverter (74HC04) and a LED. Each LED has its own load resistor, with one color of the bi-color LED connected directly and the other color connected through the inverted output. This setup lights all the hour LEDs, except the one showing the current hour, which changes color.

Step 7: Power on Reset

As already described, a 1 is loaded into the 2 long shift registers and the shorter hours register, this has to be arranged. Also the shift registers have to be reset on power on to ensure that only this 1 is present.


When power is applied, a single "1" bit is loaded into the first stage of the seconds, minutes and hours registers. To accomplish this, a momentary low reset signal is sent to all the registers (at pin 9) and also a NAND gate to lock out any clock transitions at pin 8 of the minutes registers. At the same time, a high level is applied to the data input lines of both minutes and hours registers at pin 1. A single positive going clock pulse (at pin 8) is generated at the end of the reset signal which loads a high level into the first stage of the minutes register. The rising edge of first stage output at pin 3 advances the hours (at pin 8) and a single bit is also loaded into the hours register.

All the timing of this is accomplished with a RC timing circuit presented at the input of an inverter. This changing analogue decaying voltage is used to provide the appropriate 0 or 1

This idea is still being developed as its a bit 'iffy'. Note. If you turn the clock completely off it is important to leave it long enough for the timing capacitors to completely discharge before trying to start the clock again.

Step 8: Reset and Adjust

We’ve already explored how the clock shifts a '1' at 1 Hz. However, the shift registers are fed by a 74HC153 data selector IC. This IC has four inputs: no input, a 1 Hz pulse, a 4 Hz pulse, and a 64 Hz pulse. The output is determined by the settings of the two select inputs. By default, 0 0 gives 1 Hz, 0 1 stops the clock, 1 0 provides 4 Hz, and 1 1 gives 64 Hz.


By pressing the appropriate button, you can stop the clock or run it at different speeds. The push buttons are not debounced, which can occasionally cause the LEDs to jump unexpectedly. However, considering the added components and limited space, I decided this was acceptable since it doesn’t happen often.

Step 9: Proof of Concept

Once I decided what I wanted to do, the next step was testing if it would work.

A scaled-down version of the clock was built on a breadboard to check the power supply and battery backup. The logic and the method for adjusting the time were also tested.

Since building the entire clock this way would be extremely complex, only two stages were partially constructed. Everything worked, but I discovered that breadboards are not ideal for logic circuits. Even a slight knock could briefly disconnect a wire and cause the whole system to fail. To avoid disturbances, I placed the 'partial clock' in the greenhouse for testing.

With successful results, I moved on to designing the complete clock using the schematic feature of the PCB layout software.

Step 10: Printed Circuit Board (PCB)

After proving the concept on a breadboard, the next step is creating the printed circuit board.


I use DesignSpark PCB, which is free, unlimited, regularly updated, and supported by a helpful community forum. It can produce industry-standard Gerber files. All the schematic and board layout images are screenshots from the software. I prefer a black background when designing. I also figured out how to convert my schematics into a PDF and now include the entire clock schematic.

Once the schematic was drawn, I had to create a couple of components and modules from scratch since they weren’t available in the library. With just a few more clicks, the PCB layout was generated. Initially, it was quite basic, but it started to take shape over time. I arranged the components in a circular layout to resemble a clock and placed them aesthetically. Then, I used the auto-route feature. While the auto-routing wasn’t perfect and left some air wires unrouted, I manually resolved those issues. The software occasionally made odd routing choices, which I also corrected manually. To ensure the design was visually appealing, I adjusted some of the routes for a better look. Since I’m not an expert at PCB design, the process took quite a while, and I’m sure someone with more experience could achieve a better result. Once I was satisfied, I produced the Gerber files, zipped them up, and prepared them for the fabricators. I must admit, the entire process was time-consuming.

I wish I could use a local company to produce the boards, but the cost is far too prohibitive, so I opted for a Chinese company, JLCPCB. I've used them multiple times and have always been satisfied with their fast service, low cost, and quality that matches my production needs. I chose the standard green with white silk screen, though there are various options to suit personal preferences. The board measures 24cm x 24cm.

I have not received any payment or discounts from RS, the suppliers of DesignSpark PCB, or JLCPCB. Of course, if you want to make this clock, you can use your own preferred software and fabricator.

I am offering unpopulated boards for sale. This is not a commercial venture; they are sold only to cover costs. Boards will only be shipped within the UK, as I wish to avoid dealing with taxes and export forms. Please message for further details.

For anyone who wants to produce the board themselves, here is the link to the Gerber zip file: https://drive.google.com/file/d/1FWhqImsUOcwBp_iLnjlGyRjekbH30bqn/view?usp=drive_link

These files are for version v2.3, although the illustrations shown are version v2.2. The updates include footprint adjustments, resulting in some track path changes and silk screen modifications.

Please make sure to read the disclaimer first.

Step 11: Arrival - Yet Another Nod, This Time to a TV Series the Prisoner

Getting a package is always exciting, especially when it’s PCBs that you’ve designed. There’s something fascinating about knowing a massive factory thousands of miles away has created something for you. As a coincidence, the package from AliExpress arrived the same day!

The first task was checking if everything fit. I had to define the PCB footprint for some items like switches and modules. The first mistake: the holes in the pads for the switches were too small, so a bit of filing will be required. Additionally, the spacing for the holes of the bi-color LEDs needs adjustment. All changes have been updated in the PCB design in case more boards are ordered.

Step 12: The Build

I assembled the PCB components in stages rather than all at once, as some parts of the circuit depend on others to function correctly once completed. First, I worked on the power supply. I placed the LiPo charger module on the back to avoid a trailing cable on the front, though in hindsight, positioning it in a front corner would have been better. It was spaced off the board to accommodate the cable thickness. The battery was not connected at this stage, but the rest of the circuitry was. Once powered on, I set the buck/boost module's output voltage to 5V.

Next, I built and tested the oscillator. An oscilloscope is helpful here, but even a voltmeter on pin 3 flickers to indicate it's working. I then verified the CD4013 divider at pin 1.

Afterward, I added the power-on reset ICs, components, the first shift register, and eight LEDs. If all functioned as expected, I continued by adding each shift register and eight LEDs, checking them one at a time until everything was installed and operational.

Finally, I attached the battery to the back of the PCB using self-adhesive hook-and-loop tape.

For further details, refer to the section titled 'Adjustments and Alterations.'

Step 13: Adjustments and Alterations

This is about issues encountered 'along the way.'

Every time the hour LED shifted after 12 hours, it double-triggered, causing two LEDs to light up. After another 12 hours, three LEDs lit up, and so on. This was fixed by adding a 100nF ceramic capacitor from pin 1 to pin 7 of the 74HC164. The schematic hasn't been updated to reflect this change, as it would create a mismatch with the PCB. I decided not to alter the PCB since it would require significant rerouting, and I've already invested a lot of time in this project.

The power-on reset was unreliable and needs further consideration.

The clock was running fast, which caused a lot of confusion since the circuit seemed fairly standard. Lowering the two resistors made no difference, nor did changing the crystal. This issue has now been resolved. See 'Updates.'

Step 14: And Finally.........

The completed board was powered up and the time adjusted and left to see if it was stable.

I will endeavour to make a better video. This is a bit shaky and burnt out, but gives you the idea. Here is the ink.

https://drive.google.com/file/d/1dnjSUT0zLgiS7w7Ca5KRfJHjGj2-4EYR/view?usp=sharing

Step 15: The End... Almost

You can now see how my mind works. I have something I want to do. Define the objectives. Plan, test. Produce. De-bug and finish.. The end result may be quite complex but if broken down into sections it becomes manageable,

Step 16: Case

The build cost wasn’t too bad component-wise, although the PCB was fairly expensive, and shipping from China significantly added to the total. I put in many hours on design, building, and testing, so the final result felt worth the effort. Skimping on a case would have wasted all that investment.


I visited a local picture framer and chose a frame. Picking the moulding and glass took some time, with three glass options: plain, anti-reflection, and ultra-clear anti-reflection. The plain glass was decent, showing the LEDs and components clearly. The diffused option didn’t work, as it obscured the components and diffused the LEDs. The ultra-clear anti-reflective glass was ideal—it looked like there wasn’t any glass at all. However, it cost eight times more than the plain glass, bringing the total to just under £90. In the end, I went with the ultra-clear glass.


Power is supplied via a USB cable, so a hole will be cut in the case for the cable. A short extension cable will be added inside the clock, leaving only the end exposed, allowing flexibility in the USB cable length needed for the power supply. (Due to budget constraints, this step hasn’t been completed yet.)

Step 17: Updates

12th October 2025

The issue with the clock running fast was quite puzzling. It’s a standard circuit, and I even cleaned the flux from the components forming the oscillator. I ordered a new crystal and capacitors from a reliable source, but nothing worked. Eventually, I decided to drastically alter the oscillator by doubling one of the load capacitors. Surprisingly, the clock now runs perfectly. I can’t explain this at the moment. The component values have been updated in the schematic. Depending on the crystal you use, you might need to adjust the load capacitors.


14th October 2025

Due to financial constraints a temporary frame purchased


15th October 2025

Some spelling errors in the article have been corrected.


17th October 2025

pdf of schematic added to step 10. Length of time the battery would run clock added to step 4.


19th October 2025

Disclaimer step 1 added. Boards for sale mentioned step 10. The footprint of component Vcap1 has been changed to accommodate both 2 pin and 3 pin trimmer capacitors. This was documented in step 5. Gerber files produced


20th October 2025

An error was found in the description of the time base, step 5, which was also carried over to step 8


22nd October 2025

Gerber files made available with a link. Video made available with link. Clarification attempted to describe the power on reset principle step 8. Considerable re-write completed. Photographs of switches added