Using the BBTK 1-10 button advanced USB response pad with timer, light sensor & voice key: Worked example

Nearly all researchers could benefit by collecting timing measurements that are known to be millisecond accurate by being independently timestamped by the T-Pad, e.g. neuroscientists, cognitive psychologists, vision researchers etc.

Remember that millisecond precision simply means that timings are shown in units of a millisecond not that they are accurate. Precision, or lots of numbers after a decimal point, does not guarantee that stimulus images and responses were presented and measured with millisecond accuracy. Simply, stimuli and responses may not be accurately recorded as having occurred at a given point in time.

The independent sub-millisecond accurate hardware timer built into the T-Pad means that you can be sure you know when visual stimulus presentations are delivered and responses made in the real world.

Worked example

Shown below is a simple worked example illustrating how to use the T-pad. It is intended to give you a flavor of how the T-Pad could work for you and how easy it is to use.

Running your experiment, presenting stimuli and collecting responses

The schematic below shows a simple EEG study and how the T-Pad is connected to the STIM PC you present stimuli to the participant on. Two USB leads connect to the STIM PC, one for a keyboard HID (orange line) and another for streaming serial timestamped data (second orange line).

An Event Marking line, or cable, is connected to the EEG System Unit (red) so that a +5V TTL signal will appear on the STIM TTL Trigger Input port and ultimately on the EEG Event Marking channels when a visual stimulus is presented or a response made by pressing a button. The TTL line tied to a given button will be active high whilst the button is being held down. It will go off, or 0V, when the button is released.

In this example the participant has to press button one when a green smiley face stimulus is shown on the STIM PC's screen and button two when a red sad face is shown. When a button is pressed the exact moment the button is pressed is timestamped and sent to the STIM PC over serial in XiD format.

If required our App can be used to record all millisecond accurate timestamps from the T-Pad whilst your own experiment focuses on recording standard keypresses as though a key had been pressed on a standard USB keyboard.

Note on the stimulus images shown above there is a white Opto marker which can be detected by the T-Pad's light sensor, opto-detector or photodiode. This means that the T-Pad can timestamp the exact onset of the stimulus image accurately using its internal hardware based millisecond accurate timer.

Once the exact onset of the stimulus image has been detected and timestamped in the real world you can be sure that your response times, (RTs) are also millisecond accurate as the button down will also be timestamped by the T-Pad.

In addition to every stimulus and response event being timestamped and sent to the PC over serial, a TTL event mark, or trigger, is also sent to any other equipment that needs to receive accurate onsets, duration and offsets, e.g. in this example the SCAN PC.

What might my experiment look like and how is it coded?

We provide example scripts and code snippets for many of the popular experiment generators, e.g. PsychoPy in this example. Even if you are not familiar with PsychoPy the rationale is very similar for any experiment generator or software which you have written yourself.

In the example below you can see how each stimulus image is presented and there is some script to handle the timestamped data being sent from the T-Pad as it detects visual stimuli being presented and response buttons pressed.

Images are presented in order from the conditions.xlsx file shown below, i.e. the happy and sad images of Emoji's.

The actual visual onsets and button presses are handled in the handleKeys code component. In effect this is a generic piece of code that applies to any experiment which uses the T-Pad.

This code simply waits for serial data being sent from the T-Pad to the STIM PC in a loop whilst carrying out other tasks, e.g. displaying an image or playing a sound. When an "\n" byte has been detected in the serial stream being sent, i.e. a complete XiD command, this is then parsed to determine the Channel, Press or Release, Sensor number and running Millisecond timer.

A complete XiD command sent from the T-Pad is shown below along with how it would be decoded by the code snippet above.

A P 1 6190


P 1 6190

Press | Release

Sensor Number

Opto 1
Millisecond Timer


Because each XiD command is sent over serial and is individually timestamped you don't have to worry about timing accuracy being an issue.

How can I use the timestamps and other information being sent from the T-Pad?

Once you have decoded XiD serial command sent from the T-pad in your experiment you are free to do whatever you want with that information. Usually you would log the activity and timestamps to your PsychoPy data file, but you can use responses for conditional branching, triggering new stimuli or TTL event marking and triggers.

For example it is easy to record the onset of either button 1 or button 2 using some simple code once the XiD command has been parsed out using the code example above.

In this case the timestamp of the onset of either button 1 or button 2 will be printed to the Stdout window for debugging purposes.  All other button presses and button releases are ignored.

Here we can see the XiD information for the first button pressed in response to each trial.

If you are running your experiment on a MS Windows platform however, remember our T-Pad partner App does all this for you with an easy to use graphical interface and all you need to do for a basic experiment is respond to standard keyboard keystrokes.

Who are we

Founded in 2003 by a team of psychologists, software experts and electronic engineers we are dedicated to improving the millisecond timing accuracy and experimental rigor of researchers in the behavioral and brain sciences.

Get in touch