Saturday 15 December 2012

Real Time Clock


REAL TIME CLOCK
The clock described here displays the current time and date and can be build within a small budget  using  AT89C52 microcontroller .it also has a facility to set an alarm and is visable even in the dark.
This construction project will help you understand concepts like real time use of microcontrollers and scanning related to displays .the device is dual powered and switches to battery supply when the mains power is ‘off’.

Circuit description
Fig.1  shows the circuit of the real time clock and fig.3 shows the power supply section .the clock is built around microcontroller AT89C52 (IC1),LTS542 seven segment displays (DIS1 through DIS6),regulator 7805 (IC2) and a few discreate components.
The AT89C52 is a low-power high performance CMOS 8-bit microcontroller .it has 8 kb of flash memory ,256 bytes of RAM ,32 input and output lines ,three 16-bit timers and counters,on chip oscillator ,4 input output port.

 
PART LIST
 SEMICONDUCTORS:
IC1          -AT89C52 microcontroller
IC2          -7805,5V regulator
T1-T2     -BC557 pnp transistor
D1-D4    -1N4007 rectifier diode
DIS1-DIS6-LTS542 common –anode 7 segment display
LED1-LED3-5MM led
RESISTOR:
R1-R5    -10-kilo-ohm
R6-R13  -100-ohm
R14-R21-1 K ohm
R22         - 470 ohm
RNW1   -10 k ohm
CAPACITORS:
C1           -10 micro F
C2,C3     -33Pf
C4           -1000 micro F
C5           -0.1 micro F
MISCELLANEOUS:
X1           -230V AC primary to 12v 500 mA secondary transformer
XTAL      -12MHz crystal oscillator
S1-S5     -Push to on tactile switch
PZ1         -piezobuzzer
 
 

CONSTRUCTIUON  AND  WORKING

An actual-size, single-side  PCB for the real time clock is shown in figure .4 and its component layout in fig.5. assemble the circuit on a PCB to minimise time and assembly errors.carefully assemble the component and double check foe any overlooked error use proper is base for the microcontroller before inserting the ic check all the supply voltages.when power is switched on ,the display should show ’00.00.00’.it will show 01.01.01 when any key is pressed before setting .the table shows the function of switches s1 through s5.to start the date and time setting press s1. the display nwill show ‘set’.now press s2 so that display shows ‘date’.press s3 to get ‘000000’(DDMMYY) on the display .increment the blinking digit number by pressing switch s4 .press s3 to advanced to the next digit .press s3 after setting all the digits of date .the display will show ‘time’.you set time in the same way as date by using switchs s3 and s4 press s3 after setting all the digit of time . now the display will show current time .
                To set the alarm ,press switch s1 twice .the display will show ‘alarm’.press switch s2 once for ‘on’and  then press switch s3. The display will show ‘0000’(HHMM).set the alarm time by using switch s3 and s4 in the same way as when setting the time.the date can be views by pressing any of the keys except s1 and s5.


SOFTWARE

The s/w for the real time clock is written in ‘c’ language and complet using and keil microVISION4 compiler.burn the generated hex code into the microcontroller by using a suitable programmer .all the switches are regularelly scanned .when any switch is pressed ,corresponding action is performed to update the display as per the table.



 







 note:-download the circuit diagram and code and do it .

                                                                                            By:om kumar gaurav


 

No comments:

Post a Comment