Leonardo Response Box (Reaction Time)

Hello,

Reaction time experiments are widely used in psychology. For serious use, it's important to have a very accurate measuring device. Standard keyboards are not made with timing accuracy in mind, so psychologists use special 'response boxes', such as this one: Serial Response Box™ | Psychology Software Tools
It's very accurate, but it works only with special software, connects via serial port, needs drivers, and - it's pricey.

I'm guessing the new Leonardo could be made into a nice, accurate reaction time measuring device. The most user-friendly way would be to make leonardo emulate a keyboard, so it could be simply plugged in.
Also, some low-bounce buttons should be used.

So, does someone know lag-times for the leonardo - how much time does it take from pressing a button on the arduino to computer receiving the button-press signal? If it is long - could it be made shorter?
How about low-bounce button designs?

Thank you.

Oh, by the way, RT is usualy measured from stimulus onset (e.g. a picture on the screen) to key press.

Or, if the subject keeps one button pressed and reacts with another button, then there are two times - from stimulus onset to key1_release, and from key1_release to key2_press.

What kind of resolution do you need? 1ms? 0.1ms?

I suspect the most difficult part will be characterizing the latency of the USB comm from PC to arduino. Specifically, how will the arduino know with accuracy when the stimulus was presented. I know USB protocols vary widely in their timing allowances, but not exactly what the leonardo is capable of.

About 1 ms accuracy would be enough.

The arduino does not have to know when the stimulus is pressed.
Software measures the time from stimulus onset until key press on a keyboard, or on the response box (the arduino).

A better idea (more accurate) would be sincronize Arudino and PC clocks and then have the arduino record exact keypress and keyrealease time, and just send a char with a timestamp.

But then I would need a special driver for the device, and special software to use it.

I'd like to keep things simple and just make the arduino emulate a keyboard.

maybe this class can help a bit - http://www.arduino.cc/playground/Code/StopWatchClass -

Why not let the Arduino signal the PC to start the test . Then you can measure timing in micro seconds ==> definitiely in millis().

What's wrong with dropping a meter stick trick? Psychologists can't do math? 8) Just google for a youtube video. It's super easy and costs you nothing.

Psychologists can't do math?

It is more complex. With the invention of the digital calculator many people (not only P.) got worse in math as they delegate their math abilities to a machine / program.

The next ability humankind will loose change is memory (instant fact knowledge). People delegate more and more of their knowledge to the internet. Instead of remembering a fact they remember the pointer to that fact. Broken links will cause amnesia :slight_smile:

I just registered, so I'm very late to this topic. I'm doing much the same thing you are/were working on. Arduino timing precision and accuracy data are presented in the article at http://reactiontimes.files.wordpress.com/2013/02/arduino-rt.pdf. The authors used E-Prime software to create an experiment, present stimuli, and to cue an Arduino to monitor response buttons for a response, record RTs, and then send them back to the E-Prime program for data logging. E-Prime is pricey, though I have an early version that works with Arduino. I plan to see if the open source PsychoPy can do the same thing, but I haven't gotten into that yet. Good luck to you.

looks like a very interesting PDF.

Long ago I participated in a psy-experiments and we found that VGA screens (60Hz) added on average almost 10 milliseconds to human reaction time. Also the standard deviation increased. Lesson learned was that you need to understand the working of the used equipment in detail to interpret / give meaning to the measured data.
Other example is a standard keyboard scanned at a certain frequency by the PC. For text editing this is fast enough, for reaction time measurements it isn't.

I used to employ direct shutter-controlled presentations of stimuli (with a tachistoscope) in reaction time experiments instead of computer monitors because of the lag created by the monitor scan that you refer to. E-Prime and PsychoPy software get around the lag problem by synchronizing stimulus presentations with the onset of a screen scan cycle. However, that limits stimulus exposure durations to some multiple of the time for a screen scan (around 14 to 16 msec usually). The big advantage of using the computer is the endless versatility and ease of stimulus creation (audio, video, etc.). Also, the response boxes referred to in the original post eliminate most of the lag from using keyboards for responses. The Arduino is simply a much more affordable way to make a response box.