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

Purpose

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 (AT89C51) This 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. For more details, refer seven segment interfacing . 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.

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.

Components
1) 2) 3) 4) 5) 6) 7) At89c51 Microcontroller Transistor bc548 7 segment display Piezo Buzzer Switches and pushbuttons Resistors Capacitors

Software Used:

1) Keil 2) Proteus

Circuit diagram

Schematic Diagram:

Program
#include <REGX51.H> #define seg P3 sbit cand_1=P1^0; sbit cand_2=P1^1; sbit cand_3=P1^2; sbit cand_4=P1^3; sbit cand_5=P1^4; sbit cand_6=P1^5; sbit cand_7=P1^6; sbit cand_8=P1^7; sbit buz=P2^0;

void delay(unsigned int d); void chk(); void display(unsigned int n); void main(){ buz=0;

display(0); delay(5) while(1){ buz=0; chk();} } ;

void chk(){ while(cand_1==0) { display(1); buz=1;}

while(cand_2==0) {display(2); buz=1;}

while(cand_3==0) { display(3); buz=1; }

while(cand_4==0) {display(4);buz=1; }

while(cand_5==0) {display(5); buz=1;

while(cand_6==0) {display(6);buz=1; }

while(cand_7==0) {display(7);buz=1; }

if(cand_8==0) { display(8);

buz=1;}

else{ display(0);}

} void display(unsigned int a){ switch(a){ case(0): seg=0x0; delay(5); break; case(1): seg=0x1; delay(5); break; case(2): seg=0x2; delay(5); break; case(3): seg=0x3; delay(5);

break; case(4): seg=0x4; delay(5); break; case(5): seg=0x5; delay(5); break; case(6): seg=0x6; delay(5);break; case(7): seg=0x7; delay(5); break; case(8): seg=0x8; delay(5); } } void delay(unsigned int d){ break;

unsigned int i=0,j=0; for(i=0;i<d;i++);{ for(j=0;j<255;j++); } }

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