Skip to main content
Version: FILS English

Reaction Timer Game

Description

The project is an advanced reaction timer game built on a Raspberry Pi Pico (RP2040) microcontroller. The device uses visual stimuli (an LED) and mechanical user input (push buttons) to evaluate how quickly a user can respond. The system runs a structured "Best of 3" game format where it measures reaction times across randomized delay periods, calculates the average performance score in real time, and actively monitors for premature responses (false starts). All menus, session data, and statistical feedback are provided visually through an OLED display.

Motivation

I chose this project in order to explore embedded systems through a highly interactive application focused on precise timing and state management. It combines real-time hardware input processing with microsecond-level hardware timers to accurately measure human reflexes. This makes it both a rigorous technical exercise in building a responsive, non-blocking state machine in Rust, and a practical, engaging tool for measuring reaction speed under varying conditions.

Architecture

The core of the system is the Raspberry Pi Pico. It acts as the central control unit, managing the application state machine (Menu > Game > Results).

  • Visual Output: An OLED display connected via I2C/SPI provides the user interface, while a discrete LED serves as the primary reaction stimulus.
  • User Input: Two tactile push buttons are used to handle menu navigation and capture the exact moment of the user's physical response.
  • Timing & Logic: The internal random number generator creates unpredictable delays, and the hardware timers calculate the delta between the LED illuminating and the button press.

Log

Week 30 March - 5 April Explored multiple project ideas and decided on the concept for the reaction timer game.

Week 13 - 19 April Researched the necessary components, defined the project scope, and finalized the hardware bill of materials.

Week 20 - 26 April Drafted the initial project documentation, set up the repository, and planned the software architecture.

Hardware

The system uses a Raspberry Pi Pico (RP2040) development board as the main microcontroller. Visual feedback is provided by an SSD1306 OLED display and a standard 5mm LED. User interaction is handled through two momentary push buttons. The system is powered via the Pico's USB connection and assembled on a standard prototyping breadboard using jumper wires.

Schematics

Work in progress..
Place your KiCAD or similar schematics here in SVG format.

Bill of Materials

Hardware

DeviceUsagePrice
Raspberry Pi PicoThe microcontroller~30.00 RON
OLED DisplayDisplay - menu and statistical feedback~25.00 RON
Push buttons (x2)User input - menu control and reaction response~4.00 RON
Standard LEDVisual stimulus~1.00 RON
Resistor KitCircuit protection~15.00 RON
Breadboard & WiresPrototyping and connections~15.00 RON

Software

LibraryDescriptionUsage
rp2040-halHardware abstraction layer for RP2040Used for configuring peripherals (GPIO, Timers, I2C/SPI)
cortex-m-rtRuntime supportInitializes the microcontroller and defines the entry point
embedded-halHardware abstraction traitsProvides standard interfaces for interacting with the LED and buttons
ssd1306Display driverUsed to send initialization commands and data to the OLED screen
embedded-graphics2D graphics libraryUsed for drawing the UI text and shapes to the display
randRandom number generatorUsed to create the unpredictable delay for the visual stimulus