Pages: [1]   Go Down
Author Topic: Leonardo Response Box (Reaction Time)  (Read 5641 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://www.pstnet.com/hardware.cfm?ID=102
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 211
Posts: 13471
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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().

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 211
Posts: 13471
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 smiley
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 211
Posts: 13471
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: