Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

8 candidate quiz buzzer using 8051 microcontroller (AT89C51)

By Himanshu Choudhary August 2, 2010

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.
 
 

Project 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();

    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

        {

            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;

    }

}


void main()

{

    output_on_pin=0;

    stop_pin = 1;

    P1 = 0xFF;

    buzzer();


}

###

 


Circuit Diagrams

Circuit-Diagram-of-8-candidate-quiz-buzzer-using-8051-microcontroller-AT89C51

Project Components

  • AT89C51 Microcontroller
  • Piezo Buzzer
  • Seven Segment Display
  • Transistor BC548

Project Video


Filed Under: 8051 Microcontroller
Tagged With: 8051, buzzer, microcontroller
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Why need use TOPmetal Stacking?
  • Monte-Carlo simulation error on ADE-XL
  • Snooping Around is All
  • Identification of a 6 pin smd chip (sto-23-6) marked E2
  • Dynacord enter protect

RSS Electro-Tech-Online.com Discussions

  • Fun with AI and swordfish basic
  • using a RTC in SF basic
  • Does US electric code allow branching ?
  • Faulty heat air gun (dc motor) - problem to locate fault due to Intermittent fault
  • Sump pit water alarm - Kicad 9

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How IoT network topologies work
  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe