Assembly of the recording device is quite simple. The EMG and EEG signals each come from their respective Arduino shields, both sold by Backyard Brains fully assembled. If you're interested in building everything from scratch, the schematics are online here and here.
- Insert the Heart/Brain shield directly down onto the Arduino so that all the male pins fit into the board's female ports. We want the EEG signal being sent out on channel 1, so short the two pins on analog 1 on the Heart/Brain shield
- Our goal is to stack all three boards, but the signal output jacks on the Heart/Brain shield block the EMG shield from fitting effectively. To fix this, we simply add pin header extenders to all the EMG shield's pins. The boards should stack without any issues. We want EMG signal on channel 2, so short both pins on analog 2 on the EMG shield.
- Once the shield stack is assembled, load the spike recorder code onto the Arduino, found here. Also, download the free Backyard Brains Spike Recorder software.
Here is the final product
The next step is to make a bidirectional, one channel EEG headband. To do this, take an elastic headband and insert two snap fasteners roughly 4 cm away from each other on the midline of the band. Any type of headband should work, but avoid any with metallic paints or patterns.
On your subject, secure the headband vertically on the front of their head so that the flat faces of the two metal studs are on C3 and Cz.
Apply a dab of electrode gel underneath each lead to help conduct signal. This is especially important for subjects with longer hair. Place a single electrode on the left mastoid process. This will be our reference electrode.
Place one electrode on the back of your subject's right hand, and two on the inside of their forearm, spaced around 15 cm apart, right over the ulnar nerve.
Plug in an orange muscle electrode cable to each of the shields, and attach alligator clips to your subject. On the EMG board, connect the black clip to the back of the hand, and red clips to the ulnar nerve electrode. On the EEG board, connect the black clip to the mastoid electrode and the red clips to the electrodes on the headband. Polarity is not important.
Connect your Arduino to the computer over USB, and open the Spike Recorder app. In settings, connect to the USB modem by selecting it in the drop down menu and clicking the plug icon. Once connected, go back to settings and select two channels. You can also adjust band pass filter settings as needed. You are almost ready to begin recording data.
Verify that your signals are EEG and EMG. To do this, have your subject relax their arms on a table, and have them flick their wrist several times. You should see one channel showing significant spiking any time the subject does this. In this particular recording, EEG signals are harder to verify. The presence of alpha waves is greatly diminished over this region of the scalp. One way to verify the signal is valid is to have your subject quickly direct their eyes up and then return to the center. The head should not move - only eyes. Have them look down, center, left, center, right, center. The EEG should register electroocular artifacts. If your resting signal looks similar to below, you may proceed with the test.
Have your subject sit upright and look straight ahead, arms resting on the table. Click the record button on Spike Recorder. Instruct them to briefly and deliberately flick their right wrist any time they feel like doing so. Flicks should be at least four seconds apart. They should not fall into a mindless rhythm -- each flick should be intentional. Record as many trials as you see fit, although I've noticed I only get a decent response when I'm looking at at least 100 flicks. Click the record button to finish your recording. The software will tell you where it saved the file.
Find the .wav file (It's in /User/Music/Spike Recorder on Mac) and copy it into your MATLAB project folder. In the runRP MATLAB script, change the file name on line 1 to the name of the file you would like to analyze. In the command window, type runRP. The script will return several figures. All MATLAB code can be found here https://github.com/patrick-glover/EEG-Code