1. Design Purpose
In daily life, we see electronic clocks made of digital tubes, but LED dot matrix clocks are rare. Although dot matrix clocks have their own shortcomings, such as insufficient hardware utilization and high prices, the font of dot matrix clocks can be easily changed. As long as the program in the microcontroller is changed, the displayed font can be changed at will. The friendly font often gives people a refreshing feeling, unlike the font of ordinary LED digital tubes, which is so dull. This may be the most important feature of LED dot matrix clocks.
2. Solution
1. The structure and function of LED dot matrix electronic clock:
1) 24-hour timekeeping.
2) 4-digit time display, using four Φ3mm 8×8 LED dot matrices.
3) The clock is generated by the popular DS1302 real-time clock chip, which has high clock accuracy and can maintain time for one month after power failure.
4) Adopt STC12C2052 single chip microcomputer, which is convenient for hardware expansion. 24MHz crystal, high operating frequency, and the displayed numbers do not flicker!
5) The transformer is used for power supply, which is convenient for the placement of the clock. The transformer power supply voltage is 9V, and after being stabilized by the 7805 on the PCB mainboard, it outputs a stable 5V voltage with less loss.
6) Electronic button time adjustment.
7) Double-sided PCB design, the circuit is compact and powerful.
8) Red and green LEDs are available (Note: only monochrome screens are available).
9) The dot matrix screen is plugged into the PCB (optional). The default dot matrix screen is soldered to the motherboard.
10) Each unit circuit has a filter circuit, and the overall circuit works stably.
2. Main components of LED dot matrix electronic clock
Four Φ3mm 8×8 LED dot matrices, one STC12C2052 microcontroller, one DS1302 real-time clock chip, one LM7805 voltage regulator chip, one 24MHz crystal oscillator, one 9V power supply transformer, four adjustment button switches, and several other resistors, capacitors, diodes, transistors, etc.
3. Performance comparison of main components of LED dot matrix electronic clock
1) About DS1302 clock chip:
The programming and time accuracy of the clock using the DS1302 real-time clock chip are incomparable to the clock generated directly by the single-chip microcomputer. DS1302 is a high-performance, low-power, RAM-based real-time clock chip launched by DALLAS, USA. It can count the year, month, day, weekday, hour, minute, and second, and has a leap year compensation function. The working voltage is as wide as 2.5 to 5.5V. It uses a three-wire interface to communicate synchronously with the CPU, and can use burst mode to transmit multiple bytes of clock signals or RAM data at a time. There is a 31×8 RAM register inside the DS1302 for temporary storage of data. DS1302 is an upgraded product of DS1202, which is compatible with DS1202, but adds dual power pins for main power supply/back power supply, and provides the ability to charge the back power supply with trickle current.
2) Backup power supply:
Backup power supply B1 can be a battery or supercapacitor (more than 100,000uF). Although DS1302 consumes very little power after the main power is off, if you want to keep the clock normal for a long time, it is best to use a small rechargeable battery. You can use the 3.6V rechargeable battery on the motherboard of an old computer. If the power outage time is short (a few hours or a few days), you can use a common electrolytic capacitor with less leakage instead. 100uF can ensure 1 hour of normal running time.
3. Design
1. Electronic circuit:
Double-sided PCB design, compact and powerful circuit
2. Program design:
Main procedures
#include "STC12C2052AD.H"
extern void Read_Time(unsigned char ucCurtime[]);
extern void Set_Time(unsigned char *pSecDa);
extern void Set_Charge(void);
sbit HC138A = P3^2;
sbit HC138B = P3^3;
sbit HC138C = P3^4;
sbit HC138EN = P3^5;
sbit HC595SER=P1^6;
sbit HC595RCLK=P1^5;
sbit HC595SRCLK=P1^4;
sbit KEY1=P1^7;
sbit KEY2=P3^7;
//sbit KEY1 =
//sbit KEY2 =
unsigned char MSecond;
unsigned char Second,Minute,Hour;
unsigned char c1,c2,c3,c4,c5;
unsigned char Time[8];
unsigned char KeyState;
unsigned char Key1On;
unsigned char Key2On;
unsigned char code ZF[]=
{
0x00,0x06,0x09,0x09,0x09,0x09,0x09,0x06,
0x00,0x02,0x06,0x02,0x02,0x02,0x02,0x07,
0x00,0x06,0x09,0x01,0x02,0x04,0x08,0x0f,
0x00,0x06,0x09,0x01,0x06,0x01,0x09,0x06,
0x00,0x02,0x06,0x0a,0x0a,0x0f,0x02,0x02,
0x00,0x0f,0x08,0x0e,0x09,0x01,0x09,0x06,
0x00,0x06,0x09,0x08,0x0e,0x09,0x09,0x06,
0x00,0x0f,0x01,0x01,0x02,0x04,0x04,0x04,
0x00,0x06,0x09,0x09,0x06,0x09,0x09,0x06,
0x00,0x06,0x09,0x09,0x07,0x01,0x09,0x06,
0x00,0x00,0x06,0x06,0x00,0x06,0x06,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
void Delay(unsigned int time)
{
unsigned int i;
for (i=0;i
Previous article:Digital tube clock made of light-emitting diode driven by single chip microcomputer
Next article:STC89C52RC MCU Ultrasonic Distance Measurement Program
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- [Power supply production] Make a low-power linear power supply with waste materials
- Happy New Year!
- [RVB2601 Creative Application Development] Embedded Development, I'm 10 Times Faster Than You -- RVB Dynamic Loading Model MBRE
- Analysis of WDT in MSP430 MCU
- Why does the newly soldered STM32 main control board run about 10 times slower than normal after programming?
- [Discussion] There is no place to make money during the seven days of National Day holiday
- Two methods of programming TMS320C6748
- Enabling higher-performance front-end radar to make Vision Zero a reality
- Power supply control principle of three-phase fuel pump used in Mercedes-Benz passenger cars
- Review summary: Free review of Fudan Micro FM33LG0 series, Winsilver chip