Single-chip digital clock component package with few components! ![Copy link]
A single-chip digital clock component package with few components!!
The pictures on this site are for reference only:
Component list: a circuit board, a MCU with a program burned in, 88 high-brightness LEDs, a crystal oscillator, three switches, a triode, a buzzer, several resistors and capacitors. Circuit characteristics The electronic clock introduced here can be called extremely simple. It only uses a single 20-pin microcontroller to complete all the functions of the electronic clock, while other design schemes that the author has seen are implemented by using more than two ICs. The circuit is shown
in the figure:
A 20-pin microcontroller STC2032 (the pin arrangement is exactly the same as AT89C2051) is the main body of the electronic clock. Its display stroke data is output from the P1 port in time-sharing, and the P3 port outputs the corresponding six-bit selection signal. Since the LED digital tube consumes a lot of power when it is lit, it cannot be completed using the AT89C2051 single chip, but it can be completed using the STC89C2032. In addition, this site uses ultra-bright light-emitting diodes instead of expensive large digital tubes, which is low-cost and has unique effects.
This electronic clock is designed with three light-touch buttons, which are named as mode setting key K1, plus adjustment key K2, and minus adjustment key K3. Since the STC89C2032 has an integrated reset resistor, the reset pin only needs to be connected to a capacitor. This electronic clock uses an NPN transistor and a buzzer as the alarm sound circuit. This figure is powered by a battery. There are installation locations for bridge rectification, filtering and three-terminal regulator 7805 on the circuit board, and the entire system can be powered by AC voltage. This electronic clock can work with any 6~12V/100mA AC/DC power adapter and has strong adaptability.
Electronic clock function
1. Timekeeping: The default is the timekeeping state, and the "hours: minutes: seconds" are displayed according to the 24-hour system. There are four seconds points for dynamic display, and the time will change according to the actual time with seconds as the minimum unit.
2. Adjust the time: Press K1 (or K2, K3) for more than two seconds, and one of the hour, minute, and second will flash quickly. Press K1 to cycle. Press K2 and K3 to add or subtract the flashing numbers, so as to quickly set the time. If there is no key operation for more than 20 seconds, it will automatically change to the normal time state.
3. Adjust the alarm time: Press K1 (or K2, K3) for more than two seconds again, and one of the hour, minute, and second will flash slowly. Press K1 to cycle. Press K2 and K3 to add or subtract the flashing numbers, so as to quickly set the alarm time. If there is no key operation for more than 20 seconds, it will automatically change to the normal time state. Note: In the alarm state, the hour will change from 01 to 64, indicating 64-way timing time; the minute can only change from 00 to 24, indicating 24 hours, of which the default display is 24, indicating no alarm; the second will change from 00 to 59, indicating 60 minutes. Therefore, this electronic clock can set multiple alarms with minutes as the minimum unit. (Since 64 channels are too many, they are basically useless and inconvenient to use. Therefore, this site sells 16-channel timing.)
4. Error correction status: As we all know, even the best and most authentic quartz crystal oscillator in the world will have frequency deviations, and capacitors need to be fine-tuned to correct the frequency. Different capacitors and loads will affect the frequency offset. This situation may cause the daily error to reach tens of seconds. Of course, equipped with high-quality genuine components will reduce the travel time error to a few seconds. If a fine-tuning capacitor is designed, the daily travel time error can be reduced to less than 1 second. However, for amateur production, there is no more standard measurement equipment to prove that your debugging is just right, and you cannot measure the period or frequency (ordinary measurement will change the circuit working parameters and bring greater measurement errors). And we usually compare it with the time of the TV station. After 24 hours, is my electronic clock faster? ? Or slower? ? Now you don't have to be afraid. This electronic clock is designed with an error correction program: if your electronic clock will be 1.6 seconds faster (or 0.8 seconds slower) in a day, then through the error correction setting of this electronic clock, you can unconsciously slow down by 1.6 seconds (or speed up by 0.8 seconds) in a day. Therefore, this electronic clock can theoretically achieve a daily error of less than 0.2 seconds. Of course, the specific process and effect still need everyone to operate and prove. Error correction method: In the alarm adjustment state, press K1 (or K2, K3) for more than two seconds, and the hour and minute positions will become "one one one one" or "three three three three", indicating slowing down or speeding up. Press K1 to choose; the second position will become 00, and K2 and K3 will change from 00 to 80. The larger the number, the greater the correction. 00 means no correction to speed up or slow down, for example, 2+0=2-0. When there is no key operation for more than 20 seconds, it will automatically change to normal timekeeping state.
Other functions:
1. If the alarm is ringing (it will ring for 20 seconds) during the running state, press any key K1, K2, K3 to stop the sound.
2. In the running state, press K3 to make the electronic clock emit a short "beep" sound every second, which is a bit similar to the sound of a mechanical pointer electronic clock (or mechanical watch), of course, the sound is louder. This function is very useful. For example, we cannot turn our heads to look at the clock in some special circumstances, but we can close our eyes and listen to the sound and count the number of seconds in our hearts before operating something. Press again to turn off the second sound.
3. Hourly time signal function: Press K2 to turn on and off the hourly time signal function. After turning it on, you will hear a long "beep" sound for two seconds every hour.
4. Alarm switch function: Press K1 to turn on and off the timer alarm function. After turning off the alarm, the previously set data will not be lost.