|Measuring Electrode Impedance Using the ADS1299's "Lead Off" 6nA Current Source|
Impedance from Voltage and Current: The main idea with measuring the impedance of the electrode-to-skin interface is for the EEG system to inject a known current through the electrode and to measure the resulting voltage difference. Since V = I*R, you can easily compute impedance "R" by taking the measured voltage "V" and dividing by the known current "I". Pretty easy, right? Well, how do you inject the current? And how do you measure the voltage across the electrode-to-skin interface?
Injecting the Known Current: The core of the OpenBCI board is the ADS1299 integrated circuit from Texas Instruments. It has a feature called "Lead Off Detection" that does this trick of injecting a known current into each electrode. As you can see in the figure above, a very small current (shown as 6 nA) is forced into the electrode line by a current source built into the ADS1299. So, no matter how much resistance or impedance is between the current source and ground (within reason, of course), the system forces 6 nA through the electrode to ground.
What is Ground? Unless you are sitting in salt water or touching something big and metal, it is unlikely that your body is connected to ground. To address this, an EEG system often provides an extra connection in addition to the regular electrodes. This extra connection is usually called something like "bias", or "driven ground", or "driven right leg (DRL)". The purpose of this connection is to keep your body's DC voltage level within an acceptable range and to keep any common-mode AC signals in your body minimized. Therefore, the bias line will act to source or sink whatever current as necessary (within reason) to minimize your DC and common-mode AC signals. As a result, for the 6nA current that we are injecting, "ground" is the bias driver, as shown in the figure above.
|Making a Mental Model of Where the Current Goes|
Measuring Just the Electrode-to-Skin Voltage: If the bias driver is our ground, the figure shows one way to model where the current goes. Note that the current passes through several unknown impedances on its way to ground. How do we evaluate just the impedance of the "+" electrode's interface to the skin? The answer is to remember that an EEG system measures the voltage between its "+" input and its reference (or "-") input. Because of the high-input impedance of the differential amplifier, no current flows into the "-" electrode line, so none of its impedance elements matter (for the purpose of this measurement). Therefore, we can easily measure just the voltage drop across the first three elements -- the 5K in-series resistor, the electrode-to-skin impedance, and the impedance of a portion of the human body. Because the series resistor is known, and because the impedance of the body is too small to matter, we have only one unknown remaining -- the impedance of the electrode-to-skin interface.
Calculating the Impedance: The model above shows the electrode-to-skin interface as a simple resistor. While this is not quite right (it does have a capacitive component as well), we can use this model to roughly estimate the number we need. Following from the basic V = I*R, we shuffle the terms to get R = V/I. We know both "V" (the measured voltage drop) and "I" (the known 6 nA current), so we easily get "R". In my case, I'm measuring the voltage as and RMS value, whereas the 6 nA current is an amplitude not rms value. So, my calculation must includes a factor of sqrt(2) to convert RMS into amplitude:
R = (Measured Voltage * sqrt(2))/(Known Current)
Finally, remember that the "R" here is the the series resistance of the electrode-to-skin interface plus the 5K resistor built into the OpenBCI board. So, to get the impedance of just the electrode-to-skin interface, you need to subtract 5K.
Testing on OpenBCI: To confirm that this all works in real life and not just on paper (or, um, just on a blog page), I used one of my OpenBCI boards to test it out and confirm that it works. The simplest test that I could devise was to use clip leads (see picture below) to jump together the electrode connectors. Specifically, I connected four of the "+" electrode connectors to the single reference (ie,"-") electrode connector, which is then jumped to the bias electrode connector. This configuration eliminates all of the electrode-to-skin impedances and the human body impedances. The only impedances remaining are the 5K series resistors. Hopefully, when I do my voltage measurements and divide by the 6 nA current, I'll get a number close to 5K.
|Testing the Impedance Measurements on an OpenBCI V1 Board.|
The colored wires are directly connecting (ie, shorting) the electrodes
to the reference electrode and to the bias electrode.
Configuring for the Test: Because I only had a few clip leads, I could only jumper four of the eight "+" electrode connectors. As a result, when I ran OpenBCI, I only activated channels 1-4. I configured the "Lead-Off Detection" settings to generate a 6 nA current source at a frequency of 31.2 Hz. I then started to activate the current sources on the "P" side of each EEG channel. I saw that I could activate and deactivate the signal on any given channel without affecting the signals seen on the other channels. Excellent.
|Screenshot of the OpenBCI GUI when running an impedance test on channels 1-4. Click to zoom.|
Note that ~31 Hz test signal is present in the first four channels
and that the resulting per-channel impedance is 5.4-5.8 kOhm.
Results: With all four current sources active, I got the results seen in the screenshot above. As you can see (click to enlarge), a 31 Hz signal is present in the first four channels. You can see this in the time-domain montage on the right and in the frequency spectrum plot in the bottom-left. On the time-domain plot, you can see that my labels indicate that the voltage induced on each EEG channel is between 23.0 uVrms and 24.5 uVrms. Using my equation from a few paragraphs back, this yields impedance estimates of 5.43 to 5.77 kOhm. Since I'm expecting to see the resistance of each channel's 5 kOhm resistor, this corresponds to an error of 9-15%. Given that the ADS1299 datasheet says that the "known" current is only known to +/- 20%, I find my result to be very satisfying. I'm feeling pretty happy right now.
Super-Advanced Topics: With the method described above, you can measure electrode-to-skin impedance of the electrodes attached to the "P" inputs of this system. The question remains on how to measure the impedance of the reference electrode (which is attached to the "N" inputs) and of the bias electrode. The short answer for the reference electrode is that you can use the similar ADS1299 feature for the "N" channel (as long as you do not use SRB1 as a cheater way to mux the REF to all of the "N" inputs, which is what we do in OpenBCI V1). And the short answer for the bias electrode is that the ADS1299 can detect if it is attached, but it cannot measure its impedance. Luckily, the impedance of the bias electrode is not as relevant.
Overall Success: So, I'm feeling pretty good about getting this impedance measuring to work. The code for implementing this has been pushed to the OpenBCI GitHub. The next step is do do some impedance measurements using actual electrodes on my actual head. Look for a follow-up post!
Follow-Up: I measured the impedance using disposable ECG electrodes as well as re-usable gold cup EEG electrodes. You can see the results here:
Follow-Up: I linked this post to answer a question on the Texas Instruments user forums (regarding the Texas Instruments ADS1299 chip at the heart of OpenBCI). This post was recognized by TI for a TI Community Award, Aug 2015. Thanks, TI!