Alarm Clock

July 24 2003

Purpose of this project was to create a functional & programmable alarm clock using a microcontroller.  Microcontroller at hand was the almighty PIC16F84A.

Alarm clock features:

Accurate time keeping
7-segment LED or other cheap display
Ability to turn off time display
Programmable Alarm (for single or multiple times)
Nap mode alarm
BIG snooze button
Interfaced Relays programmable to turn on/off at specific time.

Time keeping is done by a software interrupt.  As of now, I will be using a 4.000 MHz crystal oscillator.

I still haven't decided on what to use as time display but it would appear that I would need to get a multiplexer or a serial-in, parallel-out shift register to interface a bunch of 7-segment LED displays.

Rest of the features are tiny, insignificant software snippets.


Display Module

 

 
     
This is a prototype of the display module. It's a transistor multiplexed matrix of 7-segment led digit displays.  A life lesson learned in the picture.  
Here it is in the dark. Very nice, eh?

I went through several designs.  This first prototype required 13 I/O lines to display 4 numerical digits.  Of those, 7 lines were for the individual LEDs and other 4 were for multiplexing via individual transistors.  The big downside (apart from using too many I/O lines) the microcontroller which used this circuit would need to keep updating the display continuously, using up much of its precious time.

My other design is using a serial in, parallel out shift register (74HC595 or 74HC164).  This design called for using 3 I/O lines for sending data to the shift register and 4 for multiplexing transistors.  While this design saved I/O lines, it further complicated the microcontroller program to provide the continuous display.  Because of this, I never implemented the design.

My last design is to provide a dedicated microcontroller for the display unit.  Since I will be using this prototype for other circuits where the ease of use outweighs anything else, I decided this was the way to go.  So the final component count is:

1 x PIC16F84 microcontroller
1 x crystal oscillator (3-8 mhz)
2 x 20 pF capacitors
4 x 7-seg displays
8 x 200 OHM resistors
4 x 1K OHM resistors
4 x NPN transistors
1 x 74HC595 or 74HC164 shift register

Seems costly at first, but considering that the completed unit would only take 2 I/O lines to receive data and would operate independently of the main microcontroller, I think it is well worth it.

Now to build it........


Counter
..back to main page

 
1