EEG Hyperscanning setup - GlascherLab/LabWiki GitHub Wiki
- Setup
Setup
For a general introduction of the equipment its usage please look into the biosemi manual inside the supporting_material folder.
Equipment (minimum setup)
Check that you have the following equipment for a minimum EEG hyperscanning setup in the Gläscher Lab.
- Stimulus Computer(s)
- For running the experiment.
- Host Computer (eeg recording computer)
- For receiving the EEG signals and running the Actiview software.
- 2 A/D boxes (amplifiers)
- for a daisy chain setup, meaning two boxes in series.
- 2 Batteries
- for running the 2 A/D boxes. Also their respective chargers.
- USB 2.0 receiver box
- for receiving the eeg signals from the A/D box and also the trigger signals (from stimulus computer and the photo diode).
- Stimtracker box
- photodiodes are attached to this box
- Cables
- 2 fiber optic cables
- USB 2.0 cable
- Trigger cable with 35 pin parallel port
- Electrodes sets as required
- 2 photodiodes
- Custom setup box (used to include the photodiode signals)
- 37 pin to breadboard port
- 25 pin to breadboard port
- breadboard to 37 pin port
- breadboard wires
- a small screwdriver (to be used on the ports)
- Other usables
- Caps for participants
- gel for better conductance
- syringe for the gel
- tape
Important settings
The A/D boxes will be called Left and Right to simplify addressing them. The Left A/D box is the master and is placed on the left side. The first optic fiber cable from the Left A/D box goes to the Right A/D box. The second optic fiber cable then goes from the Right A/D box to the USB 2.0 receiver box. There is a speed mode dial (with an arrow) in front of both the A/D boxes. The arrow on the Left A/D box one should point at the setting '0' and on the Right A/D box should point at setting '1'. For more information on the speedmode dial (arrow) click Here
The photodiode attachment
The photodiodes are used to pass the exact time instance at which the screen displayed a particular stimulus on the participant's screen. This can significantly vary (from the instance it was sent by stimulus computer) depending upon the hardware and connectors used, and the number of pixels that need to change from the previous stimulus. A typical attachment of the photodiode can be seen in the image below. Every time the stimulus changes on the screen, the screen should also flip the pixels underneath the photodiode once to generate the trigger.

Also, cover this setup of the photodiode on screen with black tape and black cardboard so that the participant is not distracted by the flipping screen at that location.
Custom setup (triggers)
We have a custom setup of the triggers for the hyperscanning measurements. The task is to combine the trigger signals send from the stimulus computer and the photodiodes (through stimtracker) into one input of the USB 2.0 receiver box. The receiver box then transmits the triggers to the host recording computer through a USB port.
Step 1.) The setup of the stimulus computer
If using the microsoft windows operating system computer version 7 or greater we need to install drivers to detect the USB out ports as the standard COM Ports. The drivers can be found at this LINK. There is also a setup file of the driver in the folder 'supporting_material'.
While scripting your experiment with the help of psych-toolbox in MATLAB, use triggers for every event and every action. Better have more triggers than you think necessary to be on the safe side. The trigger numbers can be set from 1 to 255 (8 bits = 1 byte). An example is also included named 'sk_send_trigger_example.m' file in the 'supporting_material' folder.
If you are using the display-mounted Eye-trackers (Red-m from SMI), you need to run the stimulus presentation from the two eye-tracking laptops (Lenovo Thinkpads), because each eye-tracker needs to connect to his own computer running the eye-tracking software (Tatia, can you describe this in the ET section of the main WIKI?). In that case, one Psychtoolbox (PTB) script should act as the master script that triggers the other PTB script on the other eye-tracking laptop. This setup works with well with sequential decision-making tasks, where simultaneous stimulus presentations are not necessary.
If your task requires simultaneous stimulus presentations to both participants (e.g. Tessa's IFBT or Saurabh's Tiger Task), a PTB presentation on a single stimulus computer can be very effective. The presentation for both participant has be shown on the same screen and the video signal reaches both screens with a video splitter. Half the screen that the participants' are looking at is covered with back cardboard (to hide the stimuli that the other participant is looking at). Even though the stimulus display is almost synchronous between the screens, it is still necessary to record exact presentation timing with the photodiodes on the screen and the StimTracker 8see below)
Step 2.) The setup of the stimtracker
The stimtracker takes the input from the two photodiodes and outputs it through a parallel port (25 pins). The top parallel port must be used for the output at the back of the stimtracker. In the following diagram, this is marked with a red ellipse. The photodiodes from the Left and the Right screens should be connected in the Photocells (from the diagram) 1 and 2 respectively. To gain more knowledge on the pin configuration click Here.
![]()
Step 3.) Connections
The USB connection from the simulation computer ends in a 37 pins male parallel port. To this, we connect the 37 pin female to the breakout board port. Similarly, the parallel port from the stimtracker is a 25 pin male parallel port and we connect the 25 pin female to breakout board port to it.
To understand the 37 pins from the stimulus computer please look at the diagram below (in blue). The first 8 pins (1 byte) are used for the EEG triggers (from the stimulus computer). The last pin (i.e. 37) is the ground pin. For more information click Here.The 25 pins from the stimtracker are shown in red color. Pins 2 and 3 are used for photodiodes 1 and 2 respectively. The last pin (i.e. 25) is the ground. For more information click Here.
Connect the pins according to the diagram with the help of the breadboard wires and a screwdriver. The ground pins first, i.e., pin 37 (from blue) and pin 25 (from red) to pin 37 (in yellow connected to the USB 2.0 receiver through a breadboard to 37 male port). Next, connect the pins 1 to 8 (from blue) to pins 1 to 8 (in yellow). Also, connect pins 2 and 3 (from red) to pins 9 and 10 (in yellow). The connections are complete. It is important to conceal (protect) these connections for security and to avoid any electromagnetic interference.

Once the connections are made the final pin configuration will look like the diagram below.

The image below shows the final setup. The text in black mentions where the connections are from. The text in red mentions the port names and their respective custom connections

Triggers received by the Actiview software
It is important to note that the default (no trigger state) for the first 8 bits (pins) is 0. This means that if there are no triggers you will obtain the decimal value 0. If the trigger number 255 was sent from the stimulus computer then all the 8 bits will become active to transmit the number 255. However, this is only true for the first 8 bits. For bits 9 to 16, the default is 1 and is also reversed (i.e. 16-to-9). This means for the two photodiode trigger pins if there is no trigger received then the decimal value of 255 is sent. If the photodiode 1 is active, the bit 9 will send a 0 meaning the decimal value received will be 254. Similarly, if photodiode 2 is active, bit number 10 will send 0 and the decimal value received will be 253. And, if both the photodiodes are active at the same time the decimal value 252 will be received.
Converting the trigger values to decimal
The actiview software records the triggers values from all the 37 pins as binary and converts this number to decimal. This is a huge number and makes no sense. To make it usable, we first convert this decimal number into binary and then divide it into bytes (for the stimulus computer and the photodiodes). Subsequently, convert these individual bytes into decimal again (photodiodes byte reversed) to obtain our sent triggers.
The script named 'sk_check_triggers.m' in the 'supporing_material' folder does the described steps and outputs the original trigger numbers (for both sent by the stimulus computer and the photodiodes).
Placing the cap on the participant
Measure the head circumference of the participant in centimeters. When measuring ensure that the participants' hair is well spread out (in case of much hair) to get an accurate measurement. The caps have range labels telling you the sizes it fits well. When in doubt try a cap that is slightly smaller than the measured value to make sure it fits well. Care should be taken that if the cap is too tight the participant will be uncomfortable in the long run, and if the cap is too loose the electrodes will move and will result in a bad measurement.
Measure the distance between the Nasian and the Inion point on the head and try to keep the middle of the cap (also marked with a black dot) at the halfway point. It is crucial to keep the cap centered left to right. For this measure the distance between the two ears (the exact point is irrelevant since we want the center of the head. Just choose the same point on both sides) and keep the middle of the cap on the halfway point. Here is a reference image.

Measure the 3D locations
To get the relative positions of the electrodes on the scalp we can use software to measure the 3D model of the head. This will generate an .obj, .mtl and a .jpg file. Make sure their names are exactly the same and if not, please rename them to match exactly.
Please use the MATLAB script 'sk_start_marking.m' to mark the electrode positions. In the MATLAB command window please type 'help sk_start_marking' and press enter. It is important to read through the entire procedure and other information before using the script. @Tatia !
Procedure to mark the electrodes
To mark electrode positions for each participant individually MATLAB script 'sk_start_marking.m' needs to be executed.
Set up the gel and electrodes on the cap
Insert the gel in all the cap sockets. Be careful to not put too little or too much gel in the beginning. If there is too little gel then the contact between the electrode and the skin of the scalp will not be sufficient. If there is too much gel then it may interact with the neighbor electrodes and cause a bridge effect. The right amount of gel does not overflow from the socket. Another thing to note is that as time passes the gel dries up, so if the study is very long (nearing 2 hours or more) you may need to add gel again depending on the impedance values.
The next step is to attach the electrodes to the sockets. Make sure to match the corresponding electrode identifiers. They are labeled as A1 to A32, B1 to B32, C1 to C32, and D1 to D32. It is easier to start from the higher numbers to lower numbers (B32 and D32 to B1 and D1) on the back of the head and sequentially move towards the front of the head.
Attach the external electodes
These are useful in EEG pre-processing to get rid of eye blink and eye movement artifacts.
Please have a look at the image below. The external electrodes and the stickers are prepared beforehand. The alcohol (in the white bottle) is used to clean the skin surface at the placement location. A small amount of gel is applied to the electrode before attaching it to the skin with the help of the sticker.

The location of the attachments can be seen in the diagram below. Care should be taken that the electrodes attached should not hinder the normal vision and movement of the eye. Fix the external electrodes (EX1 to EX4) around the eyes as shown.

Attach the reference electrodes
Attach the CML and DRL reference/ground electrodes on the top of the cap. These are marked as their respective identifier sockets on the cap. Then, gather all the wires (except the reference (CML and DRL)) at the back of the head. Take the reference electrodes wires (CML and DRL) and wrap them around all the wires in a circular motion (at least 2 folds around) to ensure less electromagnetic interference. Now attach this bundle of wires to the shoulder of the participant with a tape. This ensures that the wires move minimally during the experiment/recording.
Final setup image
The diagram below shows the final setup diagram.
