Introduction: Single-player Reaction Timer (with Arduino)
In this project, you will build a reaction timer that is powered by an Arduino. It works on an Arduino's millis() function where the processor records the time since the program started running. You can use it to find the time difference between when the light turns of and the button is released. All values are given in milliseconds.
In the game, you will have to hold the button after which the LED will turn on. You will then have to release the button once the LED turns off. If you release it too early than a "Released too early" text appears on the LCD. The time you took to release the button, your reaction time, is shown on the LCD display.
Please note that the image does not show all the components required for the project
1) 1 x Arduino nano/Arduino Uno + Connecting cable
2) 5cm x 5cm Perfboard
3) 20 x jumper cables or wires
4) 1 x 16x2 LCD screen (Optional)
5) 1 x 100K or 250K potentiometer
6) 1 x 9V battery + connector clip
7) 1 x 5mm LED
8) 1 x PTM momentary switch
9) 1 x 3V or 5V buzzer
Most items can be purchased off amazon. There are a couple of electronics kits on amazon which provide you with all of the basic components such as resistors, diodes, transistors, etc. The one I have found to give me a bang for my buck is available on this link.
I personally had most of the components already as I do a lot of these types of projects. For the inventors out there in Singapore, Sim Lim Tower is the place to go to purchase all electronic components. I recommend Space electronics, Continental electronics, or Hamilton electronics on the 3rd floor.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Planning and Understanding the Circuitry
The majority of the work is done by the code in the Arduino. Apart from an LED, buzzer, and PTM switch, there aren't many standard electronics components. Nevertheless, it is still crucial to be able to understand the circuit.
1) One end of the PTM switch is connected to +5V while the other is connected to an Arduino pin. The arduino pin is also connected to ground using a 10K ohm pull-down resistor. This prevents any floating voltage from affecting the pin's state.
2) The LED's anode is directly connected to the arduino. It is not necessary to have a transistor to boost the voltage to the LED. the Arduino provides a sufficient amount of current to power the LED. The LED's cathode is connected to ground.
3) Finally, the same process occurs with the buzzer but for a different Arduino pin.
4) The connections between the LCD and arduino are highlighted in the schematics and fritzing models.
Step 2: Circuit Schematics and Construction
There are a couple of options on how to put together the circuit.
1) For people getting into electronics, I would recommend using the breadboard to build the circuit. It is a lot less messy than soldering, and it will be easier to debug because the wires can be adjusted easily. Follow the connections shown on the fritzing images.
2) For more experienced individuals, try out using soldering the circuit onto the breadboard. It will be more permanent and last longer. Read and follow the schematic for guidance.
3) Finally, you can also order a pre-made PCB from SEEED. All you would have to do it solder the components on. The necessary Gerber file is attached in the step. Here is a link to a google drive folder with the zipped Gerber file: https://drive.google.com/open?id=1GPPqZ80FbGfSClWKgRTaWBQhrHUY2TMB
Step 3: Arduino Code
The code is the challenge aspect of this project. A lot has to be done with a single void loop and navigating through all the while and for loops within can take some time.
The code has some comments to help you follow along. You can download it and upload it to the Arduino using a USB to mini USB cable. You would need the Arduino app on your computer for that and you will be able to find the download link for it from this website: https://www.arduino.cc/en/Main/Software
Step 4: Housing for the Circuitry
1) You can any old plastic case for its casing. Using a hot knife to cut out the slots for the LCD and button.
2) Additionally, you can check out my account for another instructable where I describe how to build a box out of laser cut acrylic. You will be able to find an SVG file for the laser cutter. Alternatively, for people who don't have access to a laser cutter, you can find another instructable detailing how to build a box out of spare pieces of timber
3) Finally, you can just leave the circuit without a casing. It will be easy to repair and modify.