8 Channel Quiz Buzzer Circuit using Microcontroller
In this project, I’ll show you the design and working of an 8 Channel Quiz Buzzer Circuit using Microcontroller (8051), which tells us which team has pressed the button first in a quiz or game show.
Quiz buzzers are frequently used in situations where organisers need to know who pressed the button first, such as educational institutions and game shows. Traditional methods rely on human interaction to determine which team hit the button, which can be inaccurate and even prejudiced.
Another issue emerges when two people touch the button at the same time, making it difficult to tell who pressed the buzzer first.
In this project, I created an Automatic Quiz Buzzer System in which the time between two button clicks is correctly calculated and the appropriate number is displayed when more than one team presses the buzzer.
I created a circuit that uses an 8051 microcontroller to detect input from push buttons and display the relevant number on a display device (7-Segment Display). It’s a straightforward circuit with a small number of components and no complications. Even though this system is only built for 8 teams, another set of 8 push buttons can be used to add additional.
- Principle Behind the Quiz Buzzer Circuit
- Circuit Diagram of 8 Channel Quiz Buzzer Circuit using Microcontroller
- Components Required
- Design Process
- Quiz Buzzer Circuit Design
- CODE
- How Quiz Buzzer Circuit Works?
- Applications of Quiz Buzzer Circuit
Principle Behind the Quiz Buzzer Circuit
The Microcontroller 8 Channel Quiz Buzzer Circuit is a simple embedded system with a set of 8 push buttons as input devices, a microcontroller as the main controller, and a buzzer and a display as output devices.
A microcontroller performs the entire operation using a programme written in C and dumped inside the microcontroller. The buzzer starts ringing when one of the buttons is pressed, and the associated number is displayed on the 7 segment display.
Circuit Diagram of 8 Player Quiz Buzzer using Microcontroller
Components Required
- AT89C51 (8051 Microcontroller)
- 7 Segment Display (Common Anode is used in this project)
- Push Buttons – 10
- 10KΩ Resistors – 2
- 100Ω Resistors – 8
- 470Ω Resistors – 2
- 2N2222 NPN Transistors – 2
- 5V Buzzer
- 1N4007 Diode
- 10μF Capacitor
- 33pF Capacitors – 2
- 11.0592 MHz Crystal
- 8051 Programmer
- 5V Power Supply
Design Process
- First step is designing the circuit.
- The second step is drawing the schematic using any software.
- Third step involves writing the code using high level language like C or assembly language and then compiling it on a software platform like Keil μVision.
- Fourth step is programming the microcontroller with the code.
- Finally, the fifth step is testing the circuit.
Quiz Buzzer Circuit Design
Five key components are used in the circuit: an 8051 microcontroller, SPST push buttons, a buzzer, and a common anode 7 segment display. In this scenario, the microcontroller is an Atmel AT89C51, which is an 8-bit microprocessor (now Microchip).
Reset Circuit Design: The reset resistor is chosen so that the voltage across the reset pin is at least 1.2V and the pulse width applied to this pin is greater than 100 milliseconds. We’ll use a 10K resistor and a 10F capacitor in this example.
The oscillator circuit is made up of a crystal oscillator with a frequency of 11.0592 Mhz and two ceramic capacitors of 33pF each. The crystal is attached to the microcontroller’s pins 18 and 19.
Microcontroller Interfacing Design: A set of eight push buttons is connected to the microcontroller’s port P1 and a buzzer is connected to port pin P3.3. The microcontroller is attached to the 7 segment display so that all of the input pins are connected to port P2.
The code for the microcontroller can be written in either C or assembly language. In this case, I used the Keil Vision tools to write the programme in C. The steps to accomplish this are as follows:
- Create a new project on Keil window and select the target (microcontroller).
- Create a new file under the project and write the code.
- Save the code with .c extension and add the file to the source group folder under the target folder.
- Compile the code and create the hex file.
Once the code is compiled and a hex file is created, next step is to dump the code into the microcontroller. This can be done with an 8051 Microcontroller Programmer.
CODE
#include<reg51.h> | |
#define SEGMENT P2 // PORT2 to Segments of 7-Segment Display | |
#define SWITCH P1 // Input Switches (buttons) to PORT1 | |
sbit buzz=P3^0; // Buzzer | |
sbit rst=P3^3; // Reset Switch (Reset the display) – not the microcontroller | |
sbit digit=P3^7; // 7-Segment Display Common Pin (to enable) | |
void delay (int); // Delay function | |
int x=0,y,z; | |
unsigned char ch[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98}; // Hexadecimal values from 0 to 9. | |
void delay (int d) | |
{ | |
unsigned char i; | |
for(;d>0;d–) | |
{ | |
for(i=250;i>0;i–); | |
for(i=248;i>0;i–); | |
} | |
} | |
void main() | |
{ | |
SWITCH=0xff; | |
SEGMENT=0xff; | |
digit=1; | |
buzz=0; | |
rst=1; | |
while(1) | |
{ | |
while(SWITCH==0xff); // wait until any button is pressed. | |
while (SWITCH==0xfe) // Button 1 is pressed. | |
{ | |
SEGMENT=ch[1]; | |
buzz=1; | |
delay(1000); // Activate buzzer for 1 second. | |
buzz=0; | |
while(rst!=0); // display the digit until the reset is pressed. | |
} | |
while (SWITCH==0xfd) // Button 2 is pressed. | |
{ | |
SEGMENT=ch[2]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0xfb) // Button 3 is pressed. | |
{ | |
SEGMENT=ch[3]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0xf7) // Button 4 is pressed. | |
{ | |
SEGMENT=ch[4]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0xef) // Button 5 is pressed. | |
{ | |
SEGMENT=ch[5]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0xdf) // Button 6 is pressed. | |
{ | |
SEGMENT=ch[6]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0xbf) // Button 7 is pressed. | |
{ | |
SEGMENT=ch[7]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
while (SWITCH==0x7f) // Button 8 is pressed. | |
{ | |
SEGMENT=ch[8]; | |
buzz=1; | |
delay(1000); | |
buzz=0; | |
while(rst!=0); | |
} | |
SEGMENT=0xff; | |
rst=1; | |
} | |
} |
How Quiz Buzzer Circuit Works?
The compiler will initialise the stack pointer and variables with non-zero initial values, as well as execute additional initialization processes, after which it will call the main function. It then looks to see if any of the buttons have been pressed.
To put it another way, the microcontroller looks for any of its input pins at port P1 that are set to zero or logic low. When a button is pressed, the display function is called and the matching number is passed to it. The microcontroller then transmits the appropriate signals to the 7-segment display’s connection.
The buzzer will be turned on for a second before being turned off by the microcontroller, however the number will be displayed continuously on the 7 segment display.
Applications of Quiz Buzzer Circuit
- This circuit can be used at quiz competitions organized at schools, colleges and other institutions.
- It can be also used for other games shows.
- It can be used as at public places like banks, restaurants as a digital token display system.