Arduino Reaction Tester
by Progetto Company in Circuits > Arduino
603 Views, 0 Favorites, 0 Comments
Arduino Reaction Tester
DISCLAIMER: CERTAIN COMPONENTS USED IN THIS TUTORIAL ARE FOR SALE BY THE AUTHOR
During this tutorial, you'll create an Arduino-based reaction tester, which measures the user's reaction time by randomly activating an LED, starting a timer and then displaying the value of the timer when the user pushes the button. Be sure to see the video above for a demo!
Supplies
To build this reaction tester, you'll need:
- An Arduino microcontroller of some flavour, preferably with a 5V operating voltage as the 16x2 I2C LCD is a 5V component, though it can be adapted using a logic level converter like this one: https://www.tindie.com/products/Progetto/4-channe...
- An assortment of male to male and male to female jumper wires, we used 4 of each
- A breadboard (any of the 3 most common sizes will do)
- An I2C 16x2 LCD like this: https://www.tindie.com/products/Progetto/16x2-lcd... (either colour will work, though I used the green version with black text)
- Optional (You can also use the Arduino's onboard LED): A 5V LED (we used a red one)
- Optional (See above): A 1/4 Watt, 220 ohm resistor (Band order: red, red, brown, then a gold or silver)
- A pushbutton
- A 1/4 Watt, 10K ohm resistor (Band order: brown, black, orange, then a gold or silver)
Familiarize Yourself With the Components
This tutorial also assumes you have followed this amazing tutorial by Last Minute Engineers https://lastminuteengineers.com/i2c-lcd-arduino-tutorial/ so you know your LCD's I2C address and can wire it to your Arduino.
Wiring
Having followed the tutorial in the previous step, your LCD should already be wired correctly. For the LED and button wiring, consult the wiring diagram above. As for power, this project runs fine powered through the Arduino's onboard USB port.
Upload the Code
Get the project's code from here: https://github.com/ProgettoCompany/Arduino_Reaction_Tester
If the LCD isn't working:
Double-check your wiring, your LCD's I2C address and that you've adjusted the contrast of the display correctly.
Conclusion
Congratulations, you have created your own reaction tester using an Arduino! Feel free to remix and improve this project to your heart's content, maybe add a case, battery power, a larger LED (speaking of which, we just added a 3W LED to our product line: https://www.tindie.com/products/Progetto/3w-white-led-module/) or a larger, more tactile button (maybe use a button with an LED in it)!
If you have any questions, comments or concerns, feel free to email me at progettocompany@gmail.com
Happy hacking!
John Wolf
Progetto Company
P.S. If you made it this far, the reaction time tester has some vulnerabilities that can be exploited to make your reaction time appear lower. For example, you can hold down the button after starting the test to get a reaction time of zero (to fix this, you could use a boolean to ensure that the button was released i.e. digitalRead(BUTTON_PIN) == LOW before starting the test). Also, nothing is stopping you from just repeatedly pressing the button after the test starts (to fix this, you could restart the test if the button has been pressed before the test has started, but to check that you have to use millis instead of delay for turning on the LED). Whether you exploit it or fix it, I hope you have fun!