8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
1. Circuit Circ uit Diagram Diag ram
Dept of ECE, SITAMS
Page 1
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
2. EXPLANATION OF EACH BLOCK 2.1 Power Supply Design
POWER SUPPLY
Dept of ECE, SITAMS
Page 2
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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. rectifier. The output obtained from the rectifier rectifier is a pulsating pulsating d.c voltage. 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.
230V AC 50Hz
D.C Out ut
Step down transform
Bridge Rectifie
Filter
Regulator
Fig: Power supply
Dept of ECE, SITAMS
Page 3
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 R L and hence the load current flows through R L. L. 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 R L and hence the current current flows through R L 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
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Dept of ECE, SITAMS
Page 6
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Filter Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens smoothens the the D.C. Output Output
received received from this filte filterr is constant constant until until the 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 TO220, 22 0, TO-22 TO-220FP 0FP,, TO-3, TO-3, D2PAK D2PAK and DPAK DPAK packag packages es and severa severall fixed fixed output voltages, making it useful in a wide range of applications. These regu regula lato tors rs can prov provid ide e loca locall on-c on-car ard d regu regula lati tion on,, elim elimin inat atin ing g the the dist distri ribu buti tion on
prob proble lems ms
asso associ ciat ated ed
with with
sing single le
poin pointt
regulation. Each type employs internal current limiting, thermal shut-down and safe area protection, making it essent essential ially ly indest indestruc ructi tible ble.. If adequat adequate e heat heat sin sinkin king g is prov provid ided ed,, they they can can deli delive verr over over 1 A outp output ut curr curren ent. t. 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
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 conve rters comes on the market. Nevertheless, by analyzing their structure it is concluded that most of them have the same (or (or at leas leastt very very simi simila lar) r) arch archit itec ectu ture re know known n in the the prod produc uctt cata catalo logs gs as “805 “8051 1 compatible”. What is all this about? The The whol wholee stor story y bega began n in the the far 80s 80s when when Int Intel launc aunche hed d its ser series of the microcontr microcontroller ollerss labeled labeled with MCS 051. Although, several circuits circuits belonging 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
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 expanding ( refers refers to the new types of the microcontroll microcontrollers ers ). 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 u nder 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.
32 Programmable I/O Lines.
Two 16-bit Timer/Counters.
Dept of ECE, SITAMS
Page 9
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Six Interrupt Sources.
Programmable Serial UART Channel.
Low-power Idle and Power-down Modes
•
4 Kb program memory is not much at a t all.
•
128Kb RAM (including SFRs as well) satisfies basic needs, but it is not imposing amount.
Dept of ECE, SITAMS
Page 10
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Pin Diagram
Dept of ECE, SITAMS
Page 11
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Pin Description Pin No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18&19 20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36
Function
Name P1.0 P1.1 P1.2 P1.3 8 bit input/output port (P1) pins P1.4 P1.5 P1.6 P1.7 Reset pin; Active high Reset Input (Rx) for serial communication RxD P3.0 Output (Tx) for serial communication TxD P .1 8 bit 3 External interrupt 1 Int0 P3.2 input/out P3.3 External interrupt 2 Int1 Timer1 external input T0 put put port port P3.4 Timer2 external input T1 P3.5 (P3) pins Write to external data memory Write P3.6 Read from external data memory Read P3.7 Quartz crystal oscillator (up to 24 MHz) Crystal 2&1 Ground (0V) Ground P2.0/ A8 P2.1/ A9 8 bit input/output port (P2) pins P2.2/ A10 / P2.3/ A11 P2.4/ A12 High-order address bits when interfacing with external memory P2.5/ A13 P2.6/ A14 P2.7/ A15 Program store enable; Read from external program memory PSEN Address Latch Enable AL E Program pulse input during Flash programming Prog External Ac Access En Enable; Vcc for for inte nternal pr progr ogram ex executions EA Prog Progra ramm mmin ing g enab enable le vol volta tage ge;; 12V 12V (dur (durin ing g Flas Flash h prog progra ramm mmin ing) g) Vpp Vpp 8 bit input/output port (P0) pins P0.7/AD7 P0.6/AD6 Low-order address bits when interfacing with external memory P0.5/AD5 P0.4/AD4 P0.3/AD3
Dept of ECE, SITAMS
Page 12
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
37 38 39 40
Supply voltage; 5V (up to 6.6V)
P0.2/AD2 P0.1/AD1 P0.0/AD0 V cc
2.3 Transistor BC548
BC548 BC54 8 is gen genera erall pur purpos posee sil silico icon, n, NPN NPN,, bip bipola olarr jun juncti ction on tra transi nsisto stor. r. It is use used d for amplificati ampli fication on and switching switching purpos purposes. es. The curren currentt gain may vary between 110 and 800. The maximum DC current gain is 800.
Dept of ECE, SITAMS
Page 13
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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 bas basee is am ampl plif ifie ied d an and d ta take ken n at th thee em emit itte ter. r. BC BC54 548 8 is us used ed in co comm mmon on em emit itte ter r 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
2.4 Seven Segment Display
Dept of ECE, SITAMS
Page 14
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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 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. Thesee seg Thes segmen ments ts com comee in two conf configu igurat ration ions, s, nam namely ely,, Com Common mon cat cathode hode (CC (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.
Dept of ECE, SITAMS
Page 15
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Pin Diagram
2.5 Piezo Buzzer
Dept of ECE, SITAMS
Page 16
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
The pie piezo zo buzz buzzer er pro produc duces es sou sound nd bas based ed on rev revers ersee of the piezoelec piezoelectri tricc eff effect ect.. 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 produc produces es a same noisy sound irrespective irrespective of the voltage variation variation appli applied ed 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 17
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
2.6 Switches and Pushbuttons There is nothing simpler than this! This is the simplest way of controlling appearance of some some voltag voltagee on microc microcont ontrol roller ler’s ’s input input pin. pin. There There is also also no need need for addition additional al explanation of how these components operate.
Dept of ECE, SITAMS
Page 18
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Nevert Neverthel heless ess,, it is not so simple simple in practi practice. ce... .. This This is about about someth something ing common commonly ly unnoticeable when using these components in everyday life. It is about contact bounce- a common problem problem with m e c h a n i c a l switches. switches. If contact contact switching 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 1 00% of cases!
The simplest solution solution is to connect simple simple RC circuit which will “suppress” “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 19
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 into hex hex code code whic which h is to be dump dumped ed into into the the micr microc ocon ontr trol olle lerr for for furt furthe her r processing. Keil compiler also supports C language code. STEPS TO WRITE AN ASSEMBLY LANGUAGE PROGRAM IN KEIL AND HOW TO COMPILE IT:
1. Install Install the Keil Keil Softw Software are in the the PC in any of of the drives. drives. 2. After After install installati ation, on, an icon icon will will be created created with the name name “Keil “Keil uVisi uVision3 on3”. ”. Just drag this icon onto the desktop so that it becomes easy whenever you try to write programs in keil. 3. Double Double click click on this this icon to to start start the keil keil compiler compiler.. 4. A page opens opens with differen differentt options options in it showing showing the project project worksp workspace ace 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 start using using the keil, keil, click click on the the option option “project “project”. ”. 6. A smal smalll wind window ow open opens s show showin ing g the the opti option ons s like like new new proj projec ect, t, impo import rt project, open project etc. Click on “New project”. 7. A small window window with with the title bar “Create “Create new projec project” t” opens. opens. The window 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 After the file is saved saved in the given given destina destinati tion on locatio location, n, a window window opens 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 20
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
9. The The most widely widely used used vendo vendorr is Atmel Atmel.. So click click on Atmel 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 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 16. Now add this file to the target by giving a right click on the source group. 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 21
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 22. The icon with the letter “d” indicates the debug 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.Th 5.The hex file ile creat eated as shown ear earlie lier will ill be dumped into the the microcontroller with the help of another software called Proload.
Dept of ECE, SITAMS
Page 22
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 Programmer kit contains a microcontroller 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 microco microcontro ntroller ller which which is to be program programmed med.. As this program programmer mer kit requires 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 Install the the Proloa Proload d Softwa Software re in the the PC. PC. 2. Now connect connect the Programmer Programmer kit to to the PC (CPU) through through serial serial cable. cable. 3. Power up the programmer programmer kit from the the ac supply supply through through adapter. adapter. 4. Now place the micro icroc cont ontroll rolle er in the the GIF sock ocket provide ided in the programmer kit. 5. Clic Click k on the Prol Proloa oad d icon icon in the the PC. PC. A wind window ow appea appears rs prov provid idin ing g the the information like Hardware model, com port, device type, Flash size etc. Click Click on brows browse e option option to selec selectt the the hex hex file file to be dump dumped ed into into the micr microc ocon ontr trol olle lerr and and then then clic click k on “Aut “Auto o prog progra ram” m” to prog progra ram m the the microcontroller with that particular hex file. 6. The status status of the microcontroller microcontroller can can be seen in the small small status window in in the bottom of the page. 7. After this this process process is complete completed, d, remove the microco microcontrol ntroller ler from the the programmer programmer kit and place it in your system board. Now the system board behaves according to the program written in the microcontroller.
Dept of ECE, SITAMS
Page 23
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
4. SOURCE CODE
// Program to make a quiz buzzer using seven segment
#include 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; sbit stop_pin = P3^1; sbit buzzer_pin=P0^0;
// Enable pin to enable the seven segment.
// Stop pin to reset the buzzer. // 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(); buzzer_pin=1; while(stop_pin != 0); }
Dept of ECE, SITAMS
Page 24
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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
{ flag = 4; display(4); }
Dept of ECE, SITAMS
Page 25
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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; } }
void main()
Dept of ECE, SITAMS
Page 26
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
{ output_on_pin=0; stop_pin = 1; P1 = 0xFF; buzzer();
}
Dept of ECE, SITAMS
Page 27
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 ‘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 a buzzer for for a small duration.
When Wh en th thee sy syst stem em st star arts ts,, th thee se seve ven n se segm gmen entt do does es no nott di disp spla lays ys an any y ou outp tput ut.. Th Thee 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 28
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (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 common pin of the seven seven segment is is connected connected to Vcc. The ‘h’ has not been 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 29
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
DIGIT 0 1 2 3 4 5 6 7 8 9
a 0 1 0 0 1 0 0 0 0 0
b 0 0 0 0 0 1 1 0 0 0
c 0 0 1 0 0 0 0 0 0 0
d 0 1 0 0 1 0 0 1 0 1
e 0 1 0 1 1 1 0 1 0 1
f 0 1 1 1 0 0 0 1 0 0
g 1 1 0 0 0 0 0 1 0 0
HEX Value 0x40 0xF9 0x24 0x30 0x19 0x12 0x02 0xF8 0x00 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.
6. ADVANTAGES AND APPLICATIONS
Dept of ECE, SITAMS
Page 30
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
ADVANTAGES Highly sensitive Low cost and reliable circuit Complete elimination of manpower
APPLICATIONS
Widely used in school, colleges and TV programs .
7. CONCLUSION
Dept of ECE, SITAMS
Page 31
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
Hence Hence by this this projec projectt we can design design an effect effective ive detecting detecting syste system m that 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.
8. REFERENCE
Dept of ECE, SITAMS
Page 32
8 CANDIDATE QUIZ BUZZER USING 8051 MICRO CONTROLLER (AT89C51) (AT89C51)
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 33