I constructed an electronic clock. I know that one could make one much simpler with a microcontroller, but I wanted to make one that starts from the crystal. I have attached the block scheme that tries to explain the full operation logic.
I personally prefer an instruction that shows the principle and the logic arrangement. The final details can be easily found in the datasheets. Therefore, I will not go very deeply into every step and explain simply what I did.
All the components, except the 32kHz oscillator, are through hole components making the soldering and assembly very simple. The power is coming from a micro-USB plug, the same that is used with your phone. I think this is the ideal power source, as I have so many micro-USB cable around me.
Like with the first electronic clocks the time accuracy is achieved with the 32kHz crystal. The oscillator operates with 3.3V, thus the LDO for that. The power consumption of this small oscillator is very small, no need for a buck converter.
The 32kHz signal is divided five times with 8, so that 1Hz signal is achieved. Now, this 1Hz signal is used to show the seconds. SN74HC163 is a suitable counter for that. Its output is in binary, thus a 7-segment decoder SN7447 is required that controls the LEDs. SN7447 is an open collector device, meaning it switches to the ground. The other side of the LEDs should be connected to the power bus. To reduce the amount of current going through the LEDs series resistors are used.
When the counter reaches to 9 it is registered with a NAND element and sent to the reset pin nr. 9. The same signal is the input to the next stage that shows the 10th of the second. Here, when the counter reaches to 5 the reset signal is sent.
Exactly the same procedure continues with the minutes and with the hours. With the hour part additional reset signals are generated when the time is reaching 12h (12h clock) or 23h (24h clock). Depending which clock system is preferred the hour part resets itself after 12:59:59 or 23:59:59.
I switch all the LEDs on and off with 512Hz. The switching is done so that only half the LEDs are on at the same time. That allows some energy saving. Additionally, in order to turn off all the LEDs I added a mechanical switch.
As one can see the logic is the same for the seconds, minutes and hours. Consequently, one could make modules and reduce the PCB size. I divided my PCB into 6 different panels: 3 for logic and control and 3 for the LEDs.
Each panel has exactly the same design, but the assembly is done slightly differently. For the hour panel different control is required than for the minute and the second panel. For providing all the different control elements I added a small 8 position switch, which I can modify on each panel separately. The LED panels are all exactly the same, only difference is that I connected the micro-USB plug only on the middle LED panel. One power source is enough.
Connections between the panels are made with the through hole component pins. In order to adjust the time, I have made two options that one has to decide. Each control panel has two push buttons to adjust the time. One option is to use 2Hz pulses so that the counter counts faster, for adjusting time the user has to hold the button down until correct time is reached. The second option is to made so that the user hast to click for each counter pulse. I noticed that the 2Hz signal had some noise in the hour panel and the time adjustment wasn’t very easy. It jumped time to time and I had to repeat the procedure. Thus, one should start adjusting the time from the second panel.
On the panel I have several pull down resistors. Next to them are several capacitors for the voltage stability.
Hopefully this can inspire somebody to try it too. If you would like to see more pictures from this project or from others, check out one of these pages: