Вы находитесь на странице: 1из 7

MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 1



Project
On
QUIZ BUZZER
By

TAILOR ROHAN B (D10EC144)
THAKKAR PRATIK P (D10EC145)
PANCHAL AMAN R (D10EC146)

Guided
By
Dr. UTKAL MEHTA





MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 2

AIM:- To make A QUIZ BUZZER by interfacing 7-SEGMENT
With 8051(using IC AT89S51)
TOOLS USED(SOFTWARES):- KEIL, MULTISIM-11
DESCRIPTION:-
Quiz buzzer system has eight input pins corresponding to eight teams. The
output is displayed on a seven segment display (interfaced with
microcontroller), which shows the number corresponding to the team which
has pressed the button first. A buzzer is also sounded for a small duration to
give an acoustic alarm. The connections of the seven segment, input pins
and output pins is shown in the circuit diagram.

When the system starts, the seven segment does not displays any output. The
microcontroller keeps scanning the input pins. As soon as any one of the
inputs is pressed, the buzzer sounds for a small duration. The seven segment
displays the number corresponding to the input pressed. Now even if any
other input pin is pressed, there will be no effect on the system till the time
the stop pin is pressed to reset the system.

There are a total of nine input pins. Eight pins of port P1 of the
microcontroller are corresponding to eight inputs and one stop pin for
resetting the buzzer system. On the output side a seven segment is connected
to display the corresponding output number. There is also a provision for
sounding a buzzer for a small duration. Here common cathode 7-segment is
used to interfacing with microcontroller IC AT89S51. Configuration of
common cathode 7-segment is shown in below figure.
Figure: Common cathode seven segment display
MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 3

CIRCUIT DIAGRAM:-




MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 4

PROGRAM (Assembly language):-

org 0000h ;starting position
clr p3.4 ;configure pin 3.4 as output pin (buzzer OFF)
mov r1,#00h ;register R1 as a counter
mov p2,#00h ;configure port 2 as output (seven segment)
mov dptr,#0300h ;load look table address
setb p3.0 ;configure pin 3.0 as input (to reset buzzer)
start: mov p1,#0ffh ;configure port 1 as input (8 input switch)
l3:mov r2,p1 ;copy data from P1 to register R2
cjne r2,#0ffh,l2 ;check switch is pressed or not
sjmp l3 ;check until any one key pressed
l2:setb c ;set carry bit
clr a ;clear accumlator
mov a,p1 ;copy data from P1 to accumlator
anl p1,a ;mask other keys if one key pressed first
again:rrc a
inc r1
jc again ; check which switch is pressed
clr a
mov a,r1 ;copy number of which switch is pressed first
setb p0.1 ;turn ON buzzer
MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 5

acall delay ;turn on buzzer for 1 second delay
clr p0.1 ;turn OFF buzzer
movc a,@a+dptr ;read value from look table for 7-segment
mov p2,a ;send data from acc to port 2 to turn on 7-segment


here:jb p3.0,here ;check reset pin 3.0 is pressed or not
mov p2,#00h ;turn OFF seven segment
mov r1,#00h ;clear reg. R1
sjmp start ;restart program again

delay:mov tmod,#01h ;use timer 0 in mode 1
mov r4,#32h ;take a counter with 32H value
l5:mov th0,#0b8h ;load th0 with 0b8h
mov tl0,#63h ;load tl0 with 63h
l1:jnb tf0,l1 ;check timer overflow flag 0 is set or not
djnz r4,l5 ;decrement R4 & jump if not zero to l5
clr tr0 ;clear timer run bit 0
ret ;return to main program



MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 6

//load code of common cathode seven segment to code space//
org 0300h ;take 0300h as look table address
db 00h ;turn off seven segment
db 86h ;display 1 to seven segment
db 0dbh ;display 2 to seven segment
db 0cfh ;display 3 to seven segment
db 0e6h ;display 4 to seven segment
db 0edh ;display 5 to seven segment
db 0fdh ;display 6 to seven segment
db 87h ;display 7 to seven segment
db 0ffh ;display 8 to seven segment

end ;end of the asm source file


Disclaimer: Small portion of program code is hidden to
prevent direct use of code. Code is just for guidance.




MICROCONTROLLER PROJECT QUIZ BUZZER

CHARUSAT (B.Tech EC) Page 7


APPLICATION:-

The quiz buzzer systems are widely used in school, colleges and TV
programs. The team which presses the buzzer earliest is entitled to give the
answer. At times it becomes very difficult to identify which team has
pressed the button when two teams press the buzzer within a very small time
gap. In such cases the decision can be biased due to human intervention. The
quiz buzzer presented here takes care of the aforesaid problem. This quiz
buzzer disables the other inputs as soon as the first buzzer is pressed. This
quiz buzzer can be used for a maximum of eight teams. It is build around
8051 microcontroller (AT89S51).

Вам также может понравиться