GSR & OpenBCI

I hope I've placed this question under the right section.

Is there a way to measure GSR (Galvanic Skin Response) with OpenBCI? I understand there is a need to inject some current to the electrode for measuring conductance. 
How can this be done using OpenBCI? 

Thank you, 
Mike

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Mike, hi.  Yes, GSR is a resistance measurement between two sensors.  EEG is measuring differential microvolts between two sensors.  The ADS1299 has a feature that can be used to measure the AC 'impedance' of the EEG sensors.  See Chip's excellent posts on his blog, below.  

    http://eeghacker.blogspot.com/2014/04/openbci-measuring-electrode-impedance.html
    http://eeghacker.blogspot.com/2014/04/impedance-of-electrodes-on-my-head.html

    It's probably unlikely that typical GSR setups work in this way.  For one thing, I would guess they use a DC voltage instead of AC like the ADS1299.  So using the ADS1299 like this, your results may be similar to conventional GSR.  Might be easier just using ideas from other GSR hackers,

    https://www.google.com/search?q=gsr+arduino

    William
  • edited September 2014
    Hi Wiliam , 

    I don't think you can use the lead off detection - from the datasheet, page 52, "During normal operation, the ADS1299 BIAS lead-off at power-up function cannot be used because it is necessary to power off the BIAS amplifier."
    Is there someone who knows how could I inject some current to the electrodes? I know the gtec uses their EEG amplifier to do GSR as well.

    Thanks
    Mike
  • wjcroftwjcroft Mount Shasta, CA
    edited June 2019
    Mike, the "lead off detection" feature is not the same as configuring the ADS1299 to measure electrode impedance.  See the links on Chip's blog I posted earlier.  Also for more background you can look over this additional thread in the forum,

    http://openbci.com/forum/index.php?p=/discussion/84/ads1299-electrode-impedance-measurement-algorithm

    Chip has checked in his code to do this to the github.  Note there is one downside to turning the injection on:  it changes the input impedance of the ADS1299 from 1 gigaohm to 500 megohms.  See this paper for implications of that decision,

    http://wwe.eeginfo.com/research/ElectrodeImpedance.pdf

    This is a consideration if you are using saline solution based passive sensors for the EEG portion of your combined setup.

    As I mentioned, this injected current is AC, not DC as is used in most traditional GSR devices.  So may give different results.  You would certainly NOT want to use any conductive solution or paste on the sensors involved in the simulated GSR measurement, as these would null out any contribution from the sweat on the subject's skin.

    Regards,

    William
  • There is a very important reason why AC is used when doing GSR. Electrodes represent 1/2 of a battery, they are in fact what are called half cells. Consider an ordinary D-cell battery for instance it has a carbon electrode and a zinc cathode. Many other combinations of metals are possible. Nickel/iron being another example, or the common car battery with lead as the anode and lead dioxide as the cathode. Each battery will have an electrolyte that serves the purpose of providing a  source of ions that are transported between the battery electrodes. As we charge and discharge a battery the ions from the anode typically are taken off the anode and transported into solution and make there way to the cathode where they become lead dioxide.

    If enough metallic ions are transported off the material then the material will become polarized. when this happens the resistance of the electrode climbs higher and higher until it becomes an open circuit. Stainless steel, and in fact most metals are easily polarized and thus unsuitable for the purpose of sensing bio potentials. There are only four metals suitable for consideration as bioelectrode. They are, Mercury, Silver, Platinum/hydrogen, and carbon. The Mercury calomel  is almost perfect. However, for obvious reasons not practical,  the Platinum/hydrogen electrode is great for standards but because of the hydrogen gas, impractical. Carbon electrodes are noisy. That leaves, Silver. Which turns out to have many desirable features. In particular it has excellent noise properties and a low and easily balanced offset potential.

    In any event if you run a DC current between two Silver electrodes one will behave as an anode and the other a cathode. Eventually, one surface will be depleted of surface ions from the AgCl2 silver chloride layer and the impedance will climb, or worse the DC current will start driving silver off the surface to which it is usually plated onto, into solution. Do it long enough and you will loose your electrode and be left with worthless, noisy, junk.

    Using AC drive puts back what it taken off during the previous half of the AC waveform preserving the integrity of your electrode.

    What about Gold? The best electrolyte for cold is cyanide. I don't think you want that on your skin do you? In any event gold is just as bad a choice as stainless.
  • wjcroftwjcroft Mount Shasta, CA
    Cybin, thanks.  Yeah I agree doing GSR with AC avoids the polarization issues.  I think all the commercial clinical grade biofeedback units do this.  And...  If you look at the wide range of Makers experimenting with GSR on their Arduinos -- a lot of them are using just simple DC with at least some modest results.  I would say if you could find an Arduino circuit using a balanced AC signal source (that swings both + and - relative to the reference), then that would be ideal.

    As far as electrodes used for EEG, typical metals used are gold, silver, tin.  These all work fine.  The most stable however is silver - silver chloride, Ag-AgCl. 

    https://en.wikipedia.org/wiki/Silver_chloride_electrode#Biological_electrode_systems

    (But I do understand your comments on electrode metals are regarding the chemistry of DC current injection.)  As an aside, EAV (Electroacupuncture According to Voll), has long used DC for their resistance measurement.  With the same downsides of polarization that you mention.  Motoyama developed his AMI (Automatic Meridian Instrumentation), to remedy that, using very short pulses.

    http://www.cihs.edu/ami/ami_info.asp

    William

  • Hi, 

    What do you guys think about the below device? They are using DC current as far as I could tell.

    Mike
  • wjcroftwjcroft Mount Shasta, CA
    Mike, great find on that research paper from MIT Media Lab.  Yes, they are using specially current regulated DC for long term daily measurements from the wrists.  It's a beautiful piece of work.  This pretty much confirms that current controlled DC can work fine with little concern over polarization issues.

    William

  • biomurphbiomurph Brooklyn, NY
    Mike,
    It is possible to use the microcontroller ADC inputs and create a GSR sensor.
    That way, you won't sacrifice one of the ADS1299 inputs.
    If you decide to use the broken out pins of the ATmega or chipKIT, you will need to modify the code to add the ADC readings...

    If you want to use one of the input channels of the ADS1299, you can certainly do that, and when you do, make sure to adjust the gain setting of the particular channel that you want to use, so you don't saturate the input.
  • edited January 2015
    At least two other top-notch commercial products use AC to measure GSR in the same way as electrode impedance is measured but the values of the signal injection capacitors are different from what would be used for simple electrode impedance measurements because the signal spans a different range. AC measurement is required in order to eliminate the uncontrolled galvanic offsets at each electrode to skin interface which would  otherwise randomly skew the readings. The EEG input impedance of the OpenBCI device and other EEG amplifiers is orders of magnitude lower than 1Ghom because at EEG frequencies this impedance is characterized the RFI suppression capacitors, so reducing the DC impedance from 1Gohm to 500Mohm is in our case absolutely inconsequential. The most important step to be taken in controlling input impedance for applications where channel amplitudes must be compared, is to select the smallest possible RFI suppression caps and to ensure that these along with the AC injection capacitors do not in sum total exceed IMHO 100pF.
  • Hello,

    I see it's been a while since the possibilty of obtaining Galvanic Skin Respose (GSR, or, I think more commonly: electrodermal activity, EDA) with OpenBCI was discussed. From what I've seen, it's still not possible to get EDA from OpenBCI. Or is there a way now, or are there plans for this?

    Best,
    Marius
  • @mariusrubo

    This seems like it's possible with the Pic32 according to @biomurph

    If that's true, i don't see why we can't add this as a board mode, like we did for analog and and digital input reading. @wjcroft am i following this thread correctly?


  • wjcroftwjcroft Mount Shasta, CA
    AJ & Marius, hi. Yes a PIC ADC pin can work. As @Mike pointed out above, the MIT circuit in figure 10 is the way to get the best DC signal conditioning and current control. The output of that would then go to the PIC pin; where the formula shown gives conductance. If you don't use that circuit there likely would be artifacts from the DC polarization, if you are measuring over a longer period of time.

    [figure 10 and formula]

    And... if the GSR measurement is just short term and precision or polarization artifacts are not a concern, then there a many other circuits shown online for measuring GSR with Arduino style microcontrollers.

    William

  • This is trivial to implement. All that's required is application of a weak AC signal to each electrode through a resistor array via tri-statable CPU output bus pins. A side benefit is the ability to measure GSR. If this has not yet been done it's because nobody has paid any attention to it.
  • I refer above, to the ability to measure electrode to skin contact resistance.
  • I need a step by step guide here. Cool circuit though, sounds like AC is the way to go, but the ADC on the PIC is DC?
  • wjcroftwjcroft Mount Shasta, CA
    Lots of HOW TO pages on simple Arduino GSR using DC,


    These are not using the MIT adaptive DC current control. I think the trick with AC would be to scale it so the AC peaks and valleys lay within the ADC converter range. And especially to track and adjust the drive and sensing as skin characteristics change over time. Might not be 'trivial'. MIT chose their circuit to work under all conditions / harsh conditions.

  • wjcroftwjcroft Mount Shasta, CA
    This EDN article shows the circuit and algorithms used by the Maxim dev kit GSR developer eval module. It is using AC drive.



    Cool module. Unfortunately costs about $190 on Digikey,


  • Awesome info William, thanks so much. I would love to throw down on an open source GSR circuit. I'm surprised adafruit or sparkfun doesnt have a I2C/SPI module already for this!
  • edited December 2017
    @wjcroft look! http://wiki.seeed.cc/Grove-GSR_Sensor/

    Would be great to make a shield or something that could measure this, or like a little plug in to the GPIO. If all we need is an analog input, we could make a little plug for the top of the open bci that just clips in, send an over the air command to the board, and boom, you are measuring and doing the math and such of the GSR. We could send these back to the computer in every sample, much of this work is already done in 3.1.0, with the board mode changing and such. This could even maybe work on the ganglion if the pins lined up the same.
  • Can GSR be measured using the ear clips or something?
  • wjcroftwjcroft Mount Shasta, CA
    edited December 2017
    GSR is best measured on skin areas that have more sweat gland activity. Such as finger tips, palms, etc. Ears 'might' work, but less typical and could be less effective.

    I did see the Grove / Seeed board previously. But it is a daughter board that plugs into their larger motherboard. Also could not find the circuit diagram or description. Meaning it is probably a simple minded DC setup.

    I do think the MIT guys have possibly an elegant and most accurate approach; that circuit would be easy to layout with just 2 op amps (probably one chip with dual op amps), some resistors and caps. Ideally you want something that just works without fiddling.

    If you looked at the description of the AC circuit and algorithms used by Maxim, I was blown away by how complex that was.
  • Hi,

    1.) as far as I know there is no study that did evaluate
    whether it can be measures at the ears. Ears only have 30-40 sweat
    glands per cm² comapred to 350 per cm² in the palms. Here is a study
    that compared 16 different sites. Besides fingers and feet, the forehead
    (175 / cm²) had a nearly similiar pattern:
    https://pdfs.semanticscholar.org/b467/fcaf02206d187a6e6471bc7521bb099ce50b.pdf
    however,
    GSR measurements on the forehead will probably interfere with eeg
    measurement as you are inducing electric current? not sure. probably can
    be filtered out easily.

    2.) It might also interests you that the
    MIT guys founded a company and sell their GSR wrist sensors at a high
    price: https://www.empatica.com/research/e4/

    3.) An earlier post
    mentioned that the g.tec USB amplifier can be used to measure GSR. We do
    this in our lab. You can purchase the gUSBamp and an additional GSR
    sensor from g.tec that is plugged into the amplifier via touchproof
    connections. Do you guys think that it will be safe to plug such a
    sensor into the openBCI cyton board or will it cause damage to the board
    or participant? I am not an electrical engeneer - so may you help me
    out? Here are some technical specifications (scroll down):
    https://shop.neurospec.com/gsr-sensor-kit

    Many thanks,
    Johannes

  • wjcroftwjcroft Mount Shasta, CA
    Johannes, wow, these are great finds and links. Thanks so much.

    The Empatica device, impressive! Wonder how well the wrist works versus the fingers. Yes one of the Empatica founders (Rosalind Picard) is author on the GSR paper.

    The g.tec will work, what is the price? Cyton is DC coupled, but Ganglion is not. Seems likely that g.tec would design something that is stable over time, possibly with a circuit like the MIT guys. The output is millivolt level, so you can adjust the scale factor on that channel and remove it from the SRB / reference bus. So you are using the + and - pins on that channel. Similar to how the tutorial does simultaneous EEG (microvolts) and EMG / ECG (millivolts).

    William
  • wtf, where's my 5 minute posting which I just submitted. Let's get serious about our collaboration software folks. I'm done here, bye.,

  • biomurphbiomurph Brooklyn, NY
    @jeyem I do believe that there is no problem to connect the g.tec sensors via touchproof connector. 
    The only thing to consider is that the analog power supply for the Cyton is +-2.5V (5V total). 

    Another way to go about it is to use the analog input pins of the PIC32, and build a simple voltage divider to measure GSR.
    The ADC on the PIC is 10 bit, so if that is not adequate then the inputs to the ADS can be used.

  • Okay, thank you! I will see if I get this to work. The most important thing for me was to be sure that the board will not be damaged.
Sign In or Register to comment.