14-Perpetual calendar alarm clock and temperature compensation based on 51 single chip microcomputer

Publisher:快乐的小鸟Latest update time:2021-09-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Specific implementation functions

The system consists of STC89C52 microcontroller + DS1302 clock chip + DS18B20 temperature sensor


1. Can display year, month, day, hour, minute, second, week, temperature, lunar calendar;


2. The buttons can be used to set the alarm clock and alarm;


3. Press the button to adjust the time and display whether it is a common year or a leap year.


There are 4 buttons in total: Set, Add, Subtract, Switch.

design background

In real life, everyone may have their own clock. Time is passing by without stopping. With a clock, people can live every day in a planned way. However, most clocks now need to replace batteries constantly, and some clocks need external power supply. If the battery is out of power or the external power supply cannot supply power, the clock will stop timing. The new clock calendar chip DS1302 from DALLAS of the United States can solve this problem. The device can provide real-time clock (RTC)/calendar and timer alarm. For months with less than 31 days, the date at the end of the month can be automatically adjusted, including leap year compensation. The device can also work in the 12-hour format of 24-hour forwarder/PM indication. A precise temperature compensation circuit is used to monitor the status of Vcc.


The clock also has the functions that non-real-time clocks do not have, such as environmental protection, no noise, low power consumption, etc. The real-time clock can be used not only at home, but also in public places, such as stations, docks, shopping malls, etc.


hardware design

There are many ways to make a single-chip electronic calendar, and there are also many devices and technologies to choose from. Therefore, the overall design of the system should fully consider the environment in which the system is used, while meeting the system's functions. The selected structure should be simple to use and easy to implement, and the selection of devices should focus on appropriate parameters, stable performance, low power consumption and low cost.


According to the requirements of system design, it is preliminarily determined that the system consists of six modules: power module, clock module, display module, keyboard interface module, temperature measurement module and alarm module. The circuit system block diagram is shown in the figure.

software design

The main program starts initialization and opens interrupts, then scans the alarm clock, keyboard, and reads the 18B20 value. When the S1 key is pressed, the clock setting is executed, and when the S4 key is pressed, the alarm setting is entered. No matter the clock or the alarm clock, it will exit after setting, and the temperature and clock will resume real-time display.

Schematic

The schematic diagram of this system was designed using Altium Designer19, as shown in the figure.

program

This design uses KEIL5 software to implement program design, as shown in the figure.

Simulation Implementation

This design uses protues8.7 software to implement simulation design, as shown in the figure.

Reference address:14-Perpetual calendar alarm clock and temperature compensation based on 51 single chip microcomputer

Previous article:15-Design of digital frequency meter based on 51 single chip microcomputer
Next article:13-Alcohol concentration detection alarm system based on 51 single chip microcomputer

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号