Log 7

A project log for ESP32 EEG

Heavily inspired by OpenBCI, especially their ganglion board design, but with an ESP32 handling communication/control

PrestonPreston 03/25/2021 at 03:020 Comments

Started debugging the impedance measurement circuit. It was simple to get it up and running, and it works well enough for telling open channels from connected, but not for much more than that. The OpenBCI code applies a square voltage wave across the load and measures the voltage drop from the current through a 100 ohm shunt resistor which is amplified and goes to an ADC (see circuit schematic below; 'IMP_SIG' goes through the load to the driven ground and 'uA_SENS' goes to the ADC).

DAC square wave output (measured with open circuit load):

and next the signal the ADC sees for the open circuit:

and what the ADC sees for a 33 kohm resistor:

Now if you're thinking "but wait, EEG channels are mostly a capacitive load, so how are you gonna run a square wave through that without crazy ringing," well, here's the output with a 33nF cap in parallel with a 1Mohm resistor (or roughly 30 kohms impedance at the measurement frequency):

... So yea I'm not expecting to make very accurate measurements with this implementation, but it is probably good enough to just tell me if I need to adjust an electrode to make better contact, and optimizing impedance isn't super important for dry electrodes anyway. I also may try to implement a sinusoid waveform at some point with a hardware timer interrupt, which would hopefully clean up this ringing, but for now I'm ok with this. So with the impedance measurement circuit more-or-less validated the whole board checks out. 

Next tasks will be to try to get a better communication protocol set up (so that I can eventually process/display more than just 4 channels of data at a time) and to design an enclosure and a secondary PCB to hold the dev board on the headset with a battery/charging circuit, and some logic so I can add more channels without needing to burn any more GPIOs on addressing impedance switches. I think it's also probably about time to get another round of boards with the fixes from the first revision and with some gold plating. Once I have 8 channels running I'm planning to start figuring out a headset design that will allow me to implement a laplacian referencing scheme over each motor cortex (basically putting three electrodes in a triangle with the 4th in the middle of them, and subtracting the signals from the peripheral electrodes to filter out low spatial frequencies), which will hopefully give me the boost in SNR that I need to really be able to control stuff.