Home › Builds › Reaction-time game

Reaction-time game

Bench build · Embedded (Arduino) · Beginner · about 30 minutes

Times how fast you press after the LED lights; shows your time and your best. Wait for the LED, then hit the button. The sketch picks a random wait of 2–5 s (random() seeded from a floating analog pin), times you with millis() and shows the result and your best on an I²C LCD. Press too early and the buzzer calls it. Most people land between 200 and 300 ms.

Reaction-time game: the finished build running on the simulator's bench

Build it in the labGuided build, test sheet and fault finding, free in your browser.

Parts list

Test procedure

Each test has an expected value and a pass range, like a factory test sheet:

  1. The LED lights
  2. A reaction is timed
  3. An early press is caught
  4. LCD running

How it works

What it does: Times how fast you press after the LED lights; shows your time and your best.

Build it (guided or ready-made), then run its test procedure below. Every test has an expected value and a pass range, just like a factory test sheet.

Things to try

  1. Play five rounds and watch “Best” only ever go down.
  2. Change random(2000, 5000) to random(500, 1500): harder to anticipate, easier to jump the gun.
  3. Measure the sketch itself: millis() counts in 1 ms steps, so a result is ±1 ms. A real Uno is as fast as the code it runs.

Background

Reaction timers go back to 19th-century psychology labs; arcade "Whac-A-Mole" and F1 start lights test the same reflex.

More builds: embedded (arduino)