Reaction Time Test

Test your reflexes with this interactive reaction time game! LEDs light up in sequence using a 4017 chip, and you must press a button as fast as possible. The game records your time, shows it on an OLED screen, and waits for a touch sensor before each new round.
_______________________________________________________________________________________________
Example Serial Output
Setup complete.
Displayed start screen, waiting for touch sensor...
---------------------
Touch detected! Starting game...
Countdown: 3
Countdown: 2
Countdown: 1
GO!
Round 1 - LED 3 ON
Displaying Round 1 | LED 3 ON
Waiting for button press...
Button input received. Time: 412 ms
---------------------
Waiting for touch sensor to continue...
Touch detected, continuing...
...
Game Over!
Round 1 time: 412 ms
Round 2 time: 398 ms
Round 3 time: 420 ms
Round 4 time: 377 ms
Round 5 time: 389 ms
Average Time: 399 ms
---------------------
Supplies



Arduino Uno/Nano, Any compatible board will work
4017 Decade Counter IC, Controls LED sequence - 1
SSD1306 OLED (128x32, I2C) - 1
LEDs - 4, Any color
White LED - 1
220Ω Resistors - 4, For each LED
Push Button 4, For user response input
Touch Sensor (e.g., TTP223) - 2, Starts and continues rounds
10kΩ Resistor - 4
Breadboard - 1
Buzzer - 1
NPN Transistor - 1
PNP Transistor - 1
Wire, Any Color
Building the Circuit


Connect the 4017 Decade Counter
- Place the 4017 IC in the middle of the breadboard so each pin has room to connect.
- Connect pin 8 of the 4017 to GND.
- Connect pin 16 of the 4017 to 5V.
- Connect pin 14 (clock input) of the 4017 to Arduino pin 10.
- Connect pin 15 (reset) of the 4017 to Arduino pin 9.
- Connect LEDs to the following output pins on the 4017:
- LED 1: 4017 pin 3 (Q0) → 220Ω resistor → LED → GND
- LED 2: 4017 pin 2 (Q1) → 220Ω resistor → LED → GND
- LED 3: 4017 pin 4 (Q2) → 220Ω resistor → LED → GND
- LED 4: 4017 pin 7 (Q3) → 220Ω resistor → LED → GND
Connect the OLED Display
This OLED uses I2C, so only 4 pins are used.
- Connect VCC of the OLED to 5V on the Arduino.
- Connect GND of the OLED to GND on the Arduino.
- Connect SDA of the OLED to A4 on the Arduino.
- Connect SCL of the OLED to A5 on the Arduino.
Connect the Push Button
- Connect one leg of the button to Arduino pin 12.
- Connect the same leg to GND using a 10kΩ resistor (pull-down resistor).
- Connect the opposite leg of the button to 5V.
Connect the Touch Sensor
- Connect VCC of the touch sensor to 5V on the Arduino.
- Connect GND of the sensor to GND.
- Connect OUT of the sensor to Arduino pin 7.
Layout
- Use your own custom layout
- Feel Free To Follow The Pictures And Copy My Layout And Circuitry
Power Up and Upload Code
- Plug the Arduino into your computer using a USB cable.
- Open the Arduino IDE.
- Make sure the following libraries are installed:
- Adafruit GFX Library
- Adafruit SSD1306
- Paste the full game code into the IDE.
- Select your board (Uno or Nano) and the correct COM port.
- Click "Upload".
Step 7: Play the Game!
- When you power on the circuit, the OLED will display "Touch Pads to START".
- Touch the capacitive sensor to start the game.
- A 3-second countdown will show on the OLED screen.
- One of the LEDs will turn on randomly.
- Press the button as fast as you can after the LED lights up.
- The OLED and Serial Monitor will display your reaction time.
- After each round, touch the sensor again to continue.
- After 5 rounds, your average time will be shown on the OLED and Serial Monitor.