I started this project because I wanted to learn more about how microcontrollers work since understanding MCUs helps me with designing CPUs and other digital logic projects. The clock uses an STC15W204S microcontroller, a DS1302 real time clock module for keeping time, and a 4 digit seven segment display. I also used shift registers and multiplexing to control the display while using fewer pins on the microcontroller.
The clock runs using a state machine that cycles through different modes like time, alarm, and timer. Before it enters a mode, it actually displays the word for the mode first because I thought it looked cooler and made the interface feel nicer instead of just instantly changing numbers. The microcontroller constantly refreshes the display and loads segment data into the shift register fast enough so all 4 digits look like they are on at the same time.
One of the hardest parts was getting the buttons to work correctly because they would sometimes register multiple presses from one click. I had to learn how button debouncing works and write my own code for it. I also had to make my own header file because I could not find an stc15.h file for the microcontroller I was using. A lot of this project was debugging timing problems, display flickering, and random bugs that took forever to figure out.
This project is still a work in progress, but my final goal is to make a custom PCB version of the clock instead of using the current prototype setup.
Bohan Xu
It looks like you're using a very old version of KiCad either v6 or v5.1. Unless your PC is old you really should take advantage of a recent version such as v9.0.9. v10 will take a while to stabilise and it's easy to upgrade your project then anyway.