1 Project Introduction
The electronic clock of this project is designed with STM32F030K6T6TR microcontroller. By realizing light intensity sensing, the brightness of the digital tube is automatically adjusted to realize the time display of the electronic clock.
2 Overall Scheme
The overall scheme system block diagram is shown in Figure 2-1. The electronic clock based on STM32F030K6T6TR consists of a power supply circuit, an STM32F030K6T6TR microcontroller, a photosensitive circuit, a digital tube drive display circuit, and a button setting circuit.

3 Circuit Principle
The power supply part adopts a DC power supply connection socket and a Micro USB interface sink board design, and a 2-pin header is reserved for external power supply.
By programming the STM32F030K6T6TR microcontroller, the MG-52B photoresistor realizes light intensity sensing to automatically adjust the brightness of the digital tube, and uses a 74HC595 shift register to drive the display digital tube to realize the display of time, and customizes the function buttons to adjust and set the electronic clock.
The program download interface reserves a 2.54mm pitch pin header for the SWD interface 1x5Pin and a 2.54mm pitch pin header for the UART interface 1×4Pin. Use 4 M3 copper column screws to fix the board.

4 BOM
No. Position Parameter Package
Quantity
Item No. 1 R1 ,R2,R3,R4,R5,R7,R16,R18,R20,R23 10KΩ R0805 10 C17414 2 R6 5KΩ R0805 1 C78980 3 R8~R15,R22 510Ω R0805 9 C25317 4 R17,R19,R21,R24 100KΩ R0805 4 C149504 5 C1,C3~C6,C8,C10,C14,C16 104 C0805 9 C49678 6 C2,C13,C15 106 C0805 3 C2932476 7 C7 470uF CAP-TH_D6.3×L12mm 1 C43809 8 C9 220uF CAP-TH_D6.3×L7mm 1 C43331 9 C11,C12 20pF C0805 2 C1798 10 L1 220Ω L0805 1 C85840 11 LDR1 MG-528 RES-TH-5mm 1 C559383 12 VD1,VD2 SS54A SMA(DO-214AC) 2 C842792 13 VT1~VT4 8050 SOT-323-3 4 C124378 14 SW1~SW4,RST K4-6×6_TH KEY-TH-6×6mm_4P 5 C557624 15 X1 8MHz HC-49US 1 C258976 16 LED1 SLR0564FR1C4BD-3.5 LED-SEG-TH_SLR0564FR1C4BD-3.5 1 C225949 17 U1 STM32F030K6T6TR LQFP-32 1 C88446 18 U2 L78M05CDT-TR TO-252-3 1 C 55509 19 U3 74HC595D SOP-16 1 C93838 20 U4 TLV1117LV33DCYR SOT-223-3 1 C15578 21 DC1 DC005-2.0MM DC-IN-TH_DC005 1 C431533 22
USB1
Micro USB
MICRO-USB-SMD_5P
1
C40957
23
H1
2P pin header
2.54mm_1×2P
1
C160332
24
J1
4P pin header
2.54mm_1×4P
1
C124378
25
J2
5P pin header
2.54mm_1×5P
1
C358687
26
TP1~TP4
copper column screw
M3×10+6
4
C551322
27
—
PCB blank board
—
1
—
5 Soldering assembly


Figure 5-2 Actual picture of smart electronic clock based on STM32F030K6T6TR