An interactive Arduino-based maths quiz system with adaptive difficulty, multiple display modules, physical answer buttons, score tracking, and a complete Wokwi simulation setup.
The tutorial/ folder contains the original initial project, preserved in this repository as version zero (v0), now reorganized into Arduino, electronics, vector, and document subfolders for easier reference.
This project presents arithmetic challenges using dedicated hardware modules:
- two TM1637 displays for the operands
- three TM1637 displays for the answer options
- one 8x8 LED matrix for the selected operation
- one 16x2 I2C LCD for level and score feedback
- three answer buttons, one reset button, and one potentiometer for difficulty selection
Main sketches:
- English (en-gb) - with decimal rounds:
arduino/maths-quiz-game-en-gb/maths-quiz-game-en-gb.ino - English (en-gb) - integers only (no decimal rounds):
arduino/maths-quiz-game-en-gb-integers/maths-quiz-game-en-gb-integers.ino - Portuguese (pt-br) - with decimal rounds:
arduino/maths-quiz-game-pt-br/maths-quiz-game-pt-br.ino - Portuguese (pt-br) - integers only (no decimal rounds):
arduino/maths-quiz-game-pt-br-integers/maths-quiz-game-pt-br-integers.ino
Open the full demonstration video
- Addition, subtraction, multiplication, and division
- Three difficulty levels: easy, medium, and hard
- Animated operation selection on the 8x8 LED matrix
- Three multiple-choice answers shown on TM1637 displays
- Button color LEDs can light up immediately when each button is pressed
- Right and wrong feedback using dedicated LEDs
- Right and wrong score tracking on the I2C LCD
- Potentiometer-based difficulty selection
- Browser-based simulation support with Wokwi
- 1 Arduino board
- 1 I2C 16x2 LCD at address
0x27 - 1 8x8 LED matrix using a
LedControl-compatible driver - 5 four-digit TM1637 displays
- 3 answer buttons
- 1 reset button
- 1 potentiometer
- 2 feedback LEDs
- 3 button indicator LEDs (or illuminated button LEDs)
- 1 protoboard module / protoshield module for wiring integration
- No external resistors for the answer/reset buttons (
INPUT_PULLUPis used)
Configuration defined in the sketch:
- 8x8 matrix
DIN: pin7CLK: pin8CS: pin9
- TM1637 displays
- Shared DIO: pin
10 - CLK display 1: pin
2 - CLK display 2: pin
3 - CLK display 3: pin
4 - CLK display 4: pin
5 - CLK display 5: pin
6
- Shared DIO: pin
- Answer buttons
- Button 1:
A1 - Button 2:
A2 - Button 3:
A3
- Button 1:
- Reset button: pin
11 - Right LED: pin
12 - Wrong LED: pin
13 - Potentiometer:
A0
Optional feedback module on wrong answer output:
- You can connect an active buzzer module (bip) or a vibracall vibration module together with the wrong LED signal on pin
13(using the module input +GND) for audible or haptic feedback.
Construction and enclosure variants:
- Main build version in MDF
- Second build version in acrylic
Important wiring update:
- Answer and reset buttons now use
INPUT_PULLUP - Pressed state is
LOW - Each button must be wired between input pin and
GND - External 10k pull-down resistors are no longer required for these buttons
- The potentiometer sets the current difficulty level.
- The system selects an operation and animates it on the 8x8 matrix.
- Two displays show the operands.
- Three displays show the answer options.
- The player presses one of the three answer buttons.
- The system updates the score and shows right or wrong feedback.
- The reset button clears the score and restarts the cycle.
The generated values change according to the selected level:
- Easy: smaller values and a higher chance of simpler calculations
- Medium: wider ranges and a more balanced mix of operations
- Hard: larger values and a stronger weighting towards multiplication and division
Decimal behaviour by sketch variant:
- Decimal variant (
maths-quiz-game-en-gb.inoandmaths-quiz-game-pt-br.ino):- Easy: 10% of rounds may include decimal operands/results
- Medium: 20%
- Hard: 30%
- Integer-only variant (
maths-quiz-game-en-gb-integers.inoandmaths-quiz-game-pt-br-integers.ino):- No decimal operands
- No decimal results
- Division is generated to keep integer results
Libraries used by the sketch:
TM1637DisplayLiquidCrystal_I2CLedControl
Libraries included in the repository:
arduino/libraries/TM1637arduino/libraries/LiquidCrystal_I2Carduino/libraries/LedControl
Reference image:
arduino/
|-- libraries/
| |-- LedControl/
| |-- LiquidCrystal_I2C/
| |-- TM1637/
| `-- libraries.png
|-- maths-quiz-game-en-gb/
| `-- maths-quiz-game-en-gb.ino
|-- maths-quiz-game-en-gb-integers/
| `-- maths-quiz-game-en-gb-integers.ino
|-- maths-quiz-game-pt-br/
| `-- maths-quiz-game-pt-br.ino
`-- maths-quiz-game-pt-br-integers/
`-- maths-quiz-game-pt-br-integers.ino
assets/
`-- media/
|-- acrylic-front.png
|-- acrylic-rear-wiring.png
|-- arduino-protoshield.png
|-- maths-quiz-game-cover.png
|-- assembly-front.jpg
|-- assembly-top.jpg
|-- demonstration.gif
|-- demonstration.mp4
`-- protoshield-close.png
design/
`-- vector/
|-- maths-box.ai
`-- maths-box-v8.ai
docs/
|-- github-sponsors-kit.md
|-- project-tutorial.docx
|-- release-v1.0.0.md
`-- release-v1.1.0.md
hardware/
`-- electronics/
|-- maths-quiz-game.pdf
|-- maths-quiz-game.psd
`-- supporting files
simulation/
|-- diagram.json
|-- libraries.txt
|-- wokwi.png
`-- wokwi-project.txt
tutorial/
|-- Arduino/
| |-- libraries/
| `-- MPA-Matematica/
|-- Eletrônica/
|-- Vetor/
|-- README.md
`-- Tutorial.docx
- Open the Arduino IDE.
- Install the required libraries if needed.
- Open one sketch folder:
arduino/maths-quiz-game-en-gb/orarduino/maths-quiz-game-en-gb-integers/orarduino/maths-quiz-game-pt-br/orarduino/maths-quiz-game-pt-br-integers/
- Connect the Arduino board.
- Compile and upload the sketch.
You can start from the Arduino Uno template:
https://wokwi.com/projects/new/arduino-uno
Recommended setup:
- Create a new Arduino Uno project in Wokwi.
- Replace the default
sketch.inoby copying code from one of:arduino/maths-quiz-game-en-gb/maths-quiz-game-en-gb.inoarduino/maths-quiz-game-en-gb-integers/maths-quiz-game-en-gb-integers.inoarduino/maths-quiz-game-pt-br/maths-quiz-game-pt-br.inoarduino/maths-quiz-game-pt-br-integers/maths-quiz-game-pt-br-integers.ino
- Replace the default
diagram.jsonwithsimulation/diagram.json. - Replace or create
libraries.txtusingsimulation/libraries.txt. - Confirm that
TM1637Display,LiquidCrystal_I2C, andLedControlare available in the project. - Start the simulation.
Notes:
- The LCD address used by this project is
0x27. - All local Wokwi files are stored in
simulation/. simulation/wokwi-project.txtstores the Wokwi project link or reference details.- If a required library is missing, the simulation will not compile.
The repository also includes:
- electronics files in
hardware/electronics - vector design files in
design/vector - a project tutorial document in
docs/project-tutorial.docx - a sponsor support kit in
docs/github-sponsors-kit.md - the original initial project in
tutorial/, kept as version zero (v0) and reorganized with its owntutorial/README.md - a historical tutorial document in
tutorial/Tutorial.docx - prototype photos and media in
assets/media - complete Wokwi simulation files in
simulation
- This project is released under the MIT License. See
LICENSE. - The repository combines source code, design assets, electronics documentation, and simulation files in one place.
- The file
hardware/electronics/maths-quiz-game.txtappears to use inconsistent encoding and was not treated as a primary documentation source.
If this project helps you, consider sponsoring ongoing development:
- GitHub Sponsors:
https://github.com/sponsors/DegsTerin









