AD3: Arduino based Fastest Figure First Controlling System for Quiz Competition

AR-AD3: Arduino based Fastest Figure First Controlling System for Quiz Competition

This entry is part 3 of 3 in the series Advanced Arduino Projects

With this system we can detect the fastest finger first action in a quiz competition conducted in schools & colleges. For this project you require following components.

Required Components

  1. Arduino UNO/Nano – 1
  2. 5mm Red LEDs – 5 (not shown in circuit. Connect 5mm and 10mm LEDs in parallel. Fit 5 LEDs on one side of the white box and 5 LEDs on other side. One side of the box will serve as display for contestants and judges and other side of the box will serve as display to the public, who are watching the competition)
  3. 10mm Red LEDs – 5
  4. RC sockets – 5 (not shown in circuit, but can be seen in photograph)
  5. RC pins – 5 (not shown in circuit, but can be seen in photograph)
  6. 1k resistors – 5
  7. 12V/9V adapter socket – 1 (you can use a socket to power the system through external power supply like using a 12V/9V DC Adapter)
  8. 9V, 1A transformer – 1
  9. 1N4007 diodes – 2
  10. Regulator IC 7805 – 1
  11. 1000uF capacitor – 2
  12. Small size zero PCB – 1 (solder the circuit components on it)
  13. PVC boxes 10” x 12” – 2 (the two pvc boxes are fitted back to back on each other so that the complete box can be easily placed on a table with firm base)
  14. PVC boxes 4” x 4” – 5 (in photograph of the project 6 small white boxes are shown, but as the code is designed to reset the system itself automatically, so 6th box is not necessary)
  15. Push-to-on switches – 5 (in photograph of the project 6 small white boxes are shown, but as the code is designed to reset the system itself automatically, so 6th switch is not necessary)
  16. Connecting wires, etc.

The Code

/* This code was developed by Vidyasagar Academy Akola,
 * www.vsa.edu.in
 * License: You can use it for any purpose as long as you don't 
 * claim that you are its author and
 * you don't alter License terms and 
 * formulations (lines 1-9 of this file). 
 * Project: The 5 Channel Quiz Controlling System with auto reset using Arduino nano
 * Date of Creation: 17.02.2020
*/

/*    
    ======= Connection details =======
    Switches connections: 
    player1: A0, player2: A1, player3: A2, player4: A3, player5: A5
    LED1: pin-D2, LED2: pin-D3, LED3: pin-D4, LED4: pin-D5, LED5: pin-D6
    Buzzer: pin-D7
*/

int x=1;
int LED1=2;
int LED2=3;
int LED3=4;
int LED4=5;
int LED5=6;
int buzzer=7; 

void setup() 
{
  pinMode(A0,INPUT); // player1 switch input
  pinMode(A1,INPUT); // player2 switch input
  pinMode(A2,INPUT); // player3 switch input
  pinMode(A3,INPUT); // player4 switch input
  pinMode(A5,INPUT); // player5 switch input 
  
  pinMode(LED1,OUTPUT);
  pinMode(LED2,OUTPUT);
  pinMode(LED3,OUTPUT);
  pinMode(LED4,OUTPUT);
  pinMode(LED5,OUTPUT);

  pinMode(buzzer,OUTPUT);
  reset();
  delay(1000);
  //reset();
  //delay(1000);
  //reset();
  //delay(1000);
  //reset();
  //delay(1000);
}

void loop() 
{
  int a=digitalRead(A0);   // reading pin values for 5 buttons
    int b=digitalRead(A1);
      int c=digitalRead(A2);
        int d=digitalRead(A3);
          int e=digitalRead(A5);
                       
  if(a==LOW) // if player1 presses button
  { 
    if(x==1) // check if x is 1, if yes then execute the code
    {
      digitalWrite(buzzer,HIGH); // buzzer alert that a switch is pressed
      digitalWrite(LED1,HIGH); 
      x++;
      
      delay(3000);
      digitalWrite(buzzer,LOW);
    }
  }

  if(b==LOW) // if player2 presses button
  { 
    if(x==1) // check if x is 1, if yes then execute the code
    {
      digitalWrite(buzzer,HIGH); // buzzer alert that a switch is pressed
      digitalWrite(LED2,HIGH); 
      x++;

      delay(3000);
      digitalWrite(buzzer,LOW);
    }
  }

  if(c==LOW) // if player3 presses button
  { 
    if(x==1) // check if x is 1, if yes then execute the code
    {
      digitalWrite(buzzer,HIGH); // buzzer alert that a switch is pressed
      digitalWrite(LED3,HIGH); 
      x++;

      delay(3000);
      digitalWrite(buzzer,LOW);
    }
  }

  if(d==LOW) // if player4 presses button
  { 
    if(x==1) // check if x is 1, if yes then execute the code
    {
      digitalWrite(buzzer,HIGH); // buzzer alert that a switch is pressed
      digitalWrite(LED4,HIGH); 
      x++;

      delay(3000);
      digitalWrite(buzzer,LOW);
    }
  }

  if(e==LOW) // if player5 presses button
  { 
    if(x==1) // check if x is 1, if yes then execute the code
    {
      digitalWrite(buzzer,HIGH); // buzzer alert that a switch is pressed
      digitalWrite(LED5,HIGH); 
      x++;

      delay(3000);
      digitalWrite(buzzer,LOW);
    }
  }

   if(x==2)
   {
      delay(2000);
      digitalWrite(LED1,LOW);
      digitalWrite(LED2,LOW);
      digitalWrite(LED3,LOW);
      digitalWrite(LED4,LOW);
      digitalWrite(LED5,LOW);
      delay(1000);
      reset();
      delay(1000);
      //reset();
      //delay(1000);
      x=1;
   }
}

  void reset()
  {
    for(int i=0;i<4;i++)
    {
    digitalWrite(LED1,HIGH);
    digitalWrite(LED2,HIGH);
    digitalWrite(LED3,HIGH);
    digitalWrite(LED4,HIGH);
    digitalWrite(LED5,HIGH);
    digitalWrite(buzzer,HIGH);
    delay(100);
    digitalWrite(LED1,LOW);
    digitalWrite(LED2,LOW);
    digitalWrite(LED3,LOW);
    digitalWrite(LED4,LOW);
    digitalWrite(LED5,LOW);
    digitalWrite(buzzer,LOW);
    delay(100);
    }
  }

Circuit Diagram

Arduino based Fastest Figure First Controlling System for Quiz Competition Circuit Vidyasagar Academy Akola

The Prototype of Project

Arduino based Fastest Figure First Controlling System for Quiz Competition Vidyasagar Academy Akola

Share on your network!
Dattaraj Vidyasagar
Dattaraj Vidyasagar

Author on this website. He is veteran of Core Electronics since last 35+ years. ATL Mentor of Change, Niti Ayog, Govt. of India, Google Certified Educator, International Robotics Trainer and author of 17 books on electronics, robotics, programming languages and web designing... ➤➤

Leave a Reply

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