You are on page 1of 25

CHAPTER 1

INTRODUCTION

1. OVERVIEW OF THE PROJECT.

The Digital clock is the type of clock that displays time digitally. The digital clock was design in order to
enhance the student’s knowledge on circuit design using software’s, circuit building using bread board
and implementation of the circuit on PCB. This was made through contributions from all the group
members. Each and every member contributed to his best ability to ensure that the digital clock is being
created.

The digital clock has three mainly parts namely, the hour section, minute’s sections and the second’s
sections. Each of the minute and second section has been designed to give a count from 00 to 59 after
which it resets to 00 and the hour section to give a count from 00 to 23 hours after which it resets to 00.
For each cycle of 00 to 59 in second section the minute section increases its count by 1. Where all the
three sections will be generated from AT89C51 microcontroller which is from the 8051 family.

The Atmel AT89C51 is a powerful microcontroller which provides a highly-flexible and cost-effective
solution to many embedded control applications. The AT89C51 microcontroller is the one responsible in
generating the timing because it’s a programmable chip that has input and output pins, and also having
timer.

Finally all the three parts will be discussed later in the chapters.

1.1 AIM OF THE PROJECT

The main aim of this project is to build team work among the students and also to help the students to
enhance their knowledge and apply their knowledge to design and build a 24hrs digital clock.

1.2 OBJECTIVE OF THE PROJECT


1. To build a team working experience among students.
2. To design and build a digital clock
3. To develop a program for the microcontroller

1.3 PROJECT SPECIFICATIONS

The students were required to design a working 24hrs alarm digital clock. The students were given the
opportunity to use any method in creating the digital alarm or day indication clock which show’s hours,
minutes and seconds.

1
It was stated that the digital clock should have alarm or day indicator. Students were also required to
provide a power supply unit for the digital clock with a battery backup facility.

1.4 Module Structure


The entire project has been divided into Five modules. They are as follows:
Second section

• Using port 1(Microcontroller) in such a way that this portion produces output from 00 to 59
continuously .
• Using Driver IC (IC 7447) and seven-segment display to display the counts. Both the ICs are of
common anode type.
• Checking the output of the circuit.

Minute section

• Using port 2 (Microcontroller) in such a way that this portion produces output, the output should
count from 00 to 59 with a frequency of 1Hz.for
• Using Driver IC (IC 7447) and seven-segment display to display the counts. Both the ICs are of
common anode type.
• Checking the output of the circuit.

Hour section

• Using port 0(Microcontroller) in such a way so that this portion produces output, the output should
counts from 23.59.59 then resets to 00.
• Here the counting proceeds with a frequency of one pulse per hour.
• Using Driver IC (IC 7447) and seven-segment display to display the counts. Both the ICs are of
common anode type.
• Checking the output.

Day indication section

• Port 3 is programmed in such a way to produce the day indications. When the time reaches 24hrs the
LED will light.
• The 74138 IC will be used to switch on or off the LED when it reaches 24hrs.

Assembling the Four sections together.

• Checking the final output of the circuit.

2
CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

This chapter will present the overview about the digital clock.

2.2 Digital Clock Overview

Digital clock is a type of clock that displays the time digitally, as opposed to an analog clock,
where the time is displayed by hands. Digital clocks were invented in 1959 and became more popular as
microchips and LEDs became cheaply available. Digital clocks typically use the 50 or 60 hertz oscillation
of AC power or a crystal oscillator as in a quartz movement to keep time. To represent the time most
digital clocks use a seven segment LED or LCD.Usually, digital clocks are associated with electronic
drivers, unlike the analog clock which function is mechanically or also electrically driven. There are
many ways to design a digital clock such as using PIC, Atmel etc and C++, C or assembly languages are
used for the program. (http://www.waset.org/journals/waset/v42/v42-67.pdf)

2.3 AT89C51 MICRCONTROLLER.

For this project the AT89C51 is chosen to be used as its core and the assembly language is used
for the program. Atmel At89c51 is a microcontroller that is widely used in electronic projects. A
3
microcontroller (MCU) is a functional computer system-on-a-chip. It contains a processor core, memory,
and programmable input/output peripherals. The AT89C51 was chosen for its immense functionalities,
low-power, and high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and
erasable read only memory and wide availability.
(http://www.atmel.com/dyn/resources/prod_documents/doc0265.pdf)

2.4 Development and Implemetion of Microcontroller Based Digital Clock

The digital electronic clocks have replaced the analog mechanical clock because they are much
reliable, accurate, maintenance free and portable. Mechanical analog clocks will need to be wound, and
their time keeping is not as accurate as quartz analog clocks or digital clocks. A digital clock is quite
accurate, and depending on the type it can also tell you the date, temperature and other information that an
analog clock simply cannot provide. (http://www.ehow.com/facts_7211103_analog-vs_-digital-clocks.html)

It was discussed earlier that the microcontroller-based digital clock is constructed using At89c51
and its software program is written with Keil uVision4 with an Assembly language. The output will be
displayed by using 7segment LED display. The flow chart of this program is shown in Fig 2.3

start

Ports and
registers
Increase
seconds
N Is
o Seconds = 60

Yes
o
Increase
minutes
N
Is o
Minutes = 60

Yes
o Increase Hours
display

Is N 4
Hours=24 o
Yes
o Increase Day
Fig 2.3 Flowchart of At89c51 Digital clock
display
CHAPTER 3
(http://www.ehow.com/facts_7211103_analog-vs_-digital-clocks.html)
SYSTEM DESIGN AND DESCRIPTION

3.1 BLOCK DIAGRAM

7 7447 7447 7
SEGMENT DECORD DECORD SEGMENT
ER ER
7 7447
SEGMENT DECORD 7447 7
ER DECORD SEGMENT
PUSH
8051 ER
BUTTON
ALARM
AT89C5
BUZZER
1 7447 7
DECORD SEGMENT
ER

CRYSTAL
3.2 POWER SUPPLY BLOCK DIGARAM 7447 7
OSSILAT PURE
HALF WAVE DECORD SEGMENT
OR DC
AC 240 AC ER
DC( impure) dc)FILTE REGULATO
BRIDGE VOLTA
TRANSFORM RECTIFIER R R
ER

3.3 SYSTEM CIRCUIT DIAGRAM

5
VCC
5V
U5
7 A OA 13
1 B OB 12
2 C OC 11
6 10
U4 D OD
OE 9
3 ~LT OF 15
13 OA A 7 5 ~RBI OG 14
12 OB B 1 4 ~BI/RBO
11 OC C 2
10 OD D 6
9
15
OE
3 7447N
14
OF ~LT
5 U9
OG ~RBI
~BI/RBO 4
7 A OA 13
1 B OB 12
2 11
7447N U1 6
C OC
10
D OD
1 P1B0T2 VCC 40 OE 9
2 P1B1T2EX P0B0AD0 39 3 ~LT OF 15
3 38 5 14
U3 4
P1B2 P0B1AD1
37 4
~RBI OG
P1B3 P0B2AD2 ~BI/RBO
5 P1B4 P0B3AD3 36
13 OA A 7 6 P1B5MOSI P0B4AD4 35
12 1 7 34
11
OB
OC
B
C 2 8
P1B6MISO P0B5AD5
33 7447N U2
P1B7SCK P0B6AD6
10 OD D 6 9 RST P0B7AD7 32
9 OE 10 P3B0RXD EAVPP 31 4 ~BI/RBO
15 3 11 30 ~RBI OG
14
OF
OG
~LT
~RBI 5 U7 12
P3B1TXD ALEPROG
29
5
~LT OF
14
m on P3B2INT0 PSEN 3 15
~BI/RBO 4 13 P3B3INT1 P2B7A15 28 OE 9
15 Y0 A 1 14 P3B4T0 P2B6A14 27 6 D OD 10
TUE 14 Y1 B 2 15 P3B5T1 P2B5A13 26 2 C OC 11
7447N W ED13 Y2 C 3 16 P3B6WR P2B4A12 25 1 B OB 12
THU 12 Y3 17 P3B7RD P2B3A11 24 7 A OA 13
FRI11 Y4 G1 6 18 XTAL2 P2B2A10 23
SAT10 Y5 ~G2A 4 19 XTAL1 P2B1A9 22
J2 S UN9 Y6 ~G2B 5 20 GND P2B0A8 21
7447N
7 Y7 U8
8051
74LS138D ~BI/RBO
Ke y = S pa ce 4
5 ~RBI OG 14
3 ~LT OF 15
C5 OE 9
33pF C6 6 D
C
OD
OC
10
2 11
1 B OB 12
7 A OA 13
33pF X1
HC-49/U_11M Hz
C3 U6 7447N
R2 V1 LM 7805CT
10kΩ T1
D1 LINE VREG
4

33pF C1 VOLTAGE
1m F COMMON
D2
1N4001
2

230 Vrm s
50 Hz Ba tte ry
1B4B42
1

0° 9V

1.4 COMPONENTS USED


Material quantity
i. AT89C51 microcontroller 1
ii. 7447 decoder 6
iii. 74138 decoder 1
iv. LED 7
v. Transformer 1
vi. Bridge rectifier 1
vii. Electrolytic capacitor (1000uF) 1
viii.Regulator(LM7805) 1
ix. Push button 1
x. Diode 1
xi. 9V Battery

6
3.5 MICROCONTROLLER AT89C51

The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4Kbytes of Flash
programmable and erasable read only memory. The Atmel AT89C51 is a powerful microcomputer which
provides a highly-flexible and cost-effective solution to many embedded control applications.

The device is manufactured using Atmel's high-density nonvolatile memory technology and is compatible
with the industry-standard 8051 instruction set and pin-out. The AT89C51 provides s, two 16-bit
timer/counters, on-chip oscillator, and clock circuitry

http://www.atmel.com/dyn/resources/prod_documents/doc0265.pdf

3.6 AT89C51 PIN DESCRIPTION

The Atmel AT89C51 used in this project is a 40 pin AT89C51. Where it


is divided into port 0, port 1, port 2, port 3, while the remaining pins
went to ground, Vcc, reset and crystal oscillator etc.

PORT 0 (pins 32 to 39)

The port zero is the first upper right side port of the microcontroller,
which consists of 8 pins which are P1.0, P1.1 ,P2.2 ,P3.3 ,P4.4,P5.5 ,P6.6 ,P7.7 . Port 0 also receives the
code bytes during Flash programming and outputs the codes byte during program verifications. The
Hours’ section was generated from the PORT 0
PORT 1 Pins 1 to 8)
The port zero is the first upper left side port of the microcontroller, which consists of 8 pins which are
P1.0, P1.1 ,P1.2 ,P1.3 ,P1.4 ,P1.5 ,P1.6 ,P1.7 . Port 1 also receives the code bytes during Flash
programming and outputs the codes byte during program verifications. The second’s section was
generated from the PORT 1
PORT 2 (pins 21 to 28)
The port zero is the second lower right side port of the microcontroller, which consists of 8 pins which
are P2.0, P2.1 ,P2.2 ,P2.3 ,P2.4 ,P2.5 ,P2.6 ,P2.7 . Port 2 also receives the code bytes during Flash
programming and outputs the codes byte during program verifications. The minutes section was
generated from the PORT 2
PORT 3 (Pins 10 to 17)
The port zero is the second lower left side port of the microcontroller, which consists of 8 pins which are
P3.0, P3.1 ,P3.2 ,P3.3 ,P3.4 ,P3.5 ,P3.6 ,P3.7 . Port 3 also receives the code bytes during Flash
7
programming and outputs the codes byte during program verifications. The day was generated from the
PORT 3

Basic Pins

PIN 9: PIN 9 is the reset pin which is used reset the microcontroller’s internal registers and ports upon
starting up

PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at
these pins to provide clock pulses to the circuit.

PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V to function
properly.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash
memory. In order to program this we need to supply a voltage of +5V at pin 31. If external memory is
connected then PIN 31, also called EA/VPP, should be connected to ground to indicate the presence of
external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory
chips are connected to the controller and only one of them needs to be selected. PIN 29 is called PSEN.
This is "program store enable". In order to use the external memory it is required to provide the low
voltage (0) on both PSEN and EA pins. (The 8051 Microcontroller and Embedded Systems)

3.7 Clock Circuit (Crystal oscillator)

The clock circuit is an important element that is required in the system board. This is because the
microcontroller works digitally based on generated clock. The rate of the clock is determined by a crystal
oscillator that is connected to the clock logic pins. The crystal that used in this project is at rate of
11.0592 MHz. This is shown by Figure 3.3.
C6

33pF
X1
HC-49/U_11MHz
C3

33pF

Figure 3.3

3.8 7 SEGMENT LED DISPLAY.


A seven-segment display, is a form of electronic display device for displaying decimal numerals that are
widely used in digital clocks and electronic meters etc. The seven segment display is the most basic
electronic display device that can display digits from 0-9.The seven-segment display is divided into two

8
kinds namely:- common anode and common cathode. But in this project the common anode seven-
segment display was used because 7447 is used as the decoder.

PIN DISCRIPTION

In a common anode display, the anodes of all the LEDs are joined together and the individual segments
are illuminated by connecting to a low voltage. The common anode seven- segment is having a-g outputs,
Vcc pin and dp pin. The a-g outputs are connected to the 7447 decoder respectively. And the Vcc pin is
connected to the 5 Voltage supply, while the dp is connected to ground. The diagram below shows a
common anode 7 segment display. (http://www.thelearningpit.com/lp/doc/7seg/7seg.htm)

http://www.thelearningpit.com/lp/doc/7seg/7seg.html

3.9.74LS139 DECODER/ DEMULTIPLEXER


The 74LS139 is a 16 pin decoder that is designed to be used in high-performance memory-decoding or
data-routing applications, requiring very short propagation delay times. It is used in the digital clock on
the day indication to be switching ON one LED and switching OFF the remaining 6 LED’s when the time
reaches 24hrs, as the day LED will automatically change.
3.10.PIN DESCRIPTION
The 74138 is having a total of 16 pins. Where the inputs are all connected the port 3 of microcontroller
and the outputs to each LED.

9
(http://focus.ti.com/lit/ds/symlink/sn74ls138.pdf)
Connection Procedure.
1. Pin 16, pin 6 are connected to 5volts supply and pin 4, pin 5and pin 8 to ground.
2. Pins 13, 12, 11, 10, 9, 15 and 14 of the 74138, are connected to the cathode of the 7 LED’s.
3. Connect the pins1 , pin 2 and pin 3 to the port 3( P3.0,P3.1,P3.2) of the microcontroller.

3.11 7447 DECORDER


The 7447 decoder is used in displaying the time as numbers because the microcontroller accepts and
provides data’s in binary or hexadecimal form , so then the 7447 is used in displaying time as numerical.
The 7447 decoder IC is a 16 pin IC from the 74LS family. Which is designed for driving common anode
LED or 7 segment LED displays. The display is only sensible if the binary number is between
DCBA=0000 (0) and DCBA=1001 (9); this is called Binary Coded Decimal or BCD for short. If the
number is larger than 9 you get a strange output on the display. The 7447 only drives a common anode
seven- segment. (http://focus.ti.com/lit/ds/symlink/sn74ls47.pdf
3.12 7447 PIN DESCRIPTION
The 7447 is having a total of 16 pins. Where the inputs are all connected the port 0,port1 and port 2 of
microcontroller.

http://focus.ti.com/lit/ds/symlink/sn74ls47.pdf
Connection Procedure
1. Connect 330-ohm resistors to Pin 16 to 5volts supply and pin 8 to ground.
2. Connect pins 13, 12, 11, 10, 9, 15 and 14 of the 7447, to the, b, c, d, e, f, and g segments of the 7-
segment LED.
3. Connect the pins 1,2,6 and pin 7 of the 7447 to the A,B,C,D of the microcontroller.

10
TRUTH TABLE

CHAPTER 4

4.1 SOFTWARE IMPLEMETATION

i. Description of codings:-

The hour, minutes, seconds and the day indication section were obtained or generated from the
AT89C51 microcontroller through series of codes. The four sections codes will be explained below:

Seconds section

First initialize the data value to the port 1 by moving 00 hexadecimal to register 0, then move the register 0
to port 1 of the microcontroller because the digital clock starts at 0 seconds. Acall delay is a function used
as a time delay for setting the clock frequency. The whole program starts from increasing the second by one
using the accumulator (A) and the seconds is converted from hexadecimal to decimal using DA, which

BCD INPUT OUTPUT ( 7segment) DISPLAY


D C B A a b c d e f g
0 0 0 0 1 1 1 1 1 1 0 0

0` 0 0 1 0 1 1 0 0 0 0 1

0 0 1 0 1 1 0 1 1 0 1 2

0 0 1 1 1 1 1 1 0 0 1 3

0 1 0 0 0 1 1 0 0 1 1 4

0 1 0 1 1 0 1 1 0 1 1 5

0 1 1 0 0 0 1 1 1 1 1 6

0 1 1 1 1 1 1 0 0 0 0 7

1 0 0 0 1 1 1 1 1 1 1 8

1 0 0 1 1 1 1 0 0 1 1 9

mean decimal adjustment, then move A back to register 0 then to port 1 It will then compare the value at the
register 0 with 60 hexadecimal; if it is not equal 60, it will jump back to the start and add one to the second.
After the second is equal to 60, it will reset the value of the R0 to 00 and start increasing the minute by one.

Note:-
11
– DA A means decimal adjustment for addition, which converts hexadecimal to decimal values. The

DA instruction works only on A. In other word, while the source can be an operand of any

addressing mode, the destination must be in register A in order for DA to work.

– The A is a register called the accumulator, and by default it receives the result of all arithmetic

operations.

– R0 is a register in port 1 used to store information temporarily.

PSEUDOCODES IMPLEMENTATION
SECONDS
Move data 00 to register0
Move register0 to port1
Label START
Move register0 to port1
Move register0 to Accumulator A
Call DELAY
Add 1 to Accumulator
Decimal adjustment Accumulator
Move Accumulator to register0
Move register1 to port1
Compare register0 with 60
If register0 not equal to 60
Go to START
If register0 equal 60
Move data 00 to register0
DELAY
Move data 10 to register7
Label L3
Move data 200 to register6
Label L2
Move data 250 to register5
Label L1

12
Compare register5 with 0
If register5 not equal to 0
Decrease register5 by 1 and go to L1
If register5 equal to 0
Compare register6 with 0
If register6 not equal to 0
Decrease register6 by 1 and go to L2
If register6 equal to 0
Compare register7 with 0
If register7 not equal to 0
Decrease register7 by 1 and go to L3
If register7 equal to 0
Return to program after delay.
Minutes section:

First initialize the data value to the port 2 by moving 00 hexadecimal to register 2, then move the register 2
to port 2 of the microcontroller because the digital clock starts at 0 minutes. The whole program starts from
increasing the minutes by one using the accumulator (A) and the minutes is converted from hexadecimal to
decimal using DA, which mean decimal adjustment, then move A back to register 2 then to port 2. It will
then compare the value at the register 2 with 60 hexadecimal; if it is not equal 60 it will jump all the way
back to the increment of seconds till the seconds reaches 60 seconds before adding one to the minutes. After
the minute is equal to 60, it will reset the value of the R2 to 00 and start increasing the hour by one.

MINUTES PSEUDOCODES
Move data 00 to register2
Move register2 to port2
Move register2 to Accumulator A
Add 1 to Accumulator
Decimal adjustment Accumulator
Move Accumulator to register2
Move register2 to port2
Compare register2 with 60
If register2 not equal to 60
Go to START
If register2 equal 60
Move data 00 to register2
Move register2 to port2
Hour section:-

13
Once the minute reach 60, it will reset the value of Register2 to 00 and start increasing the hour by one.
Port0 is used for the hour display. After adding one to Register1, the program will compare Register1
with 24, if it is not equal; it will jump back to seconds counting till it reaches 60 seconds and go all the
way to 60 minutes again before adding one to the hour. When the hour reaches 24, it will be reset to 00
and the whole digital clock will reset to 0, which is the initial condition. And then repeat the entire three
processes continuously, That was why SJMP was used.

Note:-

– SJMP mean short jump, which is used in repeating the seconds, minutes and hours continuously.

HOURS PSEUDOCODES
Move register1 to Accumulator A
Add 1 to Accumulator
Decimal adjustment Accumulator
Move Accumulator to register1
Compare register1 with 24
If register1 not equal to 24
Go to START
If register1 equal 24
Move data 00 to register1
Move register1 to port1
Day indication section:-

Port 3 of the microcontroller is used for day indicator. First, declare register 3 as 0 and move it to
port 3. This will be the initial condition, which is the first day when the digital clock starts. This
data is then comparing with 7, if it is not equal; it will continue showing 0 until the next 24 hours
reached. The port 3 of microcontroller is connected with a demultiplexer 74138, which will
convert the data to binary and light the respective LED.

After 24 hours, the value of register 3 will be increased by 1 and compare again with 7. The
whole process will continue until the value reaches 7, where it will be reset to 0 again after 24
hours.

DAY INDICATOR PSEUDOCODES


Increase register3
Compare register3 with 7
If register3 not equal to 7
Go to SKIP
If register3 equal to 7
Move data 00 to register3
Label SKIP
14
Move register3 to port3
4.2.HARDWARE CONSTRUCTION

The entire digital clock was first build on a breadboard to test the connections, and later on the
components were placed on a Printed circuited board. The printed circuit processes will be explained
below: P.C.B. DESIGNING & WORKING
P.C.B. DESIGNING

i. P.C.B. LAYOUT
The entire circuit was assembled on a general purpose PCB board. PCB layout of the circuit and
preparations are the first and most important in any printed circuit board. Firstly layouts of components
were designed according to the available component dimensions in a PCB software.
The following points are to be observed while forming a PCB:
1. Between two components, sufficient space should be maintained to avoid partial contacts
2. High voltage dissipated components should be mounted at a sufficient distance from
semiconductor and electrolytic capacitors.
Printed circuit board (P.B.C) is used to avoid most of all the disadvantages of convectional breadboard.
These also avoid the use of thin wires for connecting the components.
PCB consist of the following processes:-
1. Designing in the software
2. Ironing
3. Etching
4. Drilling
5. Soldering
6. Troubleshooting.
4.3 ELECTRICAL CONSTRUCTION.
The entire clock was controlled electrically with the use of the power supply unit. Where the power
supply unit consists of different components as shown in Fig 4.3 :-
U6
V1 LM7805CT
T1
D1
4

LINE VREG
C1 VOLTAGE
1mF COMMON
D2
2

230 Vrms 1N4001


50 Hz Battery
1B4B42
1

0° 9V

Fig 4.3

15
1. Transformer:-To step down high voltage AC mains to low voltage AC.
2. Bridge Rectifier:- To convert AC to DC, but the DC output is varying.
3. Electrolytic capacitor:- To smooth the DC from varying greatly to a small ripple.
4. 7805:- To eliminate ripple by setting DC output to a 5 voltage.
5. 1N4001: To serve as switch between main supply and the battery.
6. Battery: To serve as backup power supply.

CHAPTER 5

RESULTS AND DISCUSSION.

5.1. SIMULATION RESULTS AND DISCUSSION

In this chapter, the power supply unit will be discussed in detail.

1. Transformer:- To step down high voltage AC to low voltage AC.The output result is shown below:

Input signal output signal

2. Bridge Rectifier:- To convert AC to DC, but the DC output is varying. The output is shown below:
XSC1

Ext Trig
+
V1 T1 2 D1 _
A B
+ _ + _
230Vrms 4 1
50Hz

3 1B4B42

3. Filter:- smooth the DC from varying greatly to a small ripple. The output result is shown below:

16
XSC1

Ext Trig
+
_
A B
+ _ + _

2 D1
V1 C2
T1 1mF
4 1
230 Vrms
50 Hz
0° 3 1B4B42

4. Regulator:- To eliminate ripple by setting DC output to a 5 voltage. The output result is shown below:
XSC1

Ext Trig
+
_

U1 A
_
B
_
+ +
LM7805CT
LINE VREG
VOLTAGE
V1 T1 2 D1 COMMON
C1
1mF
230 Vrms 4 1
50 Hz

3 1B4B42

5.2 DESIGN CALCULATIONS


Calculating 330 ohms resistor for 7 segment
7 segment voltage=1.7volts
7 segment current=10mA
Total voltage=5Volts
R= 5v-1.7v 10mA=330ohms
Calculating electrolytic capacitor.
c=Vsmax∆V.Fp.RL Where:- Vsmax of regulator= 25volts
c=2525-7*50Hz*29=957.85uF ≅1000uF Vmin of regulator=7volts,
Calculating the period ,T=1F=150Hz=20mS ∆V( change of voltage in the regulator)=25V-7V
Fp=50Hz
Calculating Vpp = Vpp=Vmax-Vmin=19.2—(-18.8)
Vpp=38.0Volts RL=29Ώ
Vp=Vpp2=382=19V
Calculating Vrm= Vrms= Vp2=192=13.5 Volts
Vavg=2Vpπ
Vdc=Vpπ=193.142=6.04
Ripple factor=VrmsVdc=13.56.04 =2.23
CHAPTER 6
(Electronic design)
CONCLUSION AND RECOMENDATION
6.1 CONCLUSION
17
Our project met our expectations, because students were able to develop a working 24hrs digital
clock with a day indicator. Through studying Microcontrollers it is clear that designing a digital clock is
much easier than using decade counters. Yet in order for this to happen, the microcontroller must be
programmed in such a way to generate and control the time.
Finally the initial specifications of the project were fulfilled within the time allocated, and
students were able to applied what they have learned and achieved all the project objectives and
challenges.
6.2 RECOMMENDATION
The AT89C51 was a fairly simple component to use, and the program commands were easy to learn and
ideal for our application. Yet further enhancements could have been made, such as setting the time and
day.

REFERENCE:-
Online:
• At89c51 datasheet available at http://www.keil.com/dd/docs/datashts/atmel/at89c51_ds.pdf
accessed march 6th 2011
• http://en.wikibooks.org/wiki/Embedded_Systems/8051_Microcontroller accessed March 10th
2011
• JOHN HEWES power supply unit 2010 available at http://www.kpsec.freeuk.com/powersup.htm,
accessed april 1st 2011.
• PERRY ANDREWS Digital Clock September 2007 available at
http://www.pelnet.co.uk/elect/projects/clock/Clock_a.pdf accessed April 2nd 2011
• NOOR AZIANA Real time clock display MAY 2006 available at
http://library.utem.edu.my/index2.php?
option=com_docman&task=doc_view&gid=691&Itemid=113 accessed April 2nd 2011

18
• 74LS47 datasheet available at http://focus.ti.com/lit/ds/symlink/sn74ls47.pdf accessed on 4th April
2011
• 74LS138 datasheet available at http://focus.ti.com/lit/ds/symlink/sn74ls138.pdf accessed 6th
April 2011

• Interfacing to7-Segment Numeric Displays available at


http://www.thelearningpit.com/lp/doc/7seg/7seg.htm accessed march 10

• 7447 BCD to 7-segment display driver available at http://www.elektropage.com/default.asp?


tid=438&kw=Drives accessed march 2nd 2011

• Elaine Anderson Analog Vs. Digital Clocks 2010 available at

(http://www.ehow.com/facts_7211103_analog-vs_-digital-clocks.html) accessed march 12th 2011

• Pan Thu Tun Development and Implementation of Microcontroller-based Digital Clock


2008available at (http://www.waset.org/journals/waset/v42/v42-67.pdf) accessed 20th march 2011
BOOKS:-

1. Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. McKinlay The8051 Microcontroller

and Embedded Systems Using Assembly and C Second Edition Prentice Hall Inc.

2. Savant, Roben, Carpenter Electronic design second edition 1991 Addison-wesley .

APPENDIX

Coding using assembly language

ORG 00 // Start for the program

MOV R3,#00H

MOV P3,R3

LOOP: MOV R0,#00H

MOV P0, R0

MOV R1,#00H

MOV P1,R1

MOV R2,#00H

MOV P2,R2

START: MOV P0, R0

19
MOV A, R0

ACALL DELAY

ADD A,#1

DA A

MOV R0,A

MOV P1,R1

SKIP1: CJNE R0,#60H,START

MOV R0,#00H

MOV A,R2

ADD A,#1

DA A

MOV R2,A

MOV P2,R2

CJNE R2,#60H,START

MOV R2,#00H

MOV P2,R2

MOV A,R1

ADD A,#1

DA A

MOV R1,A

CJNE R1, #24H, START

MOV R1,#00H

MOV P1,R1

INC R3

CJNE R3,#7H,SKIP

MOV R3,#00H

SKIP: MOV P3,R3

SJMP LOOP

DELAY: MOV R7,#10

20
L3: MOV R6,#200

L2: MOV R5,#250

L1: DJNZ R5,L1

DJNZ R6,L2

DJNZ R7,L3

RET

END

PCB LAYOUT

Seven segment

Complete system with power supply unit.

Power supply unit from a digital oscilloscope

Main digital clock on PCB board


21
System on breadboard
7447 and 7 a segment on breadboard

PCB processes

22
Cost Analysis of components used

23
24
PROJECT SCHEDULE

ACTIVITIES DURATIO JANUARY FEBUARY MARCH APRIL


N

(WEEKS) - - 1 2 3 4 5 6 7 8 9 10 11 12

1. TITLE SELECTION 1

2. LITERATURE 2
RESEARCH

3. PROJECT PLANNING 1

4. CIRCUIT DESIGN 4

5. HARDWARE DESIGN 3

6. SOFTWARE 2
DEVELOPMENT

7. PROJECT TESTING 1

8. FINAL REPORT 2
PREPARATION AND
SUBMISSION

9. PROJECT 1
DEMONSTRATION

10. PROJECT 1
PRESENTATION
PREPARATION

25

You might also like