External Triggering Help

Hello,
I currently have a Cyton+Daisy setup with a Wi-Fi Shield. I would like to setup a triggering system, and after much research, I realise using an optoisolator between presentation system and the Cyton board is recommended for precise timings. My task involves recording and measuring SSVEPs (and possibly ERPs in the future).
To this end, I have a few questions regarding this external trigger system setup --
1. I understand I have three data pins for use in my setup. So I would need a quad-channel optoisolator IC, which would you recommend?
2. How do I interface my presentation system (a Windows laptop) to the optoisolator?
3. Any further advice for setting up this trigger system? I understand this is a risky process, so any pro tips from people who have put together such setups would be highly appreciated.

Thanks!

Comments

  • And also, is there a better _"wireless" _ option for triggering that provides a timing precision as good as using external triggering?

  • wjcroftwjcroft Mount Shasta, CA
    edited January 2020

    Prajwal, hi.

    One way to go, is to attach a photodiode-type device (with removable tape), to the corner of your monitor screen. Your experiment program can then "light up" a small square of pixels in this area, to indicate the leading or trailing edge of your trigger signal. See this comment and thread:

    http://openbci.com/forum/index.php?p=/discussion/comment/10131/#Comment_10131
    http://openbci.com/forum/index.php?p=/discussion/1928/timestamps-to-sync-stimulus-and-eeg-vs-external-hardware-trigger

    Read all the way through the posts, you need to wrap the photodiode in some dark tape first, to reduce it's sensitivity. Skiria @skiria8 might also have further comments.

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    If you are only doing SSVEP, you should not need external trigger capability. External trigger is more relevant for P300 / ERP.

  • Thanks for the reply.

    I considered the photo diode option but since it takes away portability of the Cyton in a sense, i thought if using some external connections it’d make more sense to just do external triggering since it also comes with high timing precision.

    So my questions now are
    a) Is there another option you would suggest for triggering in SSVEP study that is wireless?

    b) if I were to use external triggering, can you please briefly answer the few questions I had listed above?

  • wjcroftwjcroft Mount Shasta, CA

    SSVEP does not need an external trigger, it's only required for P300 to get the precise timing between the onset of the control or oddball stimulus, and the P300 response. This timing allows averaging of the EEG to improve signal to noise ratio.

    In SSVEP, you are presenting flashes at certain frequencies, and these appear directly in the EEG in occipital electrode positions. If you have bandpass filters at these values, you can see an increase in filter output amplitude when the light is flashing.

    ONLY IF you are doing P300, the reason I suggested the monitor screen trigger, is that it requires no wires connecting to the Windows laptop electronics. A more unwieldy option would be to use something like a usb parallel port to drive an optoisolator circuit, as described in the external trigger doc.

    https://www.google.com/search?q=usb+parallel+port
    https://docs.openbci.com/docs/02Cyton/CytonExternal

  • wjcroftwjcroft Mount Shasta, CA

    If you run your experiment on a microcontroller, such as Arduino or Raspberry Pi, then those systems have direct "parallel port" digital outputs. Current Windows PCs have no parallel port interfaces, this was present on very old PC hardware. And was used to interface to parallel port printers and such.

  • @wjcroft said: Current Windows PCs have no parallel port interfaces, this was present on very old PC hardware. And was used to interface to parallel port printers and such.

    Do think I can use an USB to parallel port (Male to male) connector to send triggers externally?
    Also, for sending input to 3 or more Data Pins, I would need a quad-channel optoisolator.. Do you know what kind I should look for? Is there any standard one?

    Thanks for the replies, I'm very new to all this, so I greatly appreciate your help.

  • wjcroftwjcroft Mount Shasta, CA
    edited January 2020

    Please remember, SSVEP does not need highly precisely synchronized external trigger. Such triggers recorded with the EEG (in Aux channels), are mainly used in P300.

    The USB to parallel port adapter can give you 8 or more digital output signals. There WILL be a slight delay between the time you turn on the bit on the laptop, and it shows up on the output pin. Not sure how long that is, but possibly less than a millisecond. I'm not sure what drivers come with the usb device. You might inquire; you want something where you can set individual pins on or off. As opposed to a usb device that just comes with a parallel port printer driver.

    Note that if you did SSVEP or P300 with an Arduno or Raspberry type device, these already have digital GPIO output pins.

    Regarding the recommended Vishay CNY17 single channel optocoupler. As you can see it is only 69 cents. So you are not going to save very much by going to a multi-channel device, even if it was available.

  • @wjcroft,
    I would need to have precise triggers in my setup as I plan on doing P300 based Neurofeedback as well.
    I have failed to setup external triggering so far because my PC does not have a Parallel Port output and I discovered USB-to-parallel port cable cannot be used.

    How has other people interfaced their PC to the optoisolator setup? Any other way I can go about this?

    Thanks.

  • wjcroftwjcroft Mount Shasta, CA

    No current PCs have built in parallel ports. You say, "I discovered USB-to-parallel port cable cannot be used". Please explain. This is a general purpose device, and should work with any usb port.

    I've already mentioned using microcontrollers or single board computers that incorporate GPIO parallel port pins. Such as Raspberry, etc. All Arduino's have GPIO, and plug into the laptop via a usb cable.

  • pgattipgatti India
    edited February 2020

    @wjcroft

    You say, "I discovered USB-to-parallel port cable cannot be used". Please explain. This is a general purpose device, and should work with any usb port.

    I tried extensively to find a way to send bit signals through one of the data pins as seen here (link). But could not seem to find a way to send signals to parallel port pins through USB port of my PC via Matlab. Also the device is recognised as "USB Printing Support" and not "COMx" port to use it for serial communication (This is how biosemi realises this mechanism (link)). Couldn't find a driver that could possibly work either. So after several attempts and even trying multiple cables, I did not get anywhere.

    If you have any experience with this, please advise.

    I've already mentioned using microcontrollers or single board computers that incorporate GPIO parallel port pins. Such as Raspberry, etc. All Arduino's have GPIO, and plug into the laptop via a usb cable.

    You're right, I considered this. The sampling period at 250Hz is 4ms and I worry there might be large (and possibly inconsistent?) latency in using these microcontrollers or single board computers and consequently lead to variably marking a few samples too late. Can you comment on this?

    Thanks.

  • wjcroftwjcroft Mount Shasta, CA

    Regarding GPIO output from usb cable, this post recommends use of an FTDI chip / breakout, that offers "bit-banging" capability.

    https://hackaday.com/2013/02/21/bit-banging-through-a-usb-parallel-port-adapter/

    The FTDI X series is recommended. Other links here,

    https://www.google.com/search?q=use+usb+parallel+port+as+gpio

    An Arduino or Raspberry would do pretty simply. Any latency involving usb output, should be fairly constant. As long as you are sending short and infrequent packets via usb.

    @pgatti said:
    Thanks for the reply.

    I considered the photo diode option but since it takes away portability of the Cyton in a sense, i thought if using some external connections it’d make more sense to just do external triggering since it also comes with high timing precision.

    You are going to a lot of effort with the external trigger via GPIO output. Above your comment says this is because photodiode "takes away portability". Yet all GPIO solutions do the same.

  • wjcroftwjcroft Mount Shasta, CA

    PCI parallel port cards are still available for desktop machines,

    https://www.google.com/search?q=pci+parallel+port

  • Thanks for the reply! I will try these things, and the "bit-banging" might be too much effort, and I will try that in the end.
    Had I known setting up a USB-parallel port cable would take a lot of time to setup in my case, I would've opted for using photodiodes. I'll try that now, certainly. Really wish there was a very straightforward & out of the box way to do this though.

  • retiututretiutut Louisiana, USA
    edited February 2020

    Thanks for the reply! I will try these things, and the "bit-banging" might be too much effort, and I will try that in the end.
    Had I known setting up a USB-parallel port cable would take a lot of time to setup in my case, I would've opted for using >photodiodes. I'll try that now, certainly. Really wish there was a very straightforward & out of the box way to do this though.

    @pgatti On it! We will try to streamline an external triggering tutorial/video very soon! Added as an internal ticket for external triggering using photodiodes!

  • pgattipgatti India
    edited February 2020

    @retiutut That is great! Please link me to the tutorial when it is published.

  • @retiutut @wjcroft Just out of curiosity, would having another OpenBCI accessory for an external trigger system be a good idea?
    I'm thinking it could be a photodiode setup or even better, a USB to Cyton cable (possibly with an optoisolator board in between).

  • wjcroftwjcroft Mount Shasta, CA

    Richard was telling me today, there are plans for just such an accessory; at least as far as the photodiode. Actually if you look at the previous link I posted, the photodiode setup is just 3 wires from the Cyton to the photosensor: power, ground, and sense line coming back to the Cyton analog port. So it's something you could solder up in 15 minutes.

    http://openbci.com/forum/index.php?p=/discussion/comment/10131/#Comment_10131

    A good tape to use to reduce sensitivity:

    https://www.amazon.com/dp/B000FKBYYQ/

  • pgattipgatti India
    edited February 2020

    @wjcroft, In my setup I would need about 4 different trigger values. Is that possible to have using a single photodiode somehow? Or does that mean I would need 3 photodiodes hooked up to the monitor?

  • wjcroftwjcroft Mount Shasta, CA

    Why do you need 4 different trigger values. Generally with P300 you just need to mark the presentation of the control or oddball stimuli. Both could be done with one sensor, and keeping track in your software that is presenting the stimuli, where you are at in the data stream.

    The Aux data stream in the EEG recording, is for tight synchronization with the EEG. Not for general experiment control / tracking.

Sign In or Register to comment.