In this instructable, i will be showing you how to create a drag race reaction time trainer. With everything complete, you will be able to use a button to cycle through all the lights and get a reaction time. The top two yellow leds will represent the staging lights (letting you know that you are ready to race). The next three yellow leds will be the countdown lighting up one by one. If you press the button after the last yellow led, the green led will glow and the lcd will display your reaction time. If the button is pressed before the last yellow led is finished blinking, the red led will glow, and display your reaction time.
Step 1: Parts List
For this drag race reaction time simulator you will need the following parts:
1. 7 LEDS (5 yellow) (1 green) (1 red)
2. LCD to display the reaction time
3. 1 Potentiometer
4. 1 Button
5. Arduino micro controller
6. Bread board and wires to test everything
7. 8 220 ohm resistors
Step 2: Set Up Potentiometer and LCD
start by placing a potentiometer on the bread board. Connect a red wire from the positive end to the positive rail on the bread board. Run a black wire from the negative end of the potentiometer to the ground rail of the bread board.
Next run a yellow wire from the middle pin of the potentiometer to the LCD. Follow the diagram to see which port to connect to.
For the next step hook up the remaining pins on the lcd to the appropriate ports on the arduino. Follow the diagram to ensure the correct ports are chosen.
Be sure to run a positive and negative wire from the 5v and GND on the arduino to the bread board.
Step 3: Place LEDs
start by placing the leds in a similar pattern to the diagram.
The first two yellow lights will indicate the staging lights.
the next 3 yellow leds will indicate the countdown before the button is pressed.
the last two leds will indicate if the button was pressed at the correct time (red or green).
place 220 ohm resistors next to all 7 positive leads of the leds.
connect two red wires from the positive leads of the first two yellow leds and connect them to the A3 and A2 ports of the arduino. Be sure to ground the negative leads of the leds to the ground on the bread board.
connect red wires from the positive leads of the next 3 yellow leds to number 8, 9, and 10 ports of the arduino.
connect a wire from the positive lead of the green led to the A4 port of the arduino.
lastly, connect a wire from the positive lead of the red led to the A5 port of the arduino.
Again, be sure to connect all grounds of the leds to the ground rail of the bread board.
Step 4: Install Button
For this last step you will be connecting the button used to start and stop the timer.
Place the button on the bread board.
on one side, connect a 220 ohm resistor to the ground rail.(choose any pin)
to the right of the ground pin, place a red wire from one end to the positive rail.
Directly across from the ground pin,place a blue wire and connect it to the number 7 port of the arduino.
Step 5: Code
After all components are installed, download the code to your arduino software. Once the code is uploaded the program will run once to ensure the leds are installed properly. To start the cycle, simply press the button once and the two staging lights will turn on. After a few seconds the countdown lights will start and record your reaction time. In the code, there is a variable to compensate for lag in drive train of a vehicle. this gives the simulation a better feel for the speed of a button press.