This is an old revision of the document!
What is the project?
The project represents Formula 1 reaction game that requires 2 players. It contains a series of leds (each player has 3 leds), each one with a coresponding button. Players must press the correct button as soon as its leed lights up to earn points. After a certain time, the winner will be the player with the most points.
Functionalities of the game:
- Random selection of the leds
- Input detection (Button pressing)
- Scoring (points for each button pressed corectly)
- Global timer (the players have 3 selections for the timer: 15 seconds, 30 seconds, 60 seconds)
- Statistics (it will be calculate the median time for each player to press the button after the game)
- Theme song (there will be a buzzer that sings)
What is the purpose of the project?
For me, the purpose of this project is to create a real-world device from nothing. This project is interesting because it helps me understand better how the hardware components and the software connects.
What was the idea that got you started?
So I am a big fan of Formula 1 and I thought what i can do about this topic. I remembered that I played a version of the game that I want to implement in a museum, but it was in singleplayer mode. I thought it will be fun to have a version of the game that was multiplayer.
Why do you think this project is useful for others and for you?
Just like a Formula 1 driver reacting to track signals, this game challenges you to press the right button the second the led is up (which will improve your reflexes). In addition, it creates a lot of fun with your friends because of the multiplayer mode.
The block diagram for this project is:
How the game will be played?
1. First the players will choose the time of the game. (there will be 3 options: 15 seconds, 30 seconds, 60 seconds)
2. The game waits for the players to write their name and send it to the microcontroller via uart.
3. For each player, one random led will light up, and the player need to pressed the correct button for the led to go out. At this process will be repeated as long as the timer is bigger than zero. For each correct button pressed the player will get one point.
4. After the time runs out, the winner will be the player with the most points.
5. After the winner is being written on the lcd, the microcontroller will send via uart the average reaction time for each player.
While the game is being played, the theme song from Formula 1 will play in the background.
The list of components:
| Components | Number of pieces | Protocol |
|---|---|---|
| Atmega328P | 1 | USB |
| Potentiometer | 1 | ADC |
| LCD 1602 2×16 | 1 | I2C |
| Leds | 6 ( 3 for each player) | GPIO |
| Buttons | 6 ( 3 for each player) | ADC |
| Buzzer | 1 | PWM |
The detailed structure of the components (their role and how they are connected to the board):
1. ATmega328P
2. Potentiometer
| PIN | Connected |
|---|---|
| 1 | VCC (5V) |
| 2 | PC2 (A2) |
| 3 | GND |
I connected the second pin to the PC2, because I need to read the analog values that the potentiometer gives me as input. That values I am gonna place it in intervals to design the time of the game.
3. LCD 1602 2×16
| PIN | Connected |
|---|---|
| 1 (VCC) | VCC (board) |
| 2 (GND) | GND (board) |
| 3 (SCL) | SCL (PC5) |
| 4 (SDA) | SDA (PC4) |
4. Leds
| LED | PIN |
|---|---|
| 1 | PD7 |
| 2 | PD6 |
| 3 | PD5 |
| 4 | PD4 |
| 5 | PD2 |
| 6 | PD1 |
I choose this pins on the board, because I need digital pins for the leds.
5. Buttons
This is the electrical scheme for how the buttons and the resistors is being connected.
I will need a pull-down resistor for the input to read 0 when no button is being pressed.
For pins I will use 2 analog pins (PC0 for player 1 and PC1 for player 2).
6. Buzzer
This is the electric scheme of my project, that represent the connections that I detailed in the structure of the components.
The element that is new to this game is the multiplayer mode. Initially the game was a training method for the formula 1 drivers and of course was singleplayer. Because it will be a multiplayer game, will be fun to play with friends and train your reflexes.
Project | - i2c.c | - i2c.h | - adc.c | - adc.h | - timers.c | - timers.h | - usart.c | - usart.h | - utils.c | - utils.h | - main.c
3 May 2026: Adding the introduction and the general description.
4 May 2026: Adding the block diagram.
11 May 2026: Complete the hardware design.