Quiz
LiveAn arithmetic quiz game on Arduino: questions appear on an LCD screen, answers are picked with three buttons, and a buzzer plays sound effects and music.
v1.0.0 · Quiz.zip · 48 KB

Quiz is our first project combining software and hardware. Running on an Arduino Uno, this arithmetic quiz shows addition, subtraction, multiplication and division questions on a 16x2 LCD screen. You pick the answer with one of three buttons, while a buzzer plays the countdown, right and wrong sounds, and background music.
Features
Four operations
Addition, subtraction, multiplication and division questions are generated at random, so every game is different.
Time and score
20 seconds per question; a correct answer is worth 10 points. It beeps during the last 5 seconds.
Sound and music
A start melody, right/wrong sounds and background music you can switch on and off.
Skip and pause
Skip a hard question, or pause the game and resume whenever you like.
How to play
Power the Arduino: after a welcome message the screen shows "Baslamak Icin Butona Bas" (press the button to start).
Press the D2 button; the start melody plays and the first question appears.
You have 20 seconds for each question. The timer counts down in the top right corner and beeps during the last 5 seconds.
Pick your answer with button A (D8), B (D9) or C (D10). A correct answer is worth 10 points; after a wrong one the correct answer is shown.
Press D2 briefly to skip a question, or hold it for 3 seconds to pause and resume the game.
The music button (D11) turns the background music on and off. After 100 questions your total score appears on the screen.
Parts you need
- Arduino Uno
- 16x2 LCD screen (with I2C module, address 0x27)
- 5 buttons (4 game buttons + 1 music button)
- Buzzer or small speaker
- Breadboard and jumper wires
The code uses the LiquidCrystal_I2C library, which you can install from the Library Manager in the Arduino IDE.
Wiring table
Which Arduino pin each component connects to. The buttons use the internal pull-up resistors, so no extra resistors are needed.
| Component | Component pin | Arduino pin | Description |
|---|---|---|---|
| LCD screen (I2C) | GND | GND | Ground |
| VCC | 5V | Supply voltage | |
| SDA | A4 (SDA) | I2C data line (Uno) | |
| SCL | A5 (SCL) | I2C clock line (Uno) | |
| Button 1 (D2) | First leg | Digital pin 2 | Start; short press: skip, long press: pause |
| Other leg | GND | ||
| Button 2 (D8) | First leg | Digital pin 8 | Option A |
| Other leg | GND | ||
| Button 3 (D9) | First leg | Digital pin 9 | Option B |
| Other leg | GND | ||
| Button 4 (D10) | First leg | Digital pin 10 | Option C |
| Other leg | GND | ||
| Music button | First leg | Digital pin 11 (mz_ak) | Music on/off |
| Other leg | GND | ||
| Buzzer / speaker | Positive (+) leg | Digital pin 6 | Sound effects and melodies (tone output) |
| Negative (−) leg | GND |
What's in the zip?
Quiz.zip contains the Arduino code (Quiz.ino), the wiring table (BAGLANTI.md and an image), setup instructions (README.md) and the MIT license. Unzip it and open Quiz.ino from the Quiz folder in the Arduino IDE.
Verify the file
To check that the file you downloaded is the one we published, open PowerShell in the folder that contains it and run:
Get-FileHash .\Quiz.zip -Algorithm SHA256The SHA-256 value it prints should match this one:
55d16d2400b53939f037d9aa250cf3e15df818cbdcac4d29edef54983e62d31f