Virtual Neurophysiology Workbench

The DIY Brain Lab! Developed to improve the accessibility of neuroscience education.

For these experiments, you'll need  the following items (for links to order many of these items, visit our "Useful Links and Other Resources" page):

To build your brain:*

  • One package of agar or gelatin
  • Water
  • A stove or electric kettle
  • A 1-2 quart container
  • Refrigerator

To simulate the neural signals and apply them to the brain:**

  • A computer with working headphone jack*
  • NEURON software
  • Matlab
  • One pair of earbud headphones with the earbuds cut off*

To record the signals from the surface of the brain:*

  • Backyard Brains Heart and Brains recording system
  • Backyard Brains Spike Recorder software or smart phone application
  • A computer or smartphone (this can be the same computer as is used for the simulations)

*If you are unable to purchase the Backyard Brains Heart and Brains recording system, you can still complete all of the simulations and play the audio files of your neural signals through any speaker or headphone set up you may have.  If you are doing this, you do not need to build a brain or cut any headphones.

**Even if you do buy the recording system, it may be fun to listen to the various neural signals you create!  Many neurosurgeons will record from the brain and listen to the neural signals to decipher where they are within the brain.  So try it out with a friend!  Make it a game!  See if you can tell the difference between the neurons you create and download only by what they sound like! Why do they sound different?  What changes did you make in the cell to change the signaling pattern? Why did that change the cell's behavior?  Post your findings, ideas, and questions here and discuss it with other virtual neurophysiologists!

This experiment will introduce you to the Virtual Neurophysiology Workbench set-up. We will walk you through creating your own computational model of a neural cell. Then, you will learn to use that model to simulate a real neuron in a physical brain model. Finally, you will learn how to record the electrical signals from your cell model from the surface of your brain. Estimated time: 3-4 hours.

Step 1

First, you'll want to set up your brain model. Follow the instructions on whatever agar or gelatin you've purchased and put the contents of the whole package into your 1-2 quart container. We use a brain mold, but any container will work.

If it's available to you or you can order it, agar is a bit better than gelatin (such as Jello), since it is more resistant to temperature fluctuations and is more comparable to real brain tissue.

Once in the refrigerator your brain should take 2-3 hours to set. Our final brain product is shown below.

IMG 1381 2

Step 2

While your brain model is setting up, you can start building neurons. Open the NEURON graphical user interface (GUI) (it may be named "nrngui" in your program files). Click "Build" and select "CellBuilder." It should look something like what you see below.

If you have never used NEURON before or would like a more detailed guide through building your own neuron model, please see our "Links and Other Useful Resources" page for a link to a step-by-step tutorial through the program.

Neuron CellBuild

Step 3

Within the CellBuild window, you can go through and build your cell, section by section. In the "Topology" section, you will draw each cell segment individually to create a neuron that looks exactly as you would like it to.

Our basic neuron with three dendrites and a single axon is shown below. Explore making more complicated shapes and neurons with different branching patterns! Don't forget to name your segments. neuron

Step 4

The "Subsets" section allows you to group segments by type. This will be helpful later if, for example, you have created a cell with a large number of dendrites and you do not want to have to change the geometry or biophysics of each dendrite individually.

Step 5

The "Subsets" section will also give you the option to allow sections to be parameterized in the biophysics section. Do this in the "Parameterized Domain Page" by selecting each subtree of segments and clicking "Create a SubsetDomainIterator."

You will want to create parameterized domains for each of your sections that you hope to stimulate/record from. Don't forget to save your neuron regularly!

Step 6

In the "Geometry" section, you can alter the length and diameter of each section. For now, set the length of each segment as 1000 and the diameter as 10. Later, you can play around with different settings to see what it does to your signal!

Step 7

The "Biophysics" section can feel a bit complicated, but it's not as scary as it looks! Here, you can set each segment to have passive, resistive, capacitive, and "hh" properties, the last of which we will explain in a moment. The passive, resistive, and capacitive components of neurons work in much the same way as with electrical circuits. For your first neuron, try just turning on the passive and hh components, but make sure to come back and explore was resistivity and capacity do to your signal propagation!

Hodgkin-Huxley properties, or "hh" properties as they are shown in NEURON are named after Alan Hodgkin and Andrew Huxley who studied the neurons in giant squid and were the first to mathematically describe action potentials. These properties are necessary for a neuron to send an electrical signal and involve the molecular components of how currents are generated within a neural cell. Basically, there are high concentrations of sodium (Na) outside your cells and high concentrations of potassium (K) inside your cells. When enough current is applied to a neuron either from another neuron or by an electrode, channels within the membrane of your neurons open, allowing transfer of these ions into and out of the cell. Because of the large differences in ion concentration between the inside of the cell and the outside of the cell, Na and K flow very quickly through the membrane, creating an electrical current, or action potential. This current then travels down the length of the axon and is transferred to the next neuron.

This electrical current within your body is referred to as bioelectricity and it is what we are recording when we look at neural signals. Your body is generating electricity all the time! It is the same kind of electricity you use in your house when you plug things into the wall, though at a much smaller scale. Just like you are sending an electrical message to your lights when you flip your light switch on, your brain sends electrical messages to your body when you want to move!

Note: Your neuron will only fire if you go into the parameterized domains for each of the subsections and change the distribution of potential and conductance over the length of each segment. This means that you are changing how the current is applied and carried through the segment. There needs to be a gradient to allow the signal to be propagated properly.

Step 8

In the "Biophysics" section of NEURON, some of your cell sections will be marked with an "x" before the name Go into the parameterized domain page for each of these sections. This is where you can change the potential and conductance distribution over the length of your cell. You can choose how you want your gradient to be applied by choosing one of the preset mathematical functions or by inputting your own.

Step 9

Once you have your cell built, you can stick an electrode in it and give it a shock! To do this, go to "Tools" then "PointProcesses," "Managers," and finally "Electrode." This will allow you to choose either a current controlled or voltage controlled electrode.

Current clamp is most realistic for this first basic experiment. In this window you can change the delay before stimulation turns on, where the stimulation is applied, for how long it is applied, and the amplitude of the current applied.

Step 10

To apply the current and look at the subsequent voltage signal, go to "Tools" and click "RunControl." This will give you a window that allows you to run the simulation.

Step 11

Finally, under "Graph," click "VoltageAxis." This will automatically plot the electrical potential at the center of your neuron in millivolts. Run a few simulations and see if you can elicit an action potential. It should look something like the plot below. defaultvOnce you have a functional neuron, you can listen to the signals and apply them to your agar brain! To do this, we will need to take the transmembrane currents—the electrical currents created by the flow of ions into and out of the cell—and convert those into audio files. We will then play those files through our speakers if we want to listen to them or through some severed headphone wires into our brain so that you can record your neural signal.

Step 12

To get the transmembrane currents that we need, right click your voltage plot and select "Plot What?" to select which segment to record from (you will likely want to choose the axon) and turn on tracking of Na, K, passive, and capacitive currents (ina, ik, ipas, and icap).

You may also want to change the color of each current type, so that they're easier to keep track of. Below is an example of all four currents on the same plot with ina shown in blue, ik shown in orange, ipas shown in green, and icap shown in brown. Positive current indicates ion flow out of the cell and negative current indicates ion flow into the cell. Notice the quick and drastic the Na flow.defaulti

Step 13

Now, save each of these currents to individual files. Unfortunately, there is no option for overall membrane current in the NEURON GUI, so we have to save each of them one at a time. To do this, right click the plot and click "Select Vector," then click on your chosen current once. It should flash red while your mouse is clicked and then go back to normal color. Then, on the main menu, go to "Vector" and "Save to File" to save it to a directory. Save all of the transmembrane currents for your simulation into a single folder that does not contain any other files. Give it a name that you will remember and that makes sense!

Step 14

Once you have saved all 4 files, input your directory name into the "VNW_simtosound1" Matlab code provided in our "Sample Code" page.

Step 15

Run the Matlab script with your directory name and you should be able to hear the signal from the cell you created!

If you want to change how many times your signal repeats, change the sig_L number.

Step 16

Now it's time to use your brain! Get your brain out of the refrigerator, take your severed headphones (or cut the earbuds off of a pair of old headphones if you haven't already), and stick them into the agar as shown below.

IMG 1384 Step 17

Open your Backyard Brains SpikeRecorder software, plug the recording system into your computer, and plug the orange recording cable into the recording system.

Step 18

Place 2 electrodes on the surface of your brain and connect the two red alligator clips at the end of the orange cord to the metal electrode buttons. The black clip can either be attached to a third electrode or inserted directly into the agar.

Step 19

In the recording software, clicking the settings gear and then the little plug button next to the port dropdown will allow the recorder to connect to the electrodes rather than the auxiliary port. The recording should look relatively flat. It may be beneficial to change the filter settings if your signal looks particularly noisy.

Step 20

Finally, with your volume turned up, run your simulation again in Matlab with the recording system on and record your neuron's signals! It should look something like the plot shown below.   Default recording Congratulations!  You have created, stimulated, and recorded your first neuron!

Comments powered by CComment


For answers to questions regarding experiments and other information presented as part of the Virtual Neurophysiology Workbench, we encourage you to go to the Q&A forums and take part in discussions with your peers.  There are separate forums for general questions and for troubleshooting various issues.

For all other inquiries please email Christopher Butson, PhD at or Shana Black at 

Thank you for your interest!