Analog EEG Amp

From Noisebridge
Jump to navigation Jump to search
The analog EEG amp.

This analog EEG amplifier was donated to Noisebridge a couple of years ago. It is a medical-grade amp, probably used for clinical monitoring purposes. Since we've currently only tested the output by looking at noise through the fairly rudimentary electrodes shown, we don't have a good idea, at present, of the signal quality, but it should be in reasonably good shape. Electrodes die quickly in EEG and amps usually live substantially longer, but it's definitely possible that some of the channels will have artifacts or noise issues. Probably it will still amplify EEG signal sufficiently well to serve as an actuator for other projects.

Post to the neuro mailing list if you want to get involved.

Goals and Milestones[edit]

The current working goal is to accomplish analog to digital conversion of the amp's output with a reasonably consistent sampling rate, and to output this to USB. Then we should get one of the NB desktops set up with software to process and interpret the signal in real time so it can be used as an actuator. The test task will be using some EEG signal (probably beta power) to buzz open the door to noisebridge. The API for the door is already in place. Here are some steps along the way.

  1. Verify that amp outputs signal and that this signal is correctly modulated by the hardware controls.
    • Check signal amplification levels and multipliers
    • Check high and low pass filters
    • Connect a human with properly gelled electrodes and check to make sure blink artifacts are clearly visible in the amp signal.
      • We could do this with the single metal electrodes you see in the amp image. They are attached directly to bare skin with medical tape and can be filled with electrode gel using a blunt syringe. We have some at Noisebridge, I will check the diameter and make sure that's written here so we can easily buy more. --Hurtstotouchfire 02:51, 12 May 2012 (UTC)
    • Connect a human with properly gelled electrodes and check to make sure basic EEG signal comes through.
      • This can in theory be done with the single metal electrodes if used on the forehead.
      • It would be best to test this with the cap.
      • Alpha power would be a good first test
      • We could also test the photic stimulator and do some SSVEP. I will try to remember to photograph the photic stimulator and add it to this page. --Hurtstotouchfire 02:51, 12 May 2012 (UTC)
  2. Build and program a microcontroller that correctly interprets and digitizes the analog signal output.
    • The analog signal consists of both positive and negative voltages and we need both.
    • There is a voltage range and accuracy requirement for this signal. We should determine what that is.
  3. Ensure that the ADC process includes a stable sampling rate.
    • I have been told this will require oscillators. Any specific proposals? --Hurtstotouchfire 01:48, 12 May 2012 (UTC)
  4. Pipe digital signal into real time EEG software.
    • Suggestions for software below. Must run on linux.

Volunteer your brain[edit]

We have a pretty decent passive 19 channel cap but unfortunately we bought a size small, so we should start taking a roll call on head circumferences. We need =<54 cm and preferably short hair (washing out electrode gel is not exactly fun).

EEG Analysis & Processing[edit]

We can pull some ideas for this from the OpenEEG page.

ADC Conversion[edit]

Currently we have slapped an arduino on there and we're just sampling from the analog pins. Here's a Dropbox folder with the code and CSVs of time-stamped output values. I started setting up a [github repo] but I'm not using it yet. Soon I swear.

Here's the current code (AnalogRead2 sketch in the dropbox folder):

void setup()
{
Serial.begin(9600);
}

void loop()
{
  unsigned long micro = micros();
  int zero = analogRead(0);
  int one = analogRead(1);
  int two = analogRead(2);
  String res = String(micro) + ",0," + String(zero) + "," + String(one) + ","+ String(two) + ",";
  Serial.println(res);
  delay(1);
}

And sample output:

40704624,0,0,0,0,
40724928,0,51,113,90,
40749472,0,0,42,7,
40770836,0,0,0,5,
40791128,0,59,114,85,
40815672,0,0,46,10,
40838080,0,0,0,0,
40858376,0,51,105,106,
40883972,0,0,0,12,
40905328,0,0,0,12,
...

I have graphed raw output (no timestamps) in the past and plotted it and it looked like the absolute value of a sine wave (we're looking for the 60hz line noise as a basic test) but now that I'm trying it again it looks more like the negative values are getting zeroed. I will parse and plot the timestamped data soon and post the results of that. --Hurtstotouchfire 02:51, 12 May 2012 (UTC)

Hack Log[edit]

Priors[edit]

Kurtis, Jake and I have spent some time with an arduino, sampling from the analog pins and outputting to CSV. The results of that are above, under ADC Conversion.

10 May 2012, Kelly & Nima[edit]

We hooked up the amp to an oscilloscope and just tried plugging in a couple electrodes and grounding and ungrounding them. We were able to get a nice line noise signal and verify that the signal multipliers do something. I was not impressed by the analog filters, though we forgot to test the 35 low pass when we had that nice sine wave going, and when we tested it the signal was much noisier. It is normal to get enormous noise and signal drift when you just have an electrode that you're waving around. The strongest signal at that point is line noise. I tried putting the electrode next to my eye ungelled but either it needs the gel or the oscilloscope is just bad at rendering low-frequency voltage shifts because we didn't see any obvious evidence of the blink dipole. Maybe Nima can add if he got anything done after I left. --Hurtstotouchfire 02:58, 12 May 2012 (UTC)