External Trigger Creating Artifacts in Signal

edited July 2020 in Cyton

Hi,
I am working to add an external trigger to my cyton board following this guide and connecting a button (created using this tutorial) connecting to the digital IO pins. I can get the button to work (and can see the result in my openBCI gui) but even with an external power source, I am seeing significant artifacts in the signal when I press my button. I also used the cyton's power as well but got the same result. I am currently using a 3v power supply along with a 470kΩ resistor which should match the Prog button based on these schematics. Does anyone know what I am doing wrong? Happy to provide more information if needed I just wasn't sure what else to include. Thanks so much.

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hello Hekate,

    Be carefully to NOT run your digital IO signal wires in parallel with your electrode wires. The voltages and currents running in the digital lines is millions of times greater than the microvolts in EEG electrodes. Wires in parallel tend to couple into such sensitive circuits, especially if next to or parallel to digital lines.

    It may also be possible to reduce the current flowing in the digital lines, by using higher resistor values. But first experiment with the wire positioning.

    You said you are using the optoisolator?

    This is powered from the mainboard DVDD, NOT an external supply. The optoisolator disconnects the OpenBCI from external voltage sources.

    Regards, William

  • retiututretiutut Louisiana, USA
    edited April 2022

    The solution to this is to use an optoisolator, using the suggestions from William mentioned above and the docs! Tested and confirmed last year. :smile:

    Docs currently say this is the "harder" way... but IMO it's the right way.

    https://docs.openbci.com/Cyton/CytonExternal/#optoisolation

  • No idea if this will ever be seen but I finally got around to doing this and am still running into issues. I am using the optoisolation setup described in the docs along with a basic button and 4.5v of batteries as the external trigger. The setup successfully registers the button press but still creates significant artifacts in the EEG signal upon both press and release. I'm not sure if I'm doing something wrong or if this is just expected in such a circuit. Thanks again for any help!

  • wjcroftwjcroft Mount Shasta, CA

    As mentioned before, keep all your trigger wires FAR away as possible from the electrode wires. Also you can try to MINIMIZE the current flowing in your trigger wires, by using appropriate values of resistors. In the diagram shown,

    https://docs.openbci.com/Cyton/CytonExternal/#optoisolation

    A 33 ohm resistor is connected before pin 1, the trigger input wire. This might be too low, resulting in more current flowing in the trigger line than is needed. The more current flowing, the larger the electromagnetic field around the trigger wire, and inductive coupling that happens. Inside the opto chip, is a simple infrared LED connected between pins 1 and 2.

    Using this LED calculator online,

    https://ledcalculator.net/#p=4.5&v=1.4&c=20&n=1&o=w [recommends a 160 ohm resistor instead of 33 ohm]

    Using your 4.5V input voltage, 1.4V infrared forward voltage as mentioned in the spec sheet, and typical 20ma current.

    https://www.vishay.com/docs/83606/cny17.pdf

    Another calculator here, which agrees:
    https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-led-series-resistor

  • I'm seeing artifacts in my signal too. I'm using a photoresistor with an optoisolator (as in https://docs.openbci.com/Cyton/CytonExternal/) connected in pin D13. Using it for P300-based applications. The interference is not consistent and I'm unable to verify when it happens vs when it doesn't. My understanding was that the optoisolator would prevent any interference from the external trigger to the signal. Is that correct? What could be the interference due?

    Here are two screenshots of averaged P300 signals w/ artifacts and without.

  • wjcroftwjcroft Mount Shasta, CA

    Did you read the previous comments about modifying the resistor value?

  • Yes, I tested it with a 33Ohm resistor (graphs above) and a 330Ohm resistor also. That'd be 5mA.
    This is the interference I'm getting:

    And this is using a different screen (trigger is every 200ms here), which is weird cause it seems trigger is only in 2 of the channels.

    This is the schematic of my trigger.

  • wjcroftwjcroft Mount Shasta, CA

    Why have you connected the external trigger ground to the Cyton ground?? The whole purpose of the optoisolator is to optically isolate the two circuits.

    I also do not understand your photocell connection. It appears to connect at the OUTPUT of the optoisolator, rather than the input.

    Confused...

  • I'll double check the circuit with the electronic technician who did it for me. I don't know much about electronics.

    Where should the ground be connected instead?

    The photoresistor (photodiode + 2 resistors) is similar to the link you posted. That was without the optoisolator but i did measure interference. Do you have any link that shows how to connected the optoisolator to the photoresistor? Or looking at my diagram, would that go in external trigger signal connected to r1 instead of where it is?

  • wjcroftwjcroft Mount Shasta, CA
    edited July 2022

    As you can see from the links I posted, you don't need the optoisolator AT ALL. Optoisolator is only needed if you have an external circuit (such as another electronic device) that is sending the trigger synchronization, as an on/off electrical signal. Please use the schematic shown in those links, they are both the same. There is also no need for the ZHCS diode in your diagram. Throw out your entire old schematic.

    If you are indeed seeing some artifacts with the much simpler photoresistor based circuit, it must again come down to coupling between the wires or induced currents involved. Get the trigger wires as far as you can from the Cyton, and not running parallel to any electrode wires.

  • I'm confused about this. I observed artifacts when I was using the simple photoresistor. I am using it as an external trigger for synchronization in a traditional p300 matrix speller to mark on/off when a row or column highlights/stops highlighting.

    I found several messages in this forum about interferences too and the solution seems to
    be using an optoisolator. That's why I added it and I'm quite confused now.

  • wjcroftwjcroft Mount Shasta, CA

    Optoisolator is only needed as I mentioned before, if you are connecting another electrical equipment, for isolation from that unit's power supply circuits. If you found previous threads regarding interference (solved with an optoisolator), it was because their triggers were coming from other EXTERNAL equipment, that needed the isolation.

    If you are seeing artifacts with the photoresistor, then follow previous suggestions about keeping the wires separate or reducing the current flow through trigger wires by using appropriate resistor values in series with the photoresistor.

  • I did a couple of more tests, using analog mode and a pulse generator (that simulates the photoresistor) to have a more controlled environment. It was connected at Pin D13. Given than analog mode is 0-1023 values (corresponding to 0-3.3V), I did two tests: 10mV and 80mV trigger, every 200ms. Those are very low voltages so I shouldn't expect an interference. I was wearing the wet cap. Here are the brain signals (ch1-8) while sensind the trigger. You can see the signals periodically repeat every 200ms, hence interference. Does this make sense? Is there any test or modification you'd recommend?

  • wjcroftwjcroft Mount Shasta, CA

    "I did a couple of more tests, using analog mode and a pulse generator (that simulates the photoresistor)..."

    Previously, I emphasized that the optoisolator circuit is needed IF you are connecting external equipment as the trigger. Your pulse generator sounds like such an equipment, did you use the optoisolator? The reason the above two links showing the photoresistor circuit DOES NOT need the optoisolator, is that it is NOT involving an external circuit. It is entirely local to the Cyton board.

  • Oh yes, that makes sense. I wonder why I am still seeing interference with just the photoresistor. Analog value Im getting for the trigger is around 800 (aprox 2.5V), I can possibly increase the value of the resistor to bring it down. That's what I was trying to simulate with the pulse generator, but let me try it with the photoresistor and see if I still see interference.

  • wjcroftwjcroft Mount Shasta, CA

    Yes, that is the strategy that has the best chance: keep increasing the series resistor connected to the photoresistor. As that becomes higher, the current running in the wire drops. And the electromagnetic field from the wire also decreases.

    I would suggest making it as high as you can, and still be able to discriminate the voltage difference between light and dark. You may also want to place black tape over the photoresistor, so that it ONLY sees light from the monitor and no room light.

Sign In or Register to comment.