Introduction: Reaction Time Tester

A month ago I knew nothing about Arduino and now.....my first project!
Looking back, this project combines allmost all of the tutorials that I have read in this short period: blinking LED, push button, piezo and LCD display. A useful project for every beginner!

I have made this device for some of my friends who have a hard time admitting how fast alcohol influences their driving abilities.
It will test you on three levels because they all have to do with driving a car safely:
  • DECISION time. 
  • REACTION time
  • Resistance to DISTRACTION.
The test starts as soon as you hold down the push button. When a red light appears, you should let go off the push button as soon as possible. Your reaction time will appear on the screen.
However, driving has to do with making fast decisions as well. So in random order you can get a green or blue light first (or multiples). You should not react to this and hold down the push button until the red light appears.
Finally, on occasions you will hear a short beep in between lights (just for fun). By now you are so tense to do well, that a simple distraction like a beep can and WILL set you off!! 

A fun game with your dinner guests upon arrival and confronting upon leaving!



Step 1: What You Need

  1. Arduino microcontroller (I have used an Uno).
  2. 1 RGB LED (you can use 3 separate ones if you like).
  3. 4 resistors (220 ohm).
  4. LCD Display
  5. Piezo speaker
  6. Breadboard.
  7. Push button.
  8. Wires.
  9. Ping pong ball (optional).
  10. Box.

Step 2: The Hardware.

For the experienced Arduino user this total view makes immediate sense. However, if you're a beginner just like me, a breakdown in steps can be useful.

Drawings were made with software by "Fritzing" (http://fritzing.org).

I have used a RGB Led with a common Anode (3 Cathodes: R, G, B). Therefore the setup may seem a bit ackward. The consequence is that in the sketch (step 3): HIGH=off and LOW=on.

Step 3: The Sketch.

As bescribed in the Intro, different lights might appear in random order prior to the red light.
To make the test even more unpredictable, I have added two other features:
  1. The duration of a light is random (within some limits).
  2. The pause between lights is random as well (within some limits).
This is to avoid that people get a feel of the "rhythm" of the test. Making it predictable.
You can make the test harder by increasing these intervals. The sketch is in the TEXT file below.

Step 4: The Box.

This is quite straight forward and I never intended to copy the Instructables Robot, but once I was started, I saw some similarities...

Picture 1: Drill the pattern in the bottom of the box (to hold the Arduino in place). Hole size 3 mm.

Picture 2: Drill and cut two holes in the side for the USB connection and power supply (if you do not need to program the controller anymore and you have chosen to use batteries, you don't need this step. The Arduino is kept in place with small bolts (remove it prior to painting!).

Picture 3: Cut a slot in the lit of the box for the LCD. Drill another two holes, one for the LED (ping pong ball) and another one for the push button. Make sure that the hole for the ping pong ball has a sloping face.

Picture 4: Take two caps of a Coke bottle and cut the top section of the bottle as well. Glue the bottle top sections to the side of the box (make sure you have a nice and flat face for the glue).
Sand the box with a fine sand paper.

Picture 5: Apply several layers of paint (without the Coke caps).

Picture 6, 7, 8: install the Arduino. I have used a small breadboard for the components (Piezo and Pot. meter of the LCD). The LED was solderd seperately. Since the Arduino is tightly bolted into place, foam blocks can be installed against it and thus providing a tight fit for the LCD.
I didn't have red, blue and black wires so I used purple, green and grey:

Purple: +
Green: pin
Grey: Gnd 

Comments

author
FancyFish made it! (author)2016-10-07

Fantastic Instructable! Thank you so much, I had fun building this.

I made a few modifications to the hardware (and code as a result), to fit what I had. Its using a LCD which already had an I2C attached and its also using a RGB LED module so I can display a larger selection random colors.

I changed the code to display a countdown before starting, not show red on the first light and to also play a selection of music before the start button is pressed - just because :)

20161007_195354.jpg20161007_195419.jpg20161007_195711.jpg
author
bertus52x11 (author)FancyFish2016-10-09

Nice one! I'm happy that you made one.

I'll send you a patch...just because ;)

author
CamiCy (author)2016-02-27

Hello. I'm making a reaction timer for my biology project, and the design is inspired by your project. I want to be able to time and compare the reaction time between an LED and a sound. I was wondering if you could give me some tips on how to do that because I have never worked with kind of thing before. Thanks

author
bertus52x11 (author)CamiCy2016-02-27

I'm not sure if I understand your question. The reason why there are different lights and beeps is to "throw you off" so you need to watch and listen carefully before releasing the button. Measuring the time between a LED an beep has nothing to do with your reaction time.

author
CamiCy (author)bertus52x112016-02-27

Sorry for the confusion. I know that the sound in your project was used to through people off, but i was wondering if there was a way in which I can program it to make sound and change color at different times in order to log the reaction time to those two variables separately. So, I can test whether or not people react faster to a visual or a sound.
If you don't get what im asking its alright. Like i said I'm new at this stuff, but thank you for replying. I appreciate it.

author
bertus52x11 (author)CamiCy2016-03-01

yes you can, but it requires some slight adaption to the program. In fact you could make two programs and load either one of them into the Arduino without telling the participant. You'll need to register the reaction times depending on the program you use.

author
CamiCy (author)CamiCy2016-02-27

*"throw people off"

author
cliptwings (author)2016-01-26

Really liked this instructable. I was looking for a reaction tester that I could use for a geocache puzzle and this one fit the bill. I modified the code so once a finder logged a reaction time less than 400 milliseconds, a servo opens a compartment to reveal the treasure and log inside. Works great!

author
bertus52x11 (author)cliptwings2016-01-27

Thanks and what a nice idea about locking!
Post an Instructable about it and I'll send you a patch. (help me remind though).

author
geocacher2 made it! (author)2014-05-18

I modified the program to launch a display when the reaction time is less than 200. I loved the instructable. It was easy to follow and understand. I'll add a couple pictures of my final project (outside pics). The inside is a boarduino, and a tiny piezo speaker. I also added a 6 AA battery tray on the bottom, that is accessable on the outside.

PS - I love the ping pong ball diffuser !

IMG_1120 (2).jpgIMG_1124.JPGIMG_1126.JPG
author
jhon153 (author)geocacher22015-11-17

you have programming?

author
bertus52x11 (author)2014-05-19

Nice one! I have just sent you a patch!

author
geocacher2 (author)2014-05-18

Any updates on the programming? I seem to get into a long loop during a blue or green light press. It sometimes just goes blank, instead of displaying the 'too early'.

author
bertus52x11 (author)geocacher22014-05-18

are you sure you've got the coding right? I have never encountered this problem.

author
freeza36 (author)2013-04-09

Awesome man! My grandpa made on of these when I was 6 or 7 and I would play with it for hours.

author
nirzayorza (author)2013-03-13

hello. im interested in your project. do you have the schematic diagram for this? thanks in advance.

author
bertus52x11 (author)nirzayorza2013-03-14

Step 2 shows several diagrams on how to connect the circuit.

author
robot1398 (author)2011-10-12

whats the unit in which it displays the reaction time?

author
bertus52x11 (author)robot13982011-10-12

milliseconds (1/1000th sec).

author
robot1398 (author)bertus52x112011-10-12

ohk! thanks

author
ben_cullen_1809 (author)2011-10-03

hiya pal!! really like the look of this as my uni project! if possible do you have a schematic diagram available??

author

just click on the icons below the picture.

author
freethetech (author)2011-07-14

Hi there. This project looks like an amazing beginning to my work with Arduino (it came in on Monday via mail, and I just bought the USB A to B cable today). There is only one problem - I cannot obtain an LCD Display for some time because all of my local stores are out of stock. Any possible substitutions?

One of my ideas would be to rewrite the code (I know the basics of the code) to round everything to the nearest thousandth (reaction time), and then have it go to a corresponding LED.

author
bertus52x11 (author)freethetech2011-07-26

Sorry for the late reply (holidays). have you tried getting a Display through internet. Shouldn't be too difficult.
You suggestion of rounding off will work. However, you need to really think about how to use the LED, maybe in patterns or even Roman numbers. Otherwise you'll need lots of them!

author
sbertin (author)2011-05-30

what kind of difficulty is this? i haven't done circuitry before

author
bertus52x11 (author)sbertin2011-05-31

I'm far from an electrical engineer and I have done this as my first Arduino project. It's not too difficult. The nice thing about Arduino is that you don't need to know much about circuitry because al the switches or conditional steps are programmed (instead of using transmitters, capacitors....the whole lot).
If you can tell + from - and you can (learn to) program, there is no limit.

author
francisroan (author)2011-03-31

instead of the lcd i updated the code and added Serial.begin and now i can see the time in the serial monitor!!!!!

author
bertus52x11 (author)francisroan2011-03-31

Yes, that's very well possible!

author
francisroan (author)2011-03-31

is that serial lcd?

author
joedibiase (author)2011-03-20

This looks like a fun project. I'm new to this kind of thing and am a bit confused about the LED. The LED only has 4 posts (1 anode and 3 cathodes), but in the step-by-step instructional pictures, it looks like there are more posts seated in the breadboard. Would you be so kind as to clarify?

Thanks much!

author
bertus52x11 (author)joedibiase2011-03-21
Yes, it's fun and it can be confusing (partially my fault). This is what happened:

There are different types of LEDs and I mixed them along the way. I hoped nowbody would notice the inconsistency, but you did!
In the picture of step 2 (with the breadboard), I used a RGB Led with 6 pins:
  • 2 common grounds (you should interconnect them)
  • 1 Red Pin (+5V)
  • 1 Green Pin (+5V)
  • 2 Blue Pin (+5V) you should interconnect these.

You can magnify the picture by clicking on the “i” in the left corner and you’ll see.

Later on I obtained a different LED with 4 pins (instead of 6) and to my own surprise, the system was reversed as well:

  • 1 common Anode (+5V)
  • 1 Green Pin
  • 1 Red pin
  • 1 Blue pin

This is the Led I have used in the reaction Time Tester. Now I went back to step 2 and changed the schemes (Fritzing) accordingly to this new LED. You can see a picture of this Led in step 4 (7th picture).

Hope this helps, if not just let me know.

author
joedibiase (author)bertus52x112011-03-24

Thanks for the explanation! We're almost there, but are having a problem with the LED. We've got everything hooked up, but the LED doesn't come on. Here's what's going on ...

- The display says "Hold button to start"
- We press the button and the display goes blank 
-When we release the button, one of two things happens:
     (1) A reaction time is displayed on the display, or,
     (2) There is a beep and the display reads, "Released too soon"

At no time does the LED blink or come on at all.

You can see the picture I uploaded. I checked current with a multi-meter and got these results. On the picture, the lead connecting to Arduino 8 has current as soon as you press the button, and then periodically has current as long as the button is held. The lead connecting to Arduino 6 has current continually. The lead to Arduino 7 has current as soon as the button is pressed, and then has current periodically while the button is held.

As I mentioned, I'm new at this, so am a little baffled. Any help will be much appreciated. Thanks!

LED pic.jpg
author
bertus52x11 (author)joedibiase2011-03-24

Just a quick one (I'll look into it in more detail this weekend).
How many pins does your push button have? (some types block current when the're pushed, others allow current to flow when pushed). Have you checked this with a multi-meter?

author
joedibiase (author)bertus52x112011-03-24

Thanks so much again. I picked up some different LEDs and they work! Must have been something kludgey with the original LEDs.

This works great ... please know that you've made my daughter's 6th grade science fair project very cool!

author
bertus52x11 (author)joedibiase2011-03-28

Good to hear you solved the problem.
Just one question: if it's the science fair of your daughter, how come Dad is doing all the work? ;-)

author
joedibiase (author)bertus52x112011-03-28

Haha! It might seem like Dad is doing all the work, but my daughter did much more than it would appear. She learned a lot about circuits, the Arduino, soldering, and then, how to test a sample of people (how does talking on a cell phone affect reaction time?), then analyzing the results and drawing a conclusion.

We really appreciate your instructable and your following up on our questions!

author
bertus52x11 (author)joedibiase2011-03-28

Glad I could help. Actually the cell phone test is a very nice one I didn't think of. Some people over here think that driving and phoning do no influence eachother (you just end up doing both things bad!).

From my own experience, I now that the flu has a great impact too.

author
joedibiase (author)bertus52x112011-03-24

The button has 4 pins. When we press the button it blocks current.

Thanks for your help ... it's very nice of you. We're getting nervous about my daughter's science project, so your help is really appreciated.

author
duboisvb (author)2011-03-23

Hello again,
I was looking thru old comments and noticed that you said you would send a patch if I made this and published it and reminded you. . Which I did and was wondering if the offer is still good. :)

Thanks

author
bertus52x11 (author)duboisvb2011-03-23

Done!

author
duboisvb (author)2011-03-10

Hey, I just published an Instructable based on this and I hope I gave you the correct credit . Please advice if I should have done something more . I am new at this. Thanks again.

author
bertus52x11 (author)duboisvb2011-03-10

No need to worry...
And it looks great!

author
duboisvb (author)2011-03-10

Hey again, here is my project
https://www.instructables.com/id/Reaction-Timer/

author
LucasOchoa (author)2011-02-03

just wondering did you get this idea from any kits of any sort and btw are you using parallax or adurnio

author
bertus52x11 (author)LucasOchoa2011-02-03

No not really, although it's not the first and not the last reaction time tester in the world.
It started quite simple with 1 red Led. Then replaced it with a RGB Led and finally added some sound as well.
It corresponds actually quite well with the tutorials I have been reading while learning Arduino (see Intro).

author
LucasOchoa (author)bertus52x112011-02-22

yeh bro any ways really nice instructable

author
janw (author)2011-02-18

Very nice project! I like the casing.

author
bertus52x11 (author)janw2011-02-18

Thanks and congrats to you for reaching the finals!

author
GaryMeow (author)2011-02-06

awesome project :)

author
singhtarandeep15 (author)2011-02-04

What is its use in daily life(practical use)?

About This Instructable

26,681views

76favorites

License:

More by bertus52x11:Stone Ski HelmetThe Selfie Ring a.k.a. the Phone RingWashing Machine Door Salad Bowl.
Add instructable to: