electrode impedance test using the GUI widget

VedashreeVedashree India
edited November 2023 in Cyton

I am measuring Electrode impedance by the method as below, here I am not using RLD (since not testign with head).

https://openbci-stream.readthedocs.io/en/latest/notebooks/A2-electrodes_impedance.html

I am varying resistance in 10Kohm steps up to 100Kohm and observing the Impedance in OpenBCI GUI as suggested,

Website: https://docs.openbci.com/Software/OpenBCISoftware/GUIDocs/

I got the following results,

Why is there no change in resistance value shown in Open BCI even if the I vary the external resistance from 10Kohm to 100Kohm?

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Veda,

    Those are interesting results in the GUI. I believe the graph on the page you reference:

    https://openbci-stream.readthedocs.io/en/latest/notebooks/A2-electrodes_impedance.html

    Shows that the impedance measurement algorithm is working:

    Yet the GUI impedance widget values you show, look to be not tracking accurately. We know the basic impedance algorithm has worked in the past. So it is possible that there may be something odd going on in the widget source code.

    https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/W_CytonImpedance.pde

    Mentioning @philip_pitts and Richard @retiutut.

    William

  • wjcroftwjcroft Mount Shasta, CA

    Have you double-checked that your wiring setup is working correctly in terms of the ohms measured? That would imply that you temporarily disconnect the wires/connectors going to the Cyton pins, and instead connect them to a DVM ohmmeter as you scan the rotary pot knob over the range.

    Just want to confirm that your wiring is consistent.

    One other test you could make is with an older version of the GUI, BEFORE the Impedance Widget was introduced. In that era, the impedance measuring was turned on with the little 'ohm' button on each line of the time series. When that is toggled on, the impedance shows.

    https://github.com/OpenBCI/OpenBCI_GUI/releases

    I think the 5.0.9 or 5.0.8 releases had the old style impedance check, prior to the impedance widget.

  • JLGJLG
    edited November 2023

    Hi both,
    I actually have the same issue. When I connect fixed resistors (by opposition to a potentiometer) with values around 1MOhms then I get correct results in the GUI (around 980 kOhms) but if I decrease the value of my resistors, the value settles at around 500 kOhms regardless of how low my actual resistors is.
    My wiring is the following:
    I don't use BIAS but I use the N port of channel 1 and SRB2 (the lower pin basically). I "short" those two ports using my test resistor.
    I also tried to switch and use BIAS instead of SRB as it is suggested on Chip's website but it does not work much better. I get good GUI values in the low register but the FFT of the signal shows high peaks at many frequencies and sometimes the impedance values just decrease over time and the ADS ends up railed.

    Additionnally, when I try to look at the raw data using the serial1 port, I get voltage values that do not match at all the values displayed in the GUI. Is it possible that the gain changes when the leadoff mode of the ADS is activated? I tried different resistors to see if the factor between the values I got and the values in the GUI was consistent but it isn't. (To reconstruct the data from the binary data sent through serial, I replicated the GUI code one can find on the GUI github.)

  • wjcroftwjcroft Mount Shasta, CA
    edited November 2023

    @JLG said:
    ...
    Additionnally, when I try to look at the raw data using the serial1 port, I get voltage values that do not match at all the values displayed in the GUI. Is it possible that the gain changes when the leadoff mode of the ADS is activated?

    JLG, thanks for your comments and confirmation. The original version of the impedance check in the old GUI (prior to the widget) used to work properly. So this is likely some issue that surfaced when the code was refactored. I'm guessing that a Github issue will be logged shortly, will link to that. Hopefully this will be a simple fix.

    Regarding the raw data, this is unfiltered. The ADS1299 needs to have the DC offset removed, typically with a bandpass (.5 Hz to 45 Hz) or a highpass at .5 Hz. Without filtering this you will see this DC offset, frequently in the millivolt range.

  • @wjcroft said:
    Have you double-checked that your wiring setup is working correctly in terms of the ohms measured? That would imply that you temporarily disconnect the wires/connectors going to the Cyton pins, and instead connect them to a DVM ohmmeter as you scan the rotary pot knob over the range.

    Just want to confirm that your wiring is consistent.

    One other test you could make is with an older version of the GUI, BEFORE the Impedance Widget was introduced. In that era, the impedance measuring was turned on with the little 'ohm' button on each line of the time series. When that is toggled on, the impedance shows.

    https://github.com/OpenBCI/OpenBCI_GUI/releases

    I think the 5.0.9 or 5.0.8 releases had the old style impedance check, prior to the impedance widget.

    I connected variable resistance (From 1ohm - 100Kohm) between SRB2 (bottom pin) and 1N channel (bottom pin). I checked the resistance using DMM (Digital multimeter) before connecting to the Cyton pins.
    I initially set 10Kohms and measured resistance as in my previous post. Then I increased resistance in 10Kohm steps up to 100Kohms. So, there was no issue with wiring.

  • @wjcroft said:
    Regarding the raw data, this is unfiltered. The ADS1299 needs to have the DC offset removed, typically with a bandpass (.5 Hz to 45 Hz) or a highpass at .5 Hz. Without filtering this you will see this DC offset, frequently in the millivolt range.

    Yes I know but I always compare either unfiltered data in GUI vs unfiltered data in Serial or filtered GUI vs filtered Serial.
    With regards to the wiring, is there a technical reasoning behind the fact that BIAS pin should only be used with head measurements and SRB2 for resistors?

    @wjcroft said:
    The original version of the impedance check in the old GUI (prior to the widget) used to work properly. So this is likely some issue that surfaced when the code was refactored. I'm guessing that a Github issue will be logged shortly, will link to that. Hopefully this will be a simple fix.

    I am not sure this is software related because from what I have seen on the different githubs (GUI v2 and GUI v3), it seems like the calculation is exactly the same : sqrt(2)std(voltage)1e6/1e-9. However, I will test previous versions just to make sure.

    Thank you

  • wjcroftwjcroft Mount Shasta, CA

    @JLG said:
    ...
    With regards to the wiring, is there a technical reasoning behind the fact that BIAS pin should only be used with head measurements and SRB2 for resistors?

    You are reading the article from the other website, done by a university group not affiliated with OpenBCI:

    https://openbci-stream.readthedocs.io/en/latest/notebooks/A2-electrodes_impedance.html

    Their statement about ADDING Bias (along with SRB2) was likely motivated because that is the standard procedure with most ADS1299 body measurements. Since the wiring is so short for the impedance test resistors or potentiometer, there is less concern for anti-mains function of Bias. I don't think anyone is saying that you should ever substitute Bias for SRB2.

    @wjcroft said:
    The original version of the impedance check in the old GUI (prior to the widget) used to work properly. So this is likely some issue that surfaced when the code was refactored. I'm guessing that a Github issue will be logged shortly, will link to that. Hopefully this will be a simple fix.

    I am not sure this is software related because from what I have seen on the different githubs (GUI v2 and GUI v3), it seems like the calculation is exactly the same : sqrt(2)std(voltage)1e6/1e-9. However, I will test previous versions just to make sure.

    I already mentioned that the impedance code has been refactored from the original 'ohm' button (on time series graph), to this new widget. If some glitch happened in the transition to widget, that may explain the issue. Remember that the stream must be carefully filtered at the injection frequency BEFORE the final amplitude calculation. Filtering operation may have changed in the widget version. Or possibly even before then, when the GUI transitioned to Brainflow function calls. Previous filtering was probably done without using Brainflow.

    Thanks for your confirmation of this issue.

    William

  • Thank you @Vedashree and @JLG for bringing this to our attention. I've logged an issue on the OpenBCI GUI GitHub repository to track the issue. Would you mind letting us know what operating system and version the GUI you are using?

    https://github.com/OpenBCI/OpenBCI_GUI/issues/1204

  • JLGJLG
    edited November 2023

    Hi Philip and William,
    Thank you very much for the quick reply. I was using the OpenBCI GUI 5.1.0 on Windows 10.

    I would like to clarify my observations:

    I had three resistors 1MOhms, 680kOhms, 470kOhms.
    When looking at Chip's blog (https://openbci.com/community/openbci-measuring-electrode-impedance/) it seems like he advises using the BIAS electrode. However when looking every other documentation online, it appears to be SRB2 that should be used. I used both regardless and my results are the following:

    BIAS-N Channel 1: The 31 Hz lead off frequency isn't even present in the signal regardless of the resistor used and the resistors values do not match real-life values (I get 50 kOhms instead of 470 kOhms and the value is drifting with time).

    SRB-N Channel: The 31 Hz lead off frequency is present but I get GUI value 770 kOhms and 650 kOhms instead of 680 kOhms and 470 kOhms. This is even worse when I put lower values like 50 kOhms, I still get around 500 kOhms. Only the 1MOhms resistor is working as expected.

    AGND-N Channel: Everything seems to work fine, I get correct values and the 31 Hz lead off frequency is visible.
    I did not try AGND on purpose, I just made a mistake and connected to AGND instead of BIAS.

  • wjcroftwjcroft Mount Shasta, CA
    edited November 2023

    My guess is that Chip was using a particular ADS1299 hardware register setting. Different than the current default.

    Regarding AGND, this is intended only for powering 'active' electrodes in combination with the AVDD / AVSS. So AGND is never connected to the subject. For scalp measurements you definitely want to use the pair: channel and SRB2.

    Because the page you referenced and graphs shown work properly with channel + SRB2, we know that these should be sufficient to get accurate readings.

    https://openbci-stream.readthedocs.io/en/latest/notebooks/A2-electrodes_impedance.html

  • retiututretiutut Louisiana, USA
    edited November 2023

    The real source of truth for talking about ADS1299 and injected current impedance measurement is the official Data Sheet.

    https://www.ti.com/lit/ds/symlink/ads1299.pdf?ts=1698962922190&ref_url=https%3A%2F%2Fwww.ti.com%2Fproduct%2FADS1299

    Full source code for impedance value calculation in Ohms:
    https://github.com/OpenBCI/OpenBCI_GUI/blob/d8543aafe2eea9d5f1394502d88bc11f43636021/OpenBCI_GUI/DataProcessing.pde#L43

    You are free to compare these two sources to check for yourself if there is a discrepancy. Please ping me if there is. Also, note that we subtract the 2.2kOhm resistor that is present in the Cyton design.

  • wjcroftwjcroft Mount Shasta, CA
    edited November 2023

    Richard @retiutut and @philip_pitts, both these users have already found that the resistors they connect to Cyton, do NOT read correctly in the impedance widget. So something must be causing this issue. Likely NOT hardware or datasheet related. Please look through all the previous comments.

    Suggested previously that the previous 'ohm' button (time series) version worked correctly.

  • retiututretiutut Louisiana, USA
    edited November 2023

    Before:
    https://github.com/OpenBCI/OpenBCI_GUI/blob/4ab8cf7e024aed367e0cca07f02ad4e3b4366836/OpenBCI_GUI/W_TimeSeries.pde#L578
    https://github.com/OpenBCI/OpenBCI_GUI/blob/4ab8cf7e024aed367e0cca07f02ad4e3b4366836/OpenBCI_GUI/DataProcessing.pde#L51

    After:
    https://github.com/OpenBCI/OpenBCI_GUI/blob/d8543aafe2eea9d5f1394502d88bc11f43636021/OpenBCI_GUI/DataProcessing.pde#L43
    https://github.com/OpenBCI/OpenBCI_GUI/blob/d8543aafe2eea9d5f1394502d88bc11f43636021/OpenBCI_GUI/CytonElectrodeStatus.pde#L245

    No change in the core logic of computing or displaying the numerical and text values.

    BoardCyton class for sending the command to start checking impedance:
    Before:
    https://github.com/OpenBCI/OpenBCI_GUI/blob/4ab8cf7e024aed367e0cca07f02ad4e3b4366836/OpenBCI_GUI/BoardCyton.pde#L398

    After:
    https://github.com/OpenBCI/OpenBCI_GUI/blob/d8543aafe2eea9d5f1394502d88bc11f43636021/OpenBCI_GUI/BoardCyton.pde#L437C43-L437C43

    The big difference is that we now update the channel setting just before checking impedance:

    currentADS1299Settings.values.gain[channel] = Gain.X1;
    currentADS1299Settings.values.inputType[channel] = InputType.NORMAL;
    currentADS1299Settings.values.bias[channel] = Bias.INCLUDE;
    currentADS1299Settings.values.srb2[channel] = Srb2.DISCONNECT;
    currentADS1299Settings.values.srb1[channel] = Srb1.DISCONNECT;
    

    Which I'm sure I implemented due to online documentation or the datasheet.

    This is likely the discrepancy due to

    My wiring is the following:
    I don't use BIAS but I use the N port of channel 1 and SRB2 (the lower pin basically). I "short" those two ports using my test resistor.
    I also tried to switch and use BIAS instead of SRB as it is suggested on Chip's website but it does not work much better. I get good GUI values in the low register but the FFT of the signal shows high peaks at many frequencies and sometimes the impedance values just decrease over time and the ADS ends up railed.

  • retiututretiutut Louisiana, USA

    @wjcroft I've sent you a private message discussing part of this change and where it was brought up internally.

  • wjcroftwjcroft Mount Shasta, CA

    Richard @retiutut and @philip_pitts, I'm not trying to argue with any one or examine source code differences. The fact is, these two users have proven that the impedance algorithm is busted. Something must be broken. Seems highly suggested to get some resistors and duplicate what these users have already documented.

  • wjcroftwjcroft Mount Shasta, CA

    @retiutut said:
    @wjcroft I've sent you a private message discussing part of this change and where it was brought up internally.

    I'm not seeing any PMs or emails. Please resend to my email.

    Of course the results seen by the users above should be replicated in house, but seems unlikely that two separate individuals would see very similar malfunctions.

  • retiututretiutut Louisiana, USA
    edited November 2023

    I've communicated my findings and this forum thread internally and we are planning to investigate this asap.

    @wjcroft I sent via slack since it was originally a slack conversation that prompted the change.

  • I was able to reproduce @JLG's results and recorded my findings on the GitHub issue. This merits additional investigation, and we'll schedule time when available to find the source of the problem.

  • wjcroftwjcroft Mount Shasta, CA

    Added this comment on the Github issue:

    Phil, thanks!

    Seems pretty certain that SRB2 should be the pin used, in normal EEG applications. And that SRB2 PREVIOUSLY worked with the original ADS1299 register settings. Which is confirmed on this page,

    https://openbci-stream.readthedocs.io/en/latest/notebooks/A2-electrodes_impedance.html

    So hopefully this is an easy fix.

    Thanks everyone.

  • wjcroftwjcroft Mount Shasta, CA

    A fix for the impedance issue is forthcoming shortly. Sorry for the delay in resolving this.

    https://openbci.com/forum/index.php?p=/discussion/3790/high-impedance#latest

    William

Sign In or Register to comment.