ARDUINO TUTORIAL FOR BEGINNERS LESSON 7: BUILDING A QUIZ BUZZER SYSTEM

0

In this lesson, we are going to learn how build a quiz buzzer system using buttons, LEDs, resistors, and a buzzer. This Arduino tutorial for beginners will let you learn the concept behind a quiz buzzer system.

#ArduinoUno #QuizBuzzerSystem #ArduinoQuizBuzzerSystem

ARDUINO TUTORIAL FOR BEGINNERS LESSON 7: BUILDING A QUIZ BUZZER SYSTEM

In this lesson, we are going to learn how build a quiz buzzer system using buttons, LEDs, resistors, and a buzzer. This Arduino tutorial for beginners will let you learn the concept behind a quiz buzzer system.

Reference: https://www.makerlab-electronics.com/

Learn about the Arduino Kit: https://youtu.be/S2Hd-TeijnU

My Collection of Boards and Sensors: https://youtu.be/sEn6LZP_mi0

ARDUINO TUTORIAL FOR BEGINNERS LESSON 6: LEARN HOW TO USE TILT SWITCH : https://youtu.be/1UFsdVAJW9w

Best IoT Project: https://youtu.be/lZsEdkC4A3g

I have recommended stores where you can buy the components:

https://e-boombots.com/

https://www.makerlab-electronics.com/

https://www.e-gizmo.net/oc/index.php

Graphic: https://www.vectorstock.com/

Lesson 7 Building a Quiz Buzzer System

Introduction
In quiz shows, especially entertainment activities (e.g. competitive answering activities), organizers often apply a buzzer system in order to accurately, fairly and visually determine the seat number of a responder.
Now the system can illustrate the accuracy and equity of the judgment by data, which improves the entertainment. At the same time, it is fairer and just. In this lesson, we will use some buttons, buzzers, and LEDs to make a quiz buzzer system.

Components

  • 1* Arduino Uno board
  • 1 * USB data cable
  • 4 * Button
  • 4 * LED
  • 4 * Resistor (220Ω)
  • 1 * Active Buzzer
  • Several jumper wires
  • 1 * Breadboard

Experimental Principle
Button 1, 2 and 3 are answer buttons, and button 4 is the reset button. If button 1 is pressed first, the buzzer will beep, the corresponding LED will light up and all the other LEDs will go out. If you want to start another round, press button 4 to reset.

Experimental Procedures
Step 1: Build the circuit

The schematic diagram

Step 2: Program (Please refer to the example code)
Step 3: Compile the code
Step 4: Upload the sketch to the Arduino Uno board
Now, first press button 4 to start. If you press button 1 first, you will see the corresponding LED light up and the buzzer will beep. Then press button 4 again to reset before you press other buttons.

Arduino Code

/**********************************
 * name:Building a Quiz Buzzer System
 * function: first press button 4 to start. If you press button 1 first, you will see the corresponding LED light up and the buzzer will beep. Then press button 4 again to reset before you press other buttons.
 **********************************/


#define button1 2  //the number of the button 1
#define button2 3  //button2 attach to
#define button3 4  //button3 attach to 
#define button4 9  //button4 attach to
#define buzzerPin 5  //the buzzer attach to    
#define LED1 6  //LED 1attach to      
#define LED2 7  //LED2attach to     
#define LED3 8  //LED3 attach to 
#define LED4 10  //LED4 attach to
#define uint8 unsigned char
uint8 flag = 0;  //used to indicate the state of button4 key
uint8 b1State,b2State,b3State,b4State = 0;

void setup()
{
  //initialize buzzer,LED1, LED2, LED3 and LED4 as output
  pinMode(buzzerPin, OUTPUT);     
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);     
  pinMode(LED3, OUTPUT); 
  pinMode(LED4, OUTPUT);
  //initialize button1,button2 andbutton3 as input,combined with pullup
  pinMode(button1, INPUT_PULLUP);
  pinMode(button2, INPUT_PULLUP);
  pinMode(button3, INPUT_PULLUP);    
  pinMode(button4, INPUT_PULLUP);
  //turn all the led off
  digitalWrite(LED1, LOW);
  digitalWrite(LED2, LOW);  
  digitalWrite(LED3, LOW); 
  digitalWrite(LED4, LOW);
}
void loop()
{
  //turn all the led off
  digitalWrite(LED1, LOW);
  digitalWrite(LED2, LOW);  
  digitalWrite(LED3, LOW);  
  digitalWrite(LED4, LOW);
  //read the state of the button4
  b4State = digitalRead(button4);
  //when button4 pressed
  if(b4State == 0)
  {
    if(b4State == 0)  //confirm that the button4 is pressed
    {
      flag = 1;  //if so,flag is 1
      digitalWrite(LED4, HIGH);  //turn the host LED on
      delay(200);  
    }
  }
  if(1 == flag)
  {
    //read the state of the button of buttons
    b1State = digitalRead(button1);  
    b2State = digitalRead(button2);
    b3State = digitalRead(button3);
    //If the button1 press the first
    if(b1State == 0)
    {
      flag = 0;
      digitalWrite(LED4, LOW);
      Alarm();  //buzzer sound
      digitalWrite(LED1,HIGH);  //turn the LED1 on only
      digitalWrite(LED2,LOW); 
      digitalWrite(LED3,LOW); 
      while(digitalRead(button4));  //detect the button4,if pressed,out of the while loop
    }
    //If the button2 press the first
    if(b2State == 0)
    {
      flag = 0;
      digitalWrite(LED4, LOW);
      Alarm();
      digitalWrite(LED1,LOW);
      digitalWrite(LED2,HIGH); 
      digitalWrite(LED3,LOW); 
      while(digitalRead(button4));
    }
    //If the button3 press the first
    if(b3State == 0)
    {
      flag = 0;
      digitalWrite(LED4, LOW);
      Alarm();
      digitalWrite(LED1,LOW);
      digitalWrite(LED2,LOW); 
      digitalWrite(LED3,HIGH); 
      while(digitalRead(button4));
    }
  }
}
//buzzer sound
void Alarm()         
{
  for(int i=0;i<100;i++){
    digitalWrite(buzzerPin,HIGH); //the buzzer sound
    delay(2);
    digitalWrite(buzzerPin,LOW);  //without sound
    delay(2);                     //when delay time changed,the frequency changed
  }
}

Related Searches: arduino,arduino uno,buzzer,arduino projects,arduino tutorial,quiz buzzer system,quiz buzzer system using arduino uno,arduino quiz buzzer system,diy quiz buzzer system,arduino quiz buzzer,quiz buzzer,quiz,arduino game show,quiz buzzer sound effect,quiz buzzer circuit,arduino project,arduino quiz game show,arduino quiz show,arduino quiz game show foe beginners,arduino quiz buzzer system code

Join this channel to get access to perks: https://www.youtube.com/channel/UCEoNaDH6R_Iu8ee58-hsGxQ/join

Follow our social media accounts:

Facebook: https://www.facebook.com/kringgidz

Facebook: https://www.facebook.com/gideongasulasbuniel

Website: https://e-boombots.com/

Instagram: https://www.instagram.com/gideongbuniel/

Twitter: https://twitter.com/KringxG

Tumbler: https://www.tumblr.com/blog/kringxgidz

Pinterest: https://www.pinterest.ph/KringxGidz

Linkedin: https://www.linkedin.com/in/gideon-buniel-118bb35a/

Full Video:

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Follow us on our social media accounts.