Design of LED digital electronic clock

Publisher:心怀感恩Latest update time:2014-11-20 Source: 21icKeywords:LED Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The production method of LED electronic clock can be seen in many electronic newspapers and magazines, but most of them need to reset the time and other parameters after power failure, which brings a lot of inconvenience to use. There are also backup batteries as backup power sources, but they are often large in size. The LED electronic clock introduced in this article overcomes the previous disadvantages and uses an infrared remote control commonly used in home appliances for control, which is convenient to use. There is an alarm output, and the alarm time and permission can be set through the remote control.
 


Front of electronic clock 
 



Back of electronic clock  


1. Working Principle

DS1302 is a real-time clock chip from Dallas Corporation. Its main features are serial data transmission, programmable charging function for power-off protection power supply, and the ability to turn off the charging function. It uses a common 32768Hz crystal oscillator.

AT89C2051 is the main control chip. First, it recognizes the received infrared remote control code and performs corresponding processing. Second, it reads the time in the clock chip DS1302 regularly and displays the hour and fat in the 4-digit LED. Third, it compares the set alarm time with the real time. If the time is the same and the alarm is allowed, the buzzer will sound for one minute at a cycle of 1 second to remind the user. If you want to stop the alarm, just press the corresponding button on the remote control to turn off the alarm. The alarm time is saved in the RAM of DS1302, and no separate EEPROM is required.

2. Hardware Circuit

Figure 1 is the schematic diagram of the electronic clock. IC2 is DS1302. Electronics enthusiasts can ask MAXIM for free samples. Y2 is a 32768 Hz quartz crystal oscillator, which can be used in ordinary electronic watches. IC3 is a three-pin plastic-encapsulated integrated infrared receiver. LED1-4 is a high-brightness common-anode digital tube. If the crystal oscillator Y1 used in 89C2051 does not have 10MHz, it can be replaced by other 12M or less. Just modify the delay parameters of YS1 and YS2 in the program to keep the delay length unchanged. Adjusting R2 can change the brightness of the digital tube. P1 port connects to the eight-segment digital tube. The left two digits of the digital tube display hours, and the right two digits display minutes. When the alarm time is displayed, it flashes. The decimal points of the second and third digits flash as seconds. Note that the third digit of the digital tube should be rotated 180° when the printed version is arranged according to Figure 1, so that ":" appears between the hours and minutes. The last decimal point is used as the alarm switch mark. Lighting indicates that the alarm is turned on. Buzzer B2 uses a small built-in sound source.

Special mention should be made of the backup power supply B1, which can be a battery or a supercapacitor (more than 100,000uF). Although the DS1302 consumes very little power after the main power is lost, 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 is short (a few hours or a few days), you can use an ordinary electrolytic capacitor with less leakage instead. 100uF can ensure normal timekeeping for 1 hour. After the DS1302 is powered on for the first time, it must be initialized. After initialization, you can adjust the time and alarm in the normal way.

3. Software

The software part focuses on the operation of DS1302 and the decoding of infrared remote control. For the decoding of single chip microcomputer, please refer to other articles. Here we mainly explain the setting part:
 

The remote controller uses the Changhong color TV K11F model remote controller, which sends the 16-bit address code, 8-bit data code and the inverse code of the 8-bit data code. Table 1 lists the codes of each button and the corresponding actions of this electronic clock. If other remote controllers are used, the codes of the corresponding parts of the program need to be modified.

In the operation method, any means that after the key is pressed for the first time, the state is entered, and after pressing it again, the state is exited.

Time setting: Press the "Menu" key to enter the setting state. The LED only displays the hours of normal time. Press the "↑↓" keys to adjust the value. Press the "←" and "→" keys to move between the alarm and normal time. Press the "Menu" key again at any time to exit the setting.

Alarm setting: The alarm time is set in the time setting. The alarm can be enabled or disabled by pressing the "Silence" button at any time.

Display switch: Press the "Display" key to turn the display on and off at any time.

Initialization: After pressing the "Menu" key to enter the setting state, press the "Calendar" key at any time, and the initialized time will be 2002/12/1/12:00:00

Keywords:LED Reference address:Design of LED digital electronic clock

Previous article:Design Method of Interface between LCD Display and AT89S52 Single Chip Microcomputer
Next article:Design of a signal generator with adjustable amplitude based on DDS

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号