Reaction Trainer

by jasminehsieh5288 in Circuits > Arduino

11 Views, 0 Favorites, 0 Comments

Reaction Trainer

螢幕擷取畫面 2025-04-26 133242.png
Arduino project

This is a simple yet highly practical Arduino-based Reaction Trainer. It uses LED indicators and a button for interaction, aiming to help users train reaction speed and evaluate their score. The system can function as a mini game device or as a hands-on teaching tool for learning digital logic and sensor interaction. It's great for classroom demonstrations, student competitions, or just for fun.


Function Overview:

🔹 1. Randomized Start Light

Before each round begins, the system waits for a random duration (between 2 to 5 seconds). Then, the LED turns on, signaling that the user should prepare to react.

🔹 2. Reaction Button Test

Once the indicator LED lights up, the user must press the button as quickly as possible. The system measures the time from when the light turns on to when the button is pressed—this is your reaction time.

🔹 3. Speed Evaluation & Scoring

Reaction time under 2 seconds: The system considers it a quick reaction, flashes a specific LED, and adds 1 point to your score.

Reaction time over 2 seconds: The system considers it too slow, flashes a different LED rapidly as a warning, and deducts 3 points, but the score will never go below zero.

🔹 4. Score Display (LED)

The current score is shown using a score LED, which blinks a number of times equal to the score, with 0.5-second intervals. For example, a score of 3 will cause the LED to blink 3 times.

🔹 5. Reset Score via Long Press

If the user wants to reset their score, they simply hold the button for more than 2 seconds. The system detects this long press and automatically resets the score to zero, with confirmation shown through the serial monitor and the score LED.


Supplies

  1. Arduino UNO (or compatible board)
  2. Breadboard
  3. 1 × Pushbutton
  4. 4 × LEDs (Start, Fast reaction, Slow reaction, Score display)
  5. 4 × 220Ω resistors (for LEDs)
  6. Jumper wires
  7. USB cable (for programming)

Wire the Components

Button:

  1. One side to pin 3
  2. Other side to GND
  3. Use INPUT_PULLUP in code

LEDs:

  1. Start LED → pin 13
  2. Fast LED → pin 12
  3. Slow LED → pin 11
  4. Score LED → pin 2
  5. Each LED's anode (long leg) connects to Arduino pin via a resistor, cathode to GND

Write or Upload the Code

  1. Open Arduino IDE
  2. Copy and paste the full program (I can send it again if needed)
  3. Click Verify to check for errors
  4. Connect Arduino and Upload the code

Test the System

  1. Observe that the Start LED turns on after a random delay
  2. Press the button quickly to score points
  3. Press slowly to lose points
  4. Hold the button for >2 seconds to reset the score
  5. Watch the score displayed by LED flashes