Log 11

A project log for ESP32 EEG

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

pP 04/08/2021 at 03:070 Comments

Got a really hacky setup for streaming 8 channels now by using two separate 4 channel boards, connected to the ESP32 on the same SPI port but with different select lines.

It was pretty easy to scale the code up to stream all 8 channels:

I only am using the DRDY from one MCP3912 to trigger data acquisition from both since it was easy to do in code, but I think that may explain some of the artifactual looking bursts on the 4 channels from the board that doesn't have it's own DRDY interrupt set (the bottom 4 signals), since if there is just a small difference in clock speeds/sampling rates between the boards then it may try to read an empty register or miss a sample or something. It could also be that the SPI lines may be getting close to overloaded with all the wiring inductance and breadboard capacitance I needed to split it to two separate boards. Looks like I may be capturing some theta activity on the left temporal electrode (top right signal), but I'm not sure if that is also some sort of artifact. I actually split the Cz electrode to both boards, row 2 column 2 and row 3 column 1 are the same electrode, but they have different references (board one is referenced to C3 and board two is referenced to C4) which is probably why they don't look the same at all. I also only used the driven ground from board one because ground currents through my head sounds like a bad idea and I only have one ear-clip anyway.

This was more of an experiment to just see what issues would arise when trying to put two MCP2912s on the same SPI bus, and what the best way to read from and reference them would be. I think my next step will be to design a single board that has all 8 channels (so 2 MCP3912 ICs) on it as well as the headers to mount the ESP32 dev board directly to it, and a battery charging circuit. I'll be satisfied with 8 channels to play with moving forward with some BCI applications, so the stackable board idea might be a bit too much, and just a single board that contains 8 channels and the MCU and the power circuit would be simple and elegant I think, especially with a 3D-printed enclosure to hold it and a battery on the headset. I also don't think the impedance measurement circuit is worth it, it takes up a lot of board space and GPIOs, and it's pretty easy to tell without it whether a channel is making good contact just by the signal. Also I do too much impedance testing in my day job.