Backyard Brains Logo

Neuroscience for Everyone!

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

items ()

[Summer’16 Internship] Neuroscience of Grasshopper Jumps: A new naming system for database!

As I experiment on more and more little grasshoppers, I realize the importance of organization skills. Specifically, I’m talking about how messy my housekeeping of the recordings and analyses have been. In an earlier post, I wrote that my naming system for each grasshopper is in the following format: [day][month][letter indicating order in the day]. While a name of 2408A isn’t terrible, what my mentor Greg Gage came up with in a minute is significantly better. (And sitting down with him to discuss my preliminary results also jumpstarted the task of organizing folders and files and sharing in Dropbox.)

So, now each grasshopper has the following name format: G[number]-[month][day][year]-[test number]. So, G08-070816-01 denotes that the folder containing recordings belonging to the 8th grasshopper I’ve tested on, on the 8th of July in 2016, for the first test. A second or third test could follow, and new folders are made to keep the data for those tests. So my database is now much more organized:

While this log is not about building or experimenting or data, it’s about a skill that anyone, especially scientists, should have. I can imagine all sorts of problems if all my recorded m4a files stayed in the chaos from before: wrong data analyzed, data from different grasshoppers get mixed up, etc. Good thing I sorted this out before entering the point of no return.

By Dieu My Nguyen

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


By Patrick Glover

A longstanding debate in philosophy focuses on the existence of free will. Do humans have some inherent moral agency, or are our brains just biological machines, subject to the same physical determinism as any other animal? Modern neuroscience can provide some insight to these questions, such as Benjamin Libet’s famous 1986 experiments that correlate the EEG readiness potential (RP) with a subconscious decision to perform a voluntary action. In summary, before a subject performs a simple voluntary action (e.g. “Flex your wrist whenever you feel like it”), the secondary motor area generates a characteristic EEG potential over 300 milliseconds before the subject becomes aware that they are going to perform the action. If the brain had already been preparing to perform the action for nearly half a second before the individual consciously “decides” to perform the action, did the individual actually… decide? Since the paper was published, dozens of philosophers and scientists have attacked the paper’s methods, arguing that the claims made by Libet are overstretched and that the RP carries very little weight in the free will discussion. In the true spirit of open science, anyone should be able to recreate this experiment, both improving the quality of this debate with additional data, as well as furthering the general public’s understanding of neuroscience.

My project aims to allow the DIY community to participate in the discussion by recreating Libet’s experiment using just an Arduino and a simple open source shield.

Paper upon which this project is based: Neurophysiology of Consciousness 1993 Libet.pdf

Below are the complete instructions for this experiment, if you want to see the whole process (every step and attempt to achieve this project) you can check out the following logs:

For this Experiment you will need.

  • 1 × Arduino Uno
  • 1 × Backyard Brains EMG Spikershield
  • 1 × Backyard Brains Heart/Brain Shield
  • 1 × Headband
  • 2 × Snap fastener studs
  • 4 × EKG adhesive electrodes
  • 1 × Conductive electrode gel
  • 1 × MATLAB

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.

  1. 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
  2. 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.
  3. 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

By Patrick Glover

Zombie Snails experiment: Mindless Methodical Movement

Do you consistently think “breathe in, breathe out” or “left, right, left, right” when you’re walking? Unless you’re London Tipton ( to 6:02), you probably don’t. How is this possible? All humans have neural networks called central pattern generators (CPGs) that control rhythmic movements like breathing and walking. Unfortunately, it is nearly impossible to study this in humans, so we use mushy invertebrates that can show us these CPGs in real time. In the pond snail, Lymnaea stagnalis, there is a buccal CPG that regulates mouth movements, including feeding and laying eggs.

By anesthetizing the snail, implanting an electrode on one of these buccal neurons, observing its behavior and aligning it with the electrical activity, I will be able to see CPGs in action.

This project mainly replicates a 1999 paper by Jansen et al. that studies pattern generators in the buccal ganglia of freely behaving snails with a few tweaks of my own. The buccal ganglia is a group of neurons (ganglia) that controls buccal movements – any behavior related to the mouth. In regards to the freely behaving part, it’s very important in neuroscience for the subject to be freely able to move and behave of its own will in order to see the neurons acting in real time.

In theory, the project isn’t that difficult; put an electrode around a neuron in the buccal ganglia and watch the spikes occur at the same time the snail is eating. However, what’s most challenging about this project is the damn setup to get to the point of data collection. Jansen et al. used these 40 mm pond snails called Lymnaea stagnalis which are super cute but incredibly small for a first-time neuroscientist (think the size of your thumbnail).

The paper focused on data collection from three neurons in the buccal ganglia: the posterior jugalis nerve (PJN), the lateral buccal nerve (LBN), and the ventral buccal nerve (VBN) which can be seen in the picture shown. The LBN and VBN actually stem from the same neuronal branch and eventually split into their respective neurons, so for simplicity’s sake, I’m implanting my electrode around the initial branch for both nerves. **This has been updated to put the electrode on one of the esophageal trunks that control the movements of the esophagus.**

In terms of the buccal movement, snails rasp or scrape their toothy tongue called a radula across a surface, like a tank with algae or a piece of spinach, in order to collect food or clean. They rasp when they eat or, interestingly enough, when they lay eggs. The substrate that they lay their eggs on needs to be clean so they rasp it clean. Both of these movements are controlled by the buccal ganglia. The buccal ganglia stimulates the idea of “start rasping,” sends it down one of the neurons, like the LBN or VBN, which then stimulates a muscle that controls the radula to initiate rasping. Jansen et al. found that the electrical activity seen in the spikes changed in frequency and amplitude depending on the behavior at hand. More explicitly, when the snail was eating, the spikes occurred more often with large amplitude versus when the snail was cleaning to lay eggs, the spikes occurred less often and with a lower amplitude (see picture). Although this would be awesome to see for myself, due to time constraints, I will only be observing the electrical activity in accordance with feeding.

Below are the complete instructions for this experiment, if you want to see the whole process (every step and attempt to achieve this project) you can check out the following logs:

For this experiment you will need:

1 × Pond snailsLymnaea stagnalis, number depends on how many trials you do
1 × Tank with water, moss, and rocksFor keeping the snails happy and healthy in a good ecosystem!
1 × Magnesium chloride (MgCl2)50 mmol/L or 0.7g in 147g H20
1 × SyringeFor anesthetization, 3 mL or more
1 × Needle1 needle for each snail; can use the same syringe
1 × Microscope,40x-80x, 8 Watt LED lightsFor locating the neurons
1 × Dissection Minuten PinsFor pinning and locating the neurons, 0.1 mm in diameter
1 × WireStainless steel or wire, 25 micrometers in diameter, better if insulated
1 × Backyard Brains SpikerBoxAmplifies spikes so they can be heard
1 × Backyard Brains SpikeRecorder softwareShows a visualization of the spikes on a computer or mobile phone
1 × Snail salineSee Log 2 for the components
  • Step 1 sets up a safe and healthy environment for the snails! These are pond snails so in nature, they reside in bodies of water with slow moving current. This can be reproduced with a tank filled with 2 gallons of water (rule of thumb is 2 gallons per 20 snails), a bubbler to keep the water moving, rocks on the bottom and moss that floats on top to encourage good bacteria to grow, and a constant temperature area around 70F. The rocks and moss aren’t totally necessary but all my snails have been living very happily so I’d recommend it if you don’t have a lot of time to let an ecosystem build naturally.
  • Step 2 involves preparing the electrode for implantation. Take about 2 feet of your 25 micron-diameter wire, fold it in half, and wrap it around itself. Determine which end is going into the snail and the other will go into the channel of the SpikerBox.

    On the side going into the snail, start by removing the insulation from the ends to reveal the stainless steel wire beneath (my insulation was Teflon PFA and could be carefully burned away). Curl one end into a little hook and let the other one hang next to it but NOT touch. The hook will go around the neuron and the other will act as a ground electrode inside the snail’s medium.

    On the other end of the wire, make two more ends to attach onto the male RCA channel connection (if this is the side where the bend is, you can just cut that bend to make two wires). Again, remove the insulation from these ends as well. Using a voltage meter, figure out which end on this side is connected to the hook on the snail side. That one will attach to the smaller metal stand inside connector. The ground will attach to the taller metal stand. Finish the connections by soldering the wires to the connectors.

    **Note: I attached my electrode to two slightly larger wires that in turn connected to the RCA connector. It made things a little easier because the electrode wire was so small and could also be elongated using these wires.

    **Note: I also insulated my entire wire with silicone glue in case it was ever in touch with water; this is up to choice.

    **Reference: inspiration was taken from Cullins et al. 2010 paper.

  • Step 3 prepares the snail for surgery. Start by injecting the snail with 1.5-2 mL of magnesium chloride (50 mmol/liter) to anesthetize them. This should plump them up enough to have them hang out of their shell just a wee bit and allow for easier navigation of the neurons. From experience, make sure to use a really sharp needle or you will be frustrated for a long time!! A beveled needle used for injecting insulin should do the trick.

  • Step 4 involves the surgical process of cutting them open and locating the buccal ganglia below the radula. While the paper put electrodes around 3 neurons, I’m working with just 1 neuron, the lateral and ventral buccal nerve, which is a solid trunk at the ganglia but branches off into the respective nerves. Use lots of pins to specifically locate the ganglia and make sure it doesn’t disappear into the snail!

  • Step 5 is the implanting of the electrode onto the neuron. Place the hook electrode around either the ipsilateral or contralateral ET, glue it with spray super glue for easy drying, surround it in a Vaseline and mineral oil mixture, and let the connection ease back into the snail. Place the snail in a ringer solution or water with special minerals in it to help the snail heal (I used SmartWater that has a good amount of electrolytes for the snail). Leave the snail alone to heal for a day or 18-24 hours.

  • Step 6 is hooking up the electrode to the Backyard Brains SpikerBox and the SpikeRecorder software on the computer and watching the neuron spike away! These spikes should align with when the snail opens its mouth and rasps for food or cleaning.

    By Nancy Sloan