The Extender’s hardware triggering feature allows you to mark external events for post-processing. The input trigger pulses are injected into to the headset data stream within +/-1 sample. There is a fixed 60ms delay between the trigger and the channel signal data which is due to the filter delay for the channels.The trigger pulse is shown in EmotiVPRO as a pink line and is also saved in the hardware column when exporting a file.
EMOTIV has provided a custom 1m trigger cable with every extender. The cable has two tinned wires red and black that can be connected to an external trigger source. The input polarity of the trigger is reversable and utilises an opto-coupled photo transistor Vishay VOL628A (see datasheet). This component requires a minimum of 1mA forward current and maximum of 60mA. The input design has has an internal limiting resistor of 1kOhm. The trigger input voltage need to be between 2.5 -15V and can be driven directly from an arduino or a parallel port. Please see below Arduino examples:
The Extender trigger input requires a 2.5mm audio connector which has an outer diameter of less than 6.8mm to fit into the socket.
EMOTIV has provided a 1m trigger cable with every Extender. It features the required low profile connector on one end and has two tinned wires (red and black) for connecting to your trigger source. We have provided some examples of an arduino scripts.
Example 1: generates 100 pulses at 1s intervals.
Example 2: Sends a trigger pulse each time the trigger character is recieved on the arduino serial port.
This example generates fixed time interval pulses into the trigger port of Extender and you can see in the last image how trigger pulses are represented in EmotivPRO.
Pictured below is an Arduino Uno connected to the trigger input cable.
Below is the code we used to test which had a 10% duty cycle. Output on pin 9 shared with the LED so you can see the pulses, input voltage was ~3.5V.
We modified the default blink application to use pin 9 and set the high delay give a 10% duty cycle. 100ms High and 900ms low.
We saw the following output in EmotivPRO.
The third example below shows how it is possible to install hardware support for Arduino into Matlab using the hardware support package and then directly control the output pin connected to the Extender.
Download and install Arduino Hardware support package on MATLAB.
Connect the Arduino board to the PC. To establish a connection between MATLAB and Arduino boards, the following command can be used from MATLAB:
The arduino support package can control the arduino in multiple different ways. For this example we are using Digital pin 9 and using the writeDigitalPin command. See example below.
This will create a rising edge which will trigger the extender port. You can incorporate this into your code.
This example uses the same setup for the arduino. The arduino listens to a serial port on your computer with a baud rate of 9600bps. Each time a value of 1 is sent to the serial port a trigger pulse is generated.