Human psychophysics using Arduino

This is an example of what can be done with an arduino and python code running on a computer.

In this specific case, a version of Posner’s test using exogenous cues.

Due to time limitations, I refer the installation of the Arduino, Python and its necessary libraries (in this case I think only pySerial is needed as extra) to other sources (arduino, python, and pySerial).

Hardware:

Arduino UNO (other versions can be used, depending on the demand)

5 LEDs

5 220 Ohms resistors

1 push button

1 10 kOhms resistor

the schematics on how to connect all together can be found here.

Software:

One script running on the arduino IDE

One python script (written in version 2.7) running on the PC/raspberry Pi

Overall explanation:

The script running on the arduino IDE, which controls LEDs, used as fixation point, exogenous cues and targets and monitors a button press. The script controls the task and sends via serial port some data: trial number, if the trial was aborted or not (due to improper button press), LED cue side, delay between onset of fixation point and onset of cue, LED target side, delay between cue LED offset and target LED onset and reaction time (delay between target LED onset and button press).

A python script running on the computer which creates a folder and a file with the subjects name and opens the serial port to record the data being sent from the arduino. The data read is stored as readable strings in a text file.

Afterwards, the files can be read in your favorite programming language/data analyses software for further analyses (I intend to put some code for data analyses of this task as well).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: