Projects / Quiz buzzer box

Quiz buzzer box

Beginner2 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Wire the buttons

    Four buttons from D2 to D5 to GND.

  2. NANO15.1 mA

    Wire the lights

    Four LEDs with 220 ohm on D6 to D9.

  3. NANO

    Wire the buzzer

    D10 and GND.

  4. NANO

    Wire the reset

    D11 and GND.

  5. NANO

    Upload the sketch

    A ready beep sounds.

  6. NANO

    Press one button

    Its light stays on, others are locked out.

  7. NANO

    Press the reset

    Lights off, new round.

  8. NANO

    Test fairness

    Press two buttons together and see who wins.

In short

How do you build a quiz buzzer box?

Four big buttons and four lights show which player pressed first, lock the others out, beep once, and a reset button readies the next round. You need Arduino Nano, Tactile push button 12 mm with cap × 4, LED 5 mm red × 4, Resistor 220 Ω × 4, Passive buzzer, Tactile push button 6 mm, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points. It takes 8 steps and about 120 minutes.

Level
Beginner
Time
About 120 min
Parts
8

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Player 1 buttonNano D2 and GNDPressed pulls D2 low
Player 2 buttonNano D3 and GNDPressed pulls D3 low
Player 3 buttonNano D4 and GNDPressed pulls D4 low
Player 4 buttonNano D5 and GNDPressed pulls D5 low
Player LEDs anodes220 ohm to Nano D6, D7, D8, D9One light per player
All four LED cathodesNano GNDCommon ground
Passive buzzer positiveNano D10Winner beep
Passive buzzer negativeNano GNDCommon ground
Quiz master reset buttonNano D11 and GNDClears the lock for the next round

Code

A quiz buzzer has to decide who pressed first, and the board can do that by checking the four buttons one after another in a very fast loop. The first button found pressed is the winner, its light stays on, a beep sounds, and the loop stops checking the other buttons, so later presses are locked out. Each button goes between an input pin and ground and uses the internal pull-up resistor, so a pin reads high until it is pressed. The loop runs in a few tens of microseconds, so two presses must be closer together than that to be a tie, and in that case the player with the lower pin number wins, which is something to mention to the players. The quiz master's reset button clears the winner, turns the lights off, gives a short ready beep and waits a moment so the button can be released. Use 12 millimetre buttons with caps so they are easy to hit, and keep the wires long enough to place each player at a comfortable distance. Passive buzzers need a tone signal, which the sketch produces with the tone function.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const int BTN[4] = {2, 3, 4, 5};
const int LED[4] = {6, 7, 8, 9};
const int BUZZ = 10, RESET_BTN = 11;

bool locked = false;
int winner = -1;

void armRound() {
  locked = false;
  winner = -1;
  for (int i = 0; i < 4; i++) digitalWrite(LED[i], LOW);
  tone(BUZZ, 1500, 60);                       // short "ready" beep
  delay(300);                                  // let the reset button be released
}

void setup() {
  for (int i = 0; i < 4; i++) {
    pinMode(BTN[i], INPUT_PULLUP);
    pinMode(LED[i], OUTPUT);
  }
  pinMode(RESET_BTN, INPUT_PULLUP);
  Serial.begin(9600);
  armRound();
}

void loop() {
  if (!locked) {
    for (int i = 0; i < 4; i++) {
      if (digitalRead(BTN[i]) == LOW) {        // first button seen wins
        winner = i;
        locked = true;
        digitalWrite(LED[i], HIGH);
        tone(BUZZ, 880, 400);
        Serial.print("Player "); Serial.print(i + 1); Serial.println(" was first");
        break;
      }
    }
  }
  if (digitalRead(RESET_BTN) == LOW) {
    armRound();
  }
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Power onShort ready beep, all lights off
Player 2 presses firstLight 2 on and a beep
Other players press afterwardsNothing changes
Reset pressedLights off and ready beep
Serial monitorPlayer number printed at each win

If it does not work

No lights

Check LED direction and the 220 ohm resistors.

A button does nothing

Check its wire reaches GND and the correct pin.

Resets by itself

Check the reset wire is not touching a player wire.

No beep

Use a passive buzzer on D10.

Two lights come on

Reset and check there is a locked flag in the sketch.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the quiz buzzer box?

Arduino Nano, Tactile push button 12 mm with cap × 4, LED 5 mm red × 4, Resistor 220 Ω × 4, Passive buzzer, Tactile push button 6 mm, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points.

How long does the quiz buzzer box take to build?

About 120 minutes for a beginner maker, in 8 steps.

How do I know the quiz buzzer box works?

Power on: Short ready beep, all lights off. Player 2 presses first: Light 2 on and a beep. Other players press afterwards: Nothing changes.

No lights: what should I check?

Check LED direction and the 220 ohm resistors.

A button does nothing: what should I check?

Check its wire reaches GND and the correct pin.

Resets by itself: what should I check?

Check the reset wire is not touching a player wire.

No beep: what should I check?

Use a passive buzzer on D10.