Rank Display System
Rank Display System
Rank Display System
INTRODUCTION
There are so many games where the winner is the one who takes the
least time in successfully completing the task given. Take for instance
the ‘fastest finger first’ in KBC quiz show on TV or the ‘fastest
crossing first’ in any type of race. In these competitions, sometimes
there may be two or more players who appear to complete the task in
equal time. In such cases, it becomes difficult for the judge to announce
the winner, though there may be time difference of a few milliseconds
between the individuals in accomplishing the task.
1
RANK DISPLAY SYSTEM
CIRCUIT DESCRIPTION
2
RANK DISPLAY SYSTEM
Port-l pins Pl.0 through P1.7 and port-3 pins P3.1 through P3.3 of
the microcontroller are interfaced with data line pins 7 through 14
and pins 4 through 6 of the LCD module for displaying the various
rankings. Contrast pin 3 of the LCD module can be controlled
using preset VR1.
Pin 3.4 of the microcontroller is used to control piezobuzzer PZ1.
When P3.4 goes low, piezobuzzer PZ1 sounds. Pin 3.6 of IC1 is
connected to slide switch S9 for selection between race and quiz.
Switch S10 is used to manually reset the microcontroller, while the
power-on reset signal for the microcontroller is derived from the
combination of capacitor C5 and resistor R10.
A 11.0592MHz crystal generates the basic clock frequency for the
microcontroller.
230V AC mains is stepped down by transformer X1 to deliver the
secondary output of 12V, 500mA. The transformer output is
rectified by a full-wave bridge rectifier comprising diodes D1
through D4, filtered by capacitor C3 and then regulated by IC 7805
(IC3). Capacitors C4 and C9 bypass any ripple present in the
regulated power supply.
3
RANK DISPLAY SYSTEM
WORKING
First of all, select the mode by using switch S9.For example, when
you slide switch S9 towards 'quiz' option, the given circuit, can be
used as 'fastest finger first' quiz system.
At the resumption of power, a message "Welcome to all the
players" is displayed on the LCD. After some time, it displays
players' names 'A' through 'H' in the first line and the message
'First Question' in the second line.
Now the quizmaster can ask the first question. The monitor
program continuously checks the status of port 0. If any input
switch S1 through S8 is found low (by the controller program), it
means that the corresponding switch has been pressed.
As soon as any of competitors 'A' through 'H' presses his switch
first, his rank is stored as ‘1’immediately in the rank table at the
corresponding RAM location. The buzzer sounds a beep and the
timer starts recording.
The status of the rank table is updated repeatedly at intervals into
the rank table and this status is maintained (due to latching at port
0, offered by feedback from IC2) until the next key is pressed.
Now the second case arises:
1. If the remaining seven players press their switches within 30
seconds, the LCD displays the message "Done in Time" and
the buzzer sounds a beep. Thereafter, the LCD displays the
ranks ('1' through'8') of all players below their names.
2. If the remaining seven players don't press their switches
within30 seconds, at the end of this period the LCD displays
the message "Time Out" and the buzzer sounds a beep. After
that, the ranks of those who have pressed their switches
4
RANK DISPLAY SYSTEM
5
RANK DISPLAY SYSTEM
PICTURES OF PROJECT
1. 8051 MICROCONTROLLER
fig.3 AT89S51microcontroller
1.1 INTRODUCTION
The 8051 microcontroller belongs
to the MCS-5 (c) family. Its
features are summarized
below:
Internal ROM and RAM
Input & output ports with
programmable pins.
Timer and Counter
Serial Data Communication.
7
RANK DISPLAY SYSTEM
8
RANK DISPLAY SYSTEM
9
RANK DISPLAY SYSTEM
10
RANK DISPLAY SYSTEM
P0.0 or
39 Port 0 Bit 0 or Address bit 0/Data bit 0 Input/Output
Addr0/Data0
40 VCC Supply Voltage Input
T abl e 1.Pi n descri pt i on of 8051
2. LCD
fig.5 A LCD
2.1 INTRODUCTION
The user may select whether the LCD is to operate with a 4-bit
data bus or an 8-bit data bus. If a 4-bit data bus is used the LCD
will require a total of 7 data lines (3 control lines plus the 4 lines
for the data bus). If an 8-bit data bus is used the LCD will require a
total of 11 data lines (3 control lines plus the 8 lines for the data
bus). The three control lines are referred to as EN, RS, and R/W.
There are three memory blocks inside the display:
16 Gnd
16 15
15 Vcc
14
14 D7
13 D6
13 12
12 D5
11
11 D4
10 D3
10 9
9 D2
8
8 D1
7 D0
7 6 E
3
6
5
5 R/W
4 RS
4 3 2
3 Contrast
2
2 Vcc
1 Gnd
1
1
12
RANK DISPLAY SYSTEM
2 VCC +5V
Register Select
4 RS 0 = Instruction Register
1 = Data Register
Enable
0 = start to latch data to LCD
6 EN
character
1= disable
7 DB0 -D0(LSB)
8 DB1 -D1
9 DB2 -D2
10 DB3 -D3
11 DB4 -D4
12 DB5 -D5
13 DB6 -D6
14 DB7 -D7(MSB)
14
RANK DISPLAY SYSTEM
Pins 11-18 are the outputs (Pin 1 drives Pin 18, Pin 2 drives 17,
etc.).
15
RANK DISPLAY SYSTEM
4. RESISTORS
16
RANK DISPLAY SYSTEM
Rough size
1/8 2 3
1/4 2 6
1/2 3 9
1/8 2 3
1/4 2 6
Fig. 10 Metal film resistors(From the top of the photograph
1 3.5 12
1W (tolerance ±5%) ,
17
RANK DISPLAY SYSTEM
Variable resistors
There are two general ways in which variable resistors are used.
1. One is the variable resistor which value is easily changed, like the
volume adjustment of Radio.
2. The other is semi-fixed resistor that is not meant to be adjusted by
anyone but a technician. Semi-fixed resistors are used to
compensate for the inaccuracies of the resistors, and to fine-tune a
circuit
The rotation angle of the variable resistor is usually about 300 degrees.
Some variable resistors must be turned many times to use the whole
range of resistance they offer.These are called "Potentiometers" or
"Trimmer Potentiometers."
In the photograph , the four resistors at
the center of the photograph are the
semi-fixed type.
The two resistors on the left are the
trimmer potentiometers.This
symbol is used to represent
variable resistor in circuit diagram
fig.11 Variable Resistors
18
RANK DISPLAY SYSTEM
5. CAPACITORS
capacitor is charging up, current flows. The current will stop flowing
when the capacitor has fully charged.
The value of a capacitor (the capacitance), is designated in units called
the Farad ( F ). The capacitance of a capacitor is generally very small, so
units such as the microfarad ( 10-6F ), nanofarad ( 10-9F ), and picofarad
(10-12F ) are used.
Sometimes, a three-digit code is used to indicate the value of a capacitor.
For example, when the code is [103], it indicates 10 x 103, or 10,000pF =
10 nanofarad( nF ) = 0.01 microfarad( µF ).
BREAKDOWN VOLTAGE
When using a capacitor, you must pay attention to the maximum voltage
which can be used. This is the "breakdown voltage." The breakdown
voltage is the voltage that when exceeded will cause the dielectric
(insulator) inside the capacitor to break down and conduct. When this
happens, the failure can be catastrophic.
20
RANK DISPLAY SYSTEM
Ceramic Capacitors
Ceramic capacitors are constructed with materials such as titanium
acid barium used as the dielectric. Internally, these capacitors are not
constructed as a coil, so they can be used in high frequency
applications. Typically, they are used in circuits which bypass high
frequency signals to ground.
These capacitors have the shape of a disk. Their capacitance is
comparatively small.
21
RANK DISPLAY SYSTEM
The capacitor on the left is a 100pF capacitor with a diameter of about 3 mm.
The capacitor on the right side is printed with 103, so 10 x 103pF becomes 0.01 µF. The
diameter of the disk is about 6 mm.
Ceramic capacitors have no polarity. Ceramic capacitors should not be
used for analog circuits, because they can distort the signal.
6. DIODES
22
RANK DISPLAY SYSTEM
Some ways in which the diode can be used are listed here.
A diode can be used as a rectifier that converts AC to DC for a power
supply device.
Diodes can be used to separate the signal from radio frequencies.
Diodes can be used as an on/off switch that controls current.
This symbol is used to indicate a diode in a circuit diagram
Rectification / Switching / Regulation
Diode
The stripe stamped on one end of the diode
shows indicates the polarity of the diode.
The stripe shows the cathode side.
The devices shown in the picture are diodes
used for rectification. They are made to handle
relatively high currents. The device on top can
handle as high as 6A, and the one below it can
safely handle up to 1A.
However, it is best used at about 70% of its fig.14 Rectifier Diodes
rating because this current value is a maximum rating. This diode is
typically used to protect the circuit from momentary voltage spikes.
Light Emitting Diode ( LED )
Light emitting diodes must be chosen according to how they will
be used, because there are various kinds.
The diodes are available in several colors. The most common
colors are red and green, but there
are even blue ones.
The device on the far right in the
photograph combines a red LED
and green LED in one package. The
fig.15 LED’s
component lead in the middle is
common to both LEDs. As for the remaing two leads, one side is
23
RANK DISPLAY SYSTEM
for the green, the other for the red LED. When both are turned on
simultaneously, it becomes orange.
7. PIEZOBUZZER
fig.16 A Piezobuzzer
24
RANK DISPLAY SYSTEM
8. POWER SUPPLY
Piezoelectric
Piezoelectric
Element
to PSU Piezoelectric
Ceramics
Metal
Plate
number of things:-
voltage from AC to DC
(Direct current)
1. Reduction of AC Mains
2. Conversion of AC to DC
26
RANK DISPLAY SYSTEM
fig.20Rectification of AC
27
RANK DISPLAY SYSTEM
fig.21Electrolytic Capacitor
4. Voltage Regulator
Regulator, usually having three legs, converts varying input voltage and
produces a constant regulated output voltage. They are available in a
variety of outputs.
The most common part numbers start with the numbers 78 or 79 and
finish with two digits indicating the output voltage. The number 78
represents positive voltage. The 78XX series of voltage regulators are
designed for positive input.
The LM78XX series typically has the ability to drive current up to 1A.
The component has three legs: Input leg which can hold up to 36VDC
Common leg (GND) and an output leg with the regulator's voltage. For
maximum voltage regulation, adding a capacitor in parallel between the
common leg and the output is usually recommended.
PCB ETCHING
Etching is the process where the excess copper is removed to leave the
individual tracks or traces as they are sometimes called.
Many different chemical solutions can be used to etch circuit boards.
Ranging from slow controlled speed etches used for surface preparation
to the faster etches used for etching the tracks. Copper etching is
28
RANK DISPLAY SYSTEM
The etch rate quickly falls off after about 17oz/gallon (100g/l of copper
has been etched for a typical solution containing 5.3lb/gallon (530g/l) of
ferric chloride.
SOLDERING
Soldering is a process in which two or more metal items are joined
together by melting and flowing a filler metal into the joint, the filler
metal having a relatively low melting point. Soft soldering is
characterized by the melting point of the filler metal, which is below
400 °C (800 °F). The filler metal used in the process is called solder.
29
RANK DISPLAY SYSTEM
fig.24 solder
30
RANK DISPLAY SYSTEM
63/37: melts at 183 °C (361.4 °F) (eutectic: the only mixture that
melts at a point, instead of over a range)
60/40: melts between 183–190 °C (361–374 °F)
50/50: melts between 185–215 °C (365–419 °F)
31
RANK DISPLAY SYSTEM
keys equ p0
dline equ p1
rs equ p3.3
rw equ p3.2
en equ p3.1
org 0000h
sjump main
32
RANK DISPLAY SYSTEM
org 000bh
clr tr0
djnz r5, al
setb buzzer
al : djnz, return
mov r6, #3
clr buzzer
mov a, #0c0h
acall command
mov dptr, #timeout
acall read
acall display
setb buzzer
setb flag
33
RANK DISPLAY SYSTEM
return : reti
main : mov ie, #00h
setb ea
setb et0
mov tmod, #0lh
mov tcon, #00h
mov tl0, #00h
mov th0, #00h
mov r7, #136
mov r6, #3
mov r5, #20
mov latch, #0
mov keys, #0ffh
acall lcdly
acall lcd_int
mov dptr, #welcome
acall read
mov a, #0c0h
acall command
jnb mode , race1
mov dptr, #welcome1
sjmp fff1
race1 : mov dptr, #welcome2
34
RANK DISPLAY SYSTEM
35
RANK DISPLAY SYSTEM
setb tr0
mov a, keys
cpl a
xrl a, latch
cjne a, #0, scan
sjmp chk1
scan : jb acc.0, store
inc r0
jb acc.1, store
inc r0
jb acc.2, store
inc r0
jb acc.3 , store
inc r0
jb acc.4 , store
inc r0
jb acc.5 , store
36
RANK DISPLAY SYSTEM
inc r0
jb acc.6, store
inc r0
jb acc.7 , store
store : mov @r0, 04h
orl a, latch
mov latch, a
cjne r4 , #56 , next _ rank
sjmp result
result : clr tr0
mov tl0 , #00h
mov th0, #00h
mov r7, #136
mov r6, #3
mov r5, #20
clr buzzer
mov a, #0c0h
acall command
jnb mode, race4
mov dptr, #intime
sjmp fff4
race4 : mov dptr, # intime1
fff4 : acall read
37
RANK DISPLAY SYSTEM
acall dispdly
setb buzzer
result1 : clr tr0
mov r0, #31h
mov a, #0c0h
acall command
show : mov a ,@r0
acall display
mov a, # ‘ ’
acall display
inc r0
cjne r0, #39h, show
stay : jb restart, stay
mov r1, #4
s1 : mov r2, #200
djnz r2, $
djnz r1, s1
jb restart , stay
nxt_ Ques : mov a, #0c0h
acall command
jnb mode, race3
mov dptr, #nxtqtn
sjmp fff3
38
RANK DISPLAY SYSTEM
39
RANK DISPLAY SYSTEM
c1r rw
nop
nop
setb en
acall lcdly1
clr en
acall lcdly1
ret
display : mov dline , a
setb rs
nop
nop
clr rw
nop
nop
setb en
acall lcdly
clr en
acall lcdly
ret
lcdly : mov r1 , # 0ah
lp1 : mov r2 , # 0ffh
djnz r2 , $
40
RANK DISPLAY SYSTEM
djnz r1 , lp1
ret
lcdly1 : mov r1 , #3fh
lp2 : mov r2 , #0ffh
djnz r2 , $
djnz r1 , lp2
ret
dispdly : mov r1, #255
d1 : mov r2, #255
d2 : mov r3, # 30
djnz r3, $
djnz r2, d2
djnz r1 ,d1
ret
41
RANK DISPLAY SYSTEM
42
RANK DISPLAY SYSTEM
PROBLEMS FACED
43
RANK DISPLAY SYSTEM
FUTURE SCOPE
44
RANK DISPLAY SYSTEM
REFERENCES
4. www.alldatasheets.com
5. www.en.wikipedia.org
45