Position: Home > Blog Center > Project Solutions > 2011 > 2011/07 > 2011/07/22 > Digital Alarm Clock——Based on a PIC micro (1)
Low Cost Custom Prototype PCB Manufacturer

Project Solutions

Digital Alarm Clock——Based on a PIC micro (1)

Published:2011/7/22 0:55:00 Author:Li xiao na From:SeekIC

by M. Conde de Almeida

Although digital alarm clocks have been around for years, most of today’s off the shelf products suffer from serious design limitations. For example, many don’t keep track of weekdays and can only store one alarm time. High time for a home-brew design that does a better job.



Off the shelf alarm clocks present a serious limitation if, for instance, you and your partner have different wake-up times or if you have to give or take medication at regular intervals. This limitation gets more serious if you want alarms to go off only on specific days of the week or only during work days. The time setting process on most clocks is also subject to improvement. In the majority of cases you adjust time by incrementing minutes and hours. If your clock is at, say, 06:15h and the correct time is 20:58h you need to keep a key pressed for quite some time and release it well before the desired hour/minute, switching to ’slow’ setting. If not, you’re past the desired time and have to start all over again.

This article proposes a solution for these design weaknesses by discussing a low-cost circuit based on the popular PIC 16F84A microcontroller from Microchip.

Our digital alarm clock keeps track of weekdays and has eight alarms that can be individually set to go off every day, only on working days or, if you want, on a specific day of the week.

The time setting process allows the adjustment of each digit of the clock separately by means of Up and Down (+ and -) keys. It also incorporates some other interesting features.

Like all good digital alarm clocks our project has a battery that keeps the clock ticking in the event of an AC power failure. In battery-powered mode the display is turned off to reduce energy consumption. However, if you want to check the time you may still enable the display by pressing a ’display on’ button. In battery mode the alarms will continue to operate normally. When an alarm goes off the display will be turned on to show the current time.

The eight different alarm times are kept in the PIC’s EEPROM. So, you won’t have to adjust any of the alarms again even if the battery fails. A ’snooze’ key will temporarily turn an alarm off. The alarm will be triggered again after a minute until it is definitely turned off. A master Alarm On/Off key will enable/disable all the alarms, independent of their individually set states. A bright LED display makes it easy to check the time from a distance or in the dark.

The 4-MHz crystal oscillator guarantees a pretty accurate time base for the clock (error = 0.000427%).



Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/07/22/Digital_Alarm_Clock——Based_on_a_PIC_micro_(1).html

Print this Page | Comments | Reading(1330)

To evaluate my
Code: