+ All Categories
Home > Documents > 8 Candidate Quiz Buzzer Using 8051

8 Candidate Quiz Buzzer Using 8051

Date post: 07-Nov-2014
Category:
Upload: indrajeet-sharma
View: 199 times
Download: 8 times
Share this document with a friend
Description:
great project..
Popular Tags:
44
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) 1. Circuit Diagram Dept of ECE, SITAMS Page 1
Transcript
Page 1: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

1. Circuit Diagram

Dept of ECE, SITAMS Page 1

Page 2: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2. EXPLANATION OF EACH BLOCK

2.1 Power Supply Design

Dept of ECE, SITAMS Page 2

Page 3: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

POWER SUPPLY

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,

230V from the mains supply is step down by the transformer to 5V and is fed to a

rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to

get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any

a.c components present even after rectification. Now, this voltage is given to a voltage

regulator to obtain a pure constant dc voltage.

Fig: Power supply

Dept of ECE, SITAMS Page 3

RegulatorFilterBridge

Rectifie

Step down

transform

230V AC 50Hz

D.C

Output

Page 4: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Transformer

Usually, DC voltages are required to operate various electronic equipment and these

voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c

input available at the mains supply i.e., 230V is to be brought down to the required

voltage level. This is done by a transformer. Thus, a step down transformer is employed

to decrease the voltage to a required level.

Rectifier

The output from the transformer is fed to the rectifier. It converts A.C. into pulsating

D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge

rectifier is used because of its merits like good stability and full wave rectification.

Dept of ECE, SITAMS Page 4

Page 5: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both

half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure. The

circuit has four diodes connected to form a bridge. The ac input voltage is applied to the

diagonally opposite ends of the bridge. The load resistance is connected between the

other two ends of the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas

diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with

the load resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct whereas,

D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series

with the load resistance RL and hence the current flows through RL in the same direction

as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional

wave.

Dept of ECE, SITAMS Page 5

Page 6: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Dept of ECE, SITAMS Page 6

Page 7: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Filter

Capacitive filter is used in this project. It removes the ripples from the output of rectifier

and smoothens the D.C. Output received from this filter is constant until the mains

voltage and load is maintained constant. However, if either of the two is varied, D.C.

voltage received at this point changes. Therefore a regulator is applied at the output stage.

Voltage regulator

As the name itself implies, it regulates the input applied to it. A voltage

regulator is an electrical regulator designed to automatically maintain a constant voltage

level. In this project, power supply of

5V and 12V are required. In order to

obtain these voltage levels, 7805 and

7812 voltage regulators are to be

used. The first number 78 represents

positive supply and the numbers 05, 12 represent the required output voltage levels. The

L78xx series of three-terminal positive regulators is available in TO-

220, TO-220FP, TO-3, D2PAK and DPAK packages and several fixed

output voltages, making it useful in a wide range of applications. These

regulators can provide local on-card regulation, eliminating the

distribution problems associated with single point

regulation. Each type employs internal current limiting,

thermal shut-down and safe area protection, making it

essentially indestructible. If adequate heat sinking is

provided, they can deliver over 1 A output current.

Although designed primarily as fixed voltage regulators,

these devices can be used with external components to

obtain adjustable voltage and currents.

Dept of ECE, SITAMS Page 7

Page 8: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2.2 AT89C51 Microcontroller

MICROCONTROLLERS

Microcontrollers’ producers have been struggling for a long time for attracting more and

more choosy customers. Every couple of days a new chip with a higher operating

frequency, more memory and more high-quality A/D converters comes on the market.

Nevertheless, by analyzing their structure it is concluded that most of them have the same

(or at least very similar) architecture known in the product catalogs as “8051

compatible”. What is all this about?

The whole story began in the far 80s when Intel launched its series of the

microcontrollers labeled with MCS 051. Although, several circuits belonging to this

Series had quite modest features in comparison to the new ones; they took over the world

very fast and became a standard for what nowadays is meant by a word microcontroller.

Dept of ECE, SITAMS Page 8

Page 9: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

The reason for success and such a big popularity is a skillfully chosen configuration

which satisfies needs of a great number of the users allowing at the same time stable

expanding ( refers to the new types of the microcontrollers ). Besides, since a great deal

of software has been developed in the meantime, it simply was not profitable to change

anything in the microcontroller’s basic core. That is the reason for having a great number

of various microcontrollers which actually are solely upgraded versions of the 8051

family. What is it what makes this microcontroller so special and universal so that almost

all the world producers manufacture it today under different name?

FEATURES OF AT89C51

4K Bytes of Re-programmable Flash Memory.

RAM is 128 bytes.

2.7V to 6V Operating Range.

Fully Static Operation: 0 Hz to 24 MHz.

Two-level Program Memory Lock.

128 x 8-bit Internal RAM.

Dept of ECE, SITAMS Page 9

Page 10: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

32 Programmable I/O Lines.

Two 16-bit Timer/Counters.

Six Interrupt Sources.

Programmable Serial UART Channel.

Low-power Idle and Power-down Modes

4 Kb program memory is not much at all.

128Kb RAM (including SFRs as well) satisfies basic needs, but it is not imposing

amount.

 

Dept of ECE, SITAMS Page 10

Page 11: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Pin Diagram

Dept of ECE, SITAMS Page 11

Page 12: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Pin Description

 Pin No Function Name

1

8 bit input/output port (P1) pins

P1.0

2 P1.1

3 P1.2

4 P1.3

5 P1.4

6 P1.5

7 P1.6

8 P1.7

9 Reset pin; Active high Reset

10 Input (Rx) for serial communication RxD

8 bit

input/o

utput

port

(P3)

pins

P3.0

11 Output (Tx) for serial communication TxD P3.1

12 External interrupt 1 Int0 P3.2

13 External interrupt 2 Int1 P3.3

14 Timer1 external input T0 P3.4

15 Timer2 external input  T1 P3.5

16 Write to external data memory Write P3.6

17 Read from external data memory Read P3.7

18&19 Quartz crystal oscillator (up to 24 MHz) Crystal 2&1

20 Ground (0V) Ground

21 8 bit input/output port (P2) pins

/

High-order address bits when interfacing with external memory

P2.0/ A8

22 P2.1/ A9

23 P2.2/ A10

Dept of ECE, SITAMS Page 12

Page 13: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

 

24 P2.3/ A11

25 P2.4/ A12

26 P2.5/ A13

27 P2.6/ A14

28 P2.7/ A15

29 Program store enable; Read from external program memory PSEN

30Address Latch Enable ALE

Program pulse input during Flash programming Prog

31External Access Enable;  Vcc for internal program executions EA

Programming enable voltage; 12V (during Flash programming) Vpp

32

8 bit input/output port (P0) pins 

Low-order address bits when interfacing with external memory

 

P0.7/AD7

33 P0.6/AD6

34 P0.5/AD5

35 P0.4/AD4

36 P0.3/AD3

37 P0.2/AD2

38 P0.1/AD1

39 P0.0/AD0

40 Supply voltage; 5V (up to 6.6V) Vcc

Dept of ECE, SITAMS Page 13

Page 14: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2.3 Transistor BC548

BC548 is general purpose silicon, NPN, bipolar junction transistor. It is used for

amplification and switching purposes. The current gain may vary between 110 and 800.

The maximum DC current gain is 800.

 

Its equivalent transistors are 2N3904 and 2SC1815. These equivalent transistors however

have different lead assignments. The variants of BC548 are 548A, 548B and 548C which

vary in range of current gain and other characteristics.

 

The transistor terminals require a fixed DC voltage to operate in the desired region of its

characteristic curves. This is known as the biasing. For amplification applications, the

transistor is biased such that it is partly on for all input conditions. The input signal at

base is amplified and taken at the emitter. BC548 is used in common emitter

configuration for amplifiers. The voltage divider is the commonly used biasing mode. For

switching applications, transistor is biased so that it remains fully on if there is a signal at

its base. In the absence of base signal, it gets completely off.

 

Pin Diagram

Dept of ECE, SITAMS Page 14

Page 15: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2.4 Seven Segment Display

A seven segment display is the most basic electronic display device that can display

digits from 0-9. They find wide application in devices that display numeric information

like digital clocks, radio, microwave ovens, electronic meters etc. The most common

configuration has an array of eight LEDs arranged in a special pattern to display these

Dept of ECE, SITAMS Page 15

Page 16: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

digits. They are laid out as a squared-off figure ‘8’. Every LED is assigned a name from

'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are used to display the

numerals while eighth LED 'h' is used to display the dot/decimal.

 

A seven segment is generally available in ten pin package. While eight pins correspond to

the eight LEDs, the remaining two pins (at middle) are common and internally shorted.

These segments come in two configurations, namely, Common cathode (CC) and

Common anode (CA). In CC configuration, the negative terminals of all LEDs are

connected to the common pins. The common is connected to ground and a particular

LED glows when its corresponding pin is given high. In CA arrangement, the common

pin is given a high logic and the LED pins are given low to display a number.

 

Pin Diagram

Dept of ECE, SITAMS Page 16

Page 17: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2.5 Piezo Buzzer

Dept of ECE, SITAMS Page 17

Page 18: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

The piezo buzzer produces sound based on reverse of the piezoelectric effect. The

generation of pressure variation or strain by the application of electric potential across a

piezoelectric material is the underlying principle. These buzzers can be used to alert a

user of an event corresponding to a switching action, counter signal or sensor input. They

are also used in alarm circuits.

                                                   

 

The buzzer produces a same noisy sound irrespective of the voltage variation applied to

it. It consists of piezo crystals between two conductors. When a potential is applied

across these crystals, they push on one conductor and pull on the other. This, push and

pull action, results in a sound wave. Most buzzers produce sound in the range of 2 to 4

kHz.

The red lead is connected to the input and the black lead to the ground.

 

 

Pin Diagram

Dept of ECE, SITAMS Page 18

Page 19: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

2.6 Switches and Pushbuttons

There is nothing simpler than this! This is the simplest way of controlling appearance of

some voltage on microcontroller’s input pin. There is also no need for additional

explanation of how these components operate.

Dept of ECE, SITAMS Page 19

Page 20: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Nevertheless, it is not so simple in practice... This is about something commonly

unnoticeable when using these components in everyday life. It is about contact bounce- a

common problem with m e c h a n i c a l switches. If contact switching does not happen

so quickly, several consecutive bounces can be noticed prior to maintain stable state. The

reasons for this are: vibrations, slight rough spots and dirt. Anyway, whole this process

does not last long (a few micro- or miliseconds), but long enough to be registered by the

microcontroller. Concerning pulse counter, error occurs in almost 100% of cases!

The simplest solution is to connect simple RC circuit which will “suppress” each quick

voltage change. Since the bouncing time is not defined, the values of elements are not

strictly determined. In the most cases, the values shown on figure are sufficient.

If complete safety is needed, radical measures should be taken! The circuit, shown on the

figure (RS flip-flop), changes logic state on its output with the first pulse triggered by

contact bounce. Even though this is more expensive solution (SPDT switch), the problem

is definitely resolved! Besides, since the condensator is not used, very short pulses can be

also registered in this way. In addition to these hardware solutions, a simple software

solution is commonly applied too: when a program tests the state of some input pin and

finds changes, the check should be done one more time after certain time delay. If the

change is confirmed it means that switch (or pushbutton) has changed its position. The

advantages of such solution are obvious: it is free of charge, effects of disturbances are

eliminated too and it can be adjusted to the worst-quality contacts.

Dept of ECE, SITAMS Page 20

Page 21: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

3. SOFTWARE TOOLS

3.1 Keil Software

Keil compiler is a software used where the machine language code is

written and compiled. After compilation, the machine source code is converted

into hex code which is to be dumped into the microcontroller for further

processing. Keil compiler also supports C language code.

STEPS TO WRITE AN ASSEMBLY LANGUAGE PROGRAM IN KEIL AND HOW TO COMPILE

IT:

1. Install the Keil Software in the PC in any of the drives.

2. After installation, an icon will be created with the name “Keil uVision3”.

Just drag this icon onto the desktop so that it becomes easy whenever

you try to write programs in keil.

3. Double click on this icon to start the keil compiler.

4. A page opens with different options in it showing the project workspace at

the leftmost corner side, output window in the bottom and an ash coloured

space for the program to be written.

5. Now to start using the keil, click on the option “project”.

6. A small window opens showing the options like new project, import

project, open project etc. Click on “New project”.

7. A small window with the title bar “Create new project” opens. The window

asks the user to give the project name with which it should be created and

the destination location. The project can be created in any of the drives

available. You can create a new folder and then a new file or can create

directly a new file.

8. After the file is saved in the given destination location, a window opens

where a list of vendors will be displayed and you have to select the device

for the target you have created.

Dept of ECE, SITAMS Page 21

Page 22: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

9. The most widely used vendor is Atmel. So click on Atmel and now the

family of microcontrollers manufactured by Atmel opens. You can select

any one of the microcontrollers according to the requirement.

10.When you click on any one of the microcontrollers, the features of that

particular microcontroller will be displayed on the right side of the page.

The most appropriate microcontroller with which most of the projects can

be implemented is the AT89C51. Click on this microcontroller and have a

look at its features. Now click on “OK” to select this microcontroller.

11.A small window opens asking whether to copy the startup code into the file

you have created just now. Just click on “No” to proceed further.

12.Now you can see the TARGET and SOURCE GROUP created in the

project workspace.

13.Now click on “File” and in that “New”. A new page opens and you can start

writing program in it.

14.After the program is completed, save it with any name but with the .asm

extension. Save the program in the file you have created earlier.

15.You can notice that after you save the program, the predefined keywords

will be highlighted in bold letters.

16.Now add this file to the target by giving a right click on the source group. A

list of options open and in that select “Add files to the source group”.

Check for this file where you have saved and add it.

17.Right click on the target and select the first option “Options for target”. A

window opens with different options like device, target, output etc. First

click on “target”.

18.Since the set frequency of the microcontroller is 11.0592 MHz to interface

with the PC, just enter this frequency value in the Xtal (MHz) text area and

put a tick on the Use on-chip ROM. This is because the program what we

write here in the keil will later be dumped into the microcontroller and will

be stored in the inbuilt ROM in the microcontroller.

Dept of ECE, SITAMS Page 22

Page 23: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

19.Now click the option “Output” and give any name to the hex file to be

created in the “Name of executable” text area and put a tick to the “Create

HEX file” option present in the same window. The hex file can be created

in any of the drives. You can change the folder by clicking on “Select

folder for Objects”.

20.Now to check whether the program you have written is errorless or not,

click on the icon exactly below the “Open file” icon which is nothing but

Build Target icon. You can even use the shortcut key F7 to compile the

program written.

21.To check for the output, there are several windows like serial window,

memory window, project window etc. Depending on the program you have

written, select the appropriate window to see the output by entering into

debug mode.

22.The icon with the letter “d” indicates the debug mode.

23.Click on this icon and now click on the option “View” and select the

appropriate window to check for the output.

24.After this is done, click the icon “debug” again to come out of the debug

mode.

25.The hex file created as shown earlier will be dumped into the

microcontroller with the help of another software called Proload.

Dept of ECE, SITAMS Page 23

Page 24: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

3.2 PROLOAD

Proload is a software which accepts only hex files. Once the machine

code is converted into hex code, that hex code has to be dumped into the

microcontroller placed in the programmer kit and this is done by the Proload.

Programmer kit contains a microcontroller on it other than the one which is to be

programmed. This microcontroller has a program in it written in such a way that it

accepts the hex file from the keil compiler and dumps this hex file into the

microcontroller which is to be programmed. As this programmer kit requires

power supply to be operated, this power supply is given from the power supply

circuit designed above. It should be noted that this programmer kit contains a

power supply section in the board itself but in order to switch on that power

supply, a source is required. Thus this is accomplished from the power supply

board with an output of 12volts or from an adapter connected to 230 V AC.

1. Install the Proload Software in the PC.

2. Now connect the Programmer kit to the PC (CPU) through serial cable.

3. Power up the programmer kit from the ac supply through adapter.

4. Now place the microcontroller in the GIF socket provided in the

programmer kit.

5. Click on the Proload icon in the PC. A window appears providing the

information like Hardware model, com port, device type, Flash size etc.

Click on browse option to select the hex file to be dumped into the

microcontroller and then click on “Auto program” to program the

microcontroller with that particular hex file.

6. The status of the microcontroller can be seen in the small status window in

the bottom of the page.

Dept of ECE, SITAMS Page 24

Page 25: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

7. After this process is completed, remove the microcontroller from the programmer

kit and place it in your system board. Now the system board behaves according to

the program written in the microcontroller.

4. SOURCE CODE

// Program to make a quiz buzzer using seven segment

#include<reg51.h>

unsigned int digi_val[10]={0x40,0xF9,0x24,0x30,0x19,0x12,0x02,0xF8,0x00,0x10};

// Hex value corresponding to the digits 0 to 9

sbit output_on_pin = P3^0; // Enable pin to enable the seven segment.

sbit stop_pin = P3^1; // Stop pin to reset the buzzer.

sbit buzzer_pin=P0^0; // Buzzer pin to sound the buzzer.

int flag;

void delay() // Time delay function

{

int i,j;

for(i=0;i<200;i++)

for(j=0;j<1275;j++);

}

void display(unsigned int current_dig)

// Function to display the resultant digit on the seven segment and sound the

buzzer.

{

P2=digi_val[current_dig];

output_on_pin = 1;

buzzer_pin=0;

delay();

Dept of ECE, SITAMS Page 25

Page 26: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

buzzer_pin=1;

while(stop_pin != 0);

}

void buzzer() //Function to monitor the input switches

{

flag = 0;

while(1)

{

while (P1 == 0xFF);

while (P1 == 0xFE) //Check if switch 1 is pressed

{

flag = 1;

display(1);

}

while (P1 == 0xFD) //Check if switch 2 is pressed

{

flag = 2;

display(2);

}

while (P1 == 0xFB ) //Check if switch 3 is pressed

{

flag = 3;

display(3);

}

while (P1 == 0xF7 ) //Check if switch 4 is pressed

{

Dept of ECE, SITAMS Page 26

Page 27: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

flag = 4;

display(4);

}

while (P1 == 0xEF ) //Check if switch 5 is pressed

{

flag = 5;

display(5);

}

while (P1 == 0xDF) //Check if switch 6 is pressed

{

flag = 6;

display(6);

}

while (P1 == 0xBF ) //Check if switch 7 is pressed

{

flag = 7;

display(7);

}

while (P1 == 0x7F ) //Check if switch 8 is pressed

{

flag = 8;

display(8);

}

P1 = 0xFF;

stop_pin = 1;

output_on_pin = 0;

Dept of ECE, SITAMS Page 27

Page 28: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

}

}

void main()

{

output_on_pin=0;

stop_pin = 1;

P1 = 0xFF;

buzzer();

}

Dept of ECE, SITAMS Page 28

Page 29: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

5. WORKING PROCEDURE

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.

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.

A seven segment consists of eight LEDs which are aligned in a manner so as to display

digits from 0 to 9 when proper combination of LED is switched on. Seven segment uses

seven LED’s to display digits from 0 to 9 and the eighth LED is used for the dot. A

typical seven segment looks like as shown in the figure below.   

Dept of ECE, SITAMS Page 29

Page 30: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

Seven Segment are available in two configuration - (1) Common Anode (2) Common

Cathode.

Here common anode seven segment display is used because the output current of the

microcontroller is not sufficient enough to drive the LED’s, similar to the case of driving

an LED. The circuit diagram shows the connections of seven segment to the controller.

The pins a to g of the Seven Segment are connected to the Port P2 of the microcontroller.

The common pin of the seven segment is connected to Vcc. The  ‘h’  has not been used,

which is the dot pin of the controller.

Since the seven segment display works on negative logic, we will have to provide logic 0

to the corresponding pin to make an LED glow. Table below shows the hex values used to

display the different digits.

Dept of ECE, SITAMS Page 30

Page 31: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

DIGIT a b c d e f g HEX Value

0 0 0 0 0 0 0 1 0x40

1 1 0 0 1 1 1 1 0xF9

2 0 0 1 0 0 1 0 0x24

3 0 0 0 0 1 1 0 0x30

4 1 0 0 1 1 0 0 0x19

5 0 1 0 0 1 0 0 0x12

6 0 1 0 0 0 0 0 0x02

7 0 0 0 1 1 1 1 0xF8

8 0 0 0 0 0 0 0 0x00

9 0 0 0 1 1 0 0 0x10

 

When the values corresponding to the digits 0 to 9 are given on the output port, the digit

gets displayed on the seven segment.

 

Dept of ECE, SITAMS Page 31

Page 32: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

6. ADVANTAGES AND APPLICATIONS

ADVANTAGES

Highly sensitive

Low cost and reliable circuit

Complete elimination of manpower

APPLICATIONS

Widely used in school, colleges and TV programs

.

Dept of ECE, SITAMS Page 32

Page 33: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

7. C ONCLUSION

Hence by this project we can design an effective detecting system that can

monitor in quiz competitions in schools, colleges, TV programs etc; with eight different

switches. The uniqueness of this project is only alerting the quiz conductor who first

know the answer.

Dept of ECE, SITAMS Page 33

Page 34: 8 Candidate Quiz Buzzer Using 8051

8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51)

8. REFERENCE

1. WWW. howstuffworks.com

2. EMBEDDED SYSTEM BY RAJ KAMAL

3. 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS BY MAZZIDI

6. Electrikindia

7. WWW.google.com

8. WWW.Engineersgarage.com

Dept of ECE, SITAMS Page 34


Recommended