Reaction time science fair project with an Arduino (real data, no kit)
- 192parts on the bench
- 25boards running now
- 1.00xreal time, on every board
Most simulator experiments measure the simulator. This one measures you. The circuit above is an Arduino Uno with a lamp and a button. After a random wait of 1.5 to 4 seconds the lamp lights, you click the button as fast as you can, and the board prints how many milliseconds you took. The person clicking is real, so the reaction times are real data.
This page walks through the whole project: the question, the variables, the procedure, how to collect and graph the data, and what to say about the limits of your setup. It uses one example question, whether your dominant hand is faster. Any of the reaction time ideas on the science fair ideas page works the same way.
Question, hypothesis and variables
Question: Is my reaction time faster with my dominant hand than with my other hand?
Hypothesis: If I press the button with my dominant hand, then my mean reaction time will be shorter than with my non-dominant hand, because I use that hand more for fine, quick movements.
Independent variable: the hand used. Dependent variable: reaction time in milliseconds. Controlled variables: the same computer, mouse or trackpad, the same chair and screen distance, the same time of day, no music, and the same number of trials for each hand.
Procedure
Open the circuit and press Run. Check the speed readout in the header says 1.00x, which means the simulation is keeping pace with real time. If it drops below that, close other tabs and programs, because a slow simulation stretches the milliseconds you are measuring.
Do five practice trials that you do not record. Then do 20 trials with one hand, rest for two minutes, and do 20 with the other. Alternate which hand goes first on different days. Press only when the lamp lights: pressing early prints "too soon" and the buzzer growls. Leave false starts out of your data, but count them, because the number of false starts is a result too.
Repeat the whole session on three different days. Three days of 20 trials per hand gives you 60 data points per condition, which is enough to see a real difference if there is one.
Collect the data
Every good trial prints one line to the serial monitor, such as "reaction: 251 ms". To get them all into a spreadsheet, open the Plot tab. It picks the number out of each line and graphs it, and its download button saves every point as a CSV file you can open in Google Sheets or Excel. You can also select the lines in the serial monitor and paste them.
In the spreadsheet, use one column per condition. Calculate the mean, the median and the standard deviation for each. The median matters because one distracted trial of 900 ms pulls the mean up a lot and the median hardly at all.
Graph it with a bar chart of the two means with error bars of one standard deviation, or a box plot if your spreadsheet makes them. Write the number of trials under the graph.
How the timer works
The sketch waits a random time, watching the button the whole time so it can catch a false start. Then it lights the lamp, records millis(), waits for the button and subtracts. Here is the heart of it.
digitalWrite(LAMP, HIGH);
unsigned long lit = millis();
while (!pressed()) delay(1);
unsigned long took = millis() - lit;
digitalWrite(LAMP, LOW);
Serial.print("reaction: ");
Serial.print(took);
Serial.println(" ms");Limits to write about honestly
Your measured time includes more than your nerves and muscles. It includes the time for your screen to show the lamp, for your mouse click to reach the browser, and for the browser to hand it to the simulation. Those delays are roughly the same on every trial on the same computer, so they cancel out when you compare two conditions. They do not cancel when you compare your numbers with published reaction times or with a friend on a different computer. Say so in your conclusion.
The random waits come from random(), which gives the same sequence each time you press Run. Within a session the waits still vary between 1.5 and 4 seconds, so you cannot predict them, but keep one session to one run rather than restarting between trials.
Building it for real: an Uno, a 220 ohm resistor and an LED on pin 9, a pushbutton from pin 2 to ground, and optionally an active buzzer on pin 8 and a passive piezo on pin 7. The sketch is the same. On real hardware the screen delay goes away, which is a good extension: compare the two setups.
Testing other people
This project measures people, so it is human participant research, even if the only person you test is yourself. At fairs affiliated with Regeneron ISEF, that needs approval from an Institutional Review Board before you recruit anyone or collect any data, plus informed consent from anyone else you test. Ask your teacher how your fair handles this before you start. Regeneron ISEF 2027 runs May 8 to 14, 2027, in Los Angeles, and every affiliated fair before it follows the same rules.
Questions
Is reaction time measured in the simulator real data?
Yes, the person pressing the button is real. The number also includes your screen and mouse delay, which is about the same on every trial on one computer. That makes comparisons between conditions fair, but absolute values will read a little slower than a hardware timer.
How many trials do I need?
At least 20 per condition per session, over more than one day. More trials make a small difference easier to trust. Report how many you did.
Do I need IRB approval?
Yes, if your fair is ISEF-affiliated, even if you only test yourself. Get approval before you start, and check your own fair’s rules with your teacher.
Build this for real
Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.