Backyard Brains Logo

Neuroscience for Everyone!

+1 (855) GET-SPIKES (855-438-7745)

items ()

[Summer’16 Internship] Arduino, EEG, and Free Will: Finally Working!

Now that I’ve got the ear clip unipolar EEG set up, I’m finally ready to record. I have my subject wear two headbands: one around the head like a normal sweatband and one under the chin and over C3 like in my previous experiments. I had to do a quick test to get the polarity of the electrodes labeled, but now I’ve got a decent setup working. Positive electrode goes over C3, negative goes on the occiput, and the ground gets clipped to the ear. The subject also wears an anti-static cuff, with the alligator clip attached to the barrel jack of the Heart and Brain shield. Here is some preliminary data:

It’s been a good week! Still plenty of work left to do, since there are some issues with alpha waves, and the RP tends to peak slightly after the action itself. Still, this is some exciting progress. I’m using Audacity to manually crop out epochs that occur during enormous DC spikes that max out the recording software. These huge spikes are obviously not EEG data and probably static discharge or issues with grounding. I’m currently working on writing some MATLAB code to automatically remove these trials consistently.

The next step is to verify these initial results using a lot of additional trials. Also I plan to add two more EEG channels to provide some spatial data about the propagation of the readiness potential.

By Patrick Glover

[Summer’16 Internship] Arduino, EEG, and Free Will: A big “duh” moment

I had been searching for a readiness potential for weeks, trying to sift through noise two orders of magnitude louder than the signal itself, with little success. This morning Greg, my research mentor, pointed out that since I’m using a bipolar electrode EEG, the op-amp is only magnifying the difference between the two leads over my secondary motor area, which happen to be just a few centimeters apart. The signal between the two electrodes is practically identical, which means I won’t be picking up much of anything. Instead, I want to amplify the difference between a lead over the SMA and another lead on some more neutral part of the head.

To do this, I’m placing one electrode over C3, a second electrode on the base of my occiput, and a reference electrode clipped to my left ear. Instead of buying medical grade EEG ear clips, I soldered two washers to a copper alligator clip.

Currently in MATLAB, I’m applying a 0.25 – 64 Hz bandpass Butterworth filter. This seems to be a good range for recognizing slow cortical potentials. I kept picking up EKG pulse artifacts when I used two grounds (one on my hand for EMG, one on my mastoid for EEG), so I’ve removed the EMG ground, which eliminated EKG as well as most cross-talk between the two channels.

By Patrick Glover

[Summer’16 Internship] Arduino, EEG, and Free Will: First steps

Many EEG experiments are done using 21 electrode helmets to gain better localization resolution. In our case, this will not be necessary. Since the secondary motor area generates the readiness potential, the strongest RP signal is found immediately over that region, contralateral to the side of the body performing the task. In our case, the right hand is used, so our two electrode EEG headband will be positioned over C3 and Cz, according to the 10-20 chart.

The RP has an amplitude of 1/10th that of an alpha wave, so there will be no way for a human to look at a recording and see the RP building before a wrist flex. We’re hunting for a tiny signal in a lot of noise, so the RP will only be visible after a ton of averaging.

I’ve got the device built: It’s just an Arduino with the Backyard Brains Heart/Brain Shield and the Muscle Shield stacked on top. Analog data from both shields is converted to digital by the Arduino and sent to the computer by USB, where I’m using the free Backyard Brains Spike Recorder software to visualize and record both channels. There are a lot of issues with RF noise, so I’ve had to look around for a good location away from fluorescent lights and power cables. Perhaps an anti-static wristband would be useful.

I’m using MATLAB to process the recording, recognize the muscle spikes, and average the EEG signals before and after the onset of the action. This is the tricky part for me, since I have very little experience programming in MATLAB.

Debugging and free coffee

Initial results from my first test were… underwhelming. There were a ton of artifacts in the signal. Among these were EOG (electrooculography) and static discharge.

The eye is a dipole, with the cornea being positive and the retina negative. Electric fields caused by movement of this dipole can result in huge artifacts in scalp potential recordings. There are a few ways to control for this. The first option is to manually remove individual trials that are polluted by EOG movement. The second way is to place additional electrodes around the orbital bone and record two channels of EOG movements while also recording EEG on the scalp. Then we would use some algorithm to subtract EOG movement artifacts from the EEG signal afterwards. Alternatively, I could instruct the subjects to fixate their eyes on a certain point. The issue with this method is it requires the subject to put extra attention on maintaining their eye position, which is a bad confounding factor if our experiment has to do with conscious decision making. The best low-tech solution to this issue is… to have subjects close their eyes. It’s not perfect, as the eyes tend to slowly drift when the eyelids are closed, but the reduction in movement is good enough for these purposes. Also alpha waves tend to pollute the signal when the subject’s eyes are closed, so my solution to that is to offer subjects free coffee. Caffeine is a known suppressor of alpha wave production, and plus it entices people to volunteer to participate in the study.

The issue of static is harder to deal with. Wearing an anti-static cuff only gets you so far. Putting down an anti static mat also helps a bit, but there’s still a fair deal of DC drift in the signal. Part of me is convinced EEG has a fairly significant voodoo component to it….

By Patrick Glover