Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Neuron simulator

Make a nerve cell fire: the Hodgkin-Huxley model with pulses, steady currents and ramps. See spikes, gates, the refractory period and firing rates.

How to use

  1. Pick an experiment from the list, or set your own stimulus: one pulse, two pulses, a steady current or a ramp.
  2. The top chart shows the voltage across the cell membrane. A spike (action potential) jumps from about -65 mV to about +40 mV and back in about 2 ms.
  3. The middle chart shows the three gates that make it happen; the bottom chart shows the current you injected.
  4. Firing rate and current runs many steady currents and draws how fast the neuron fires.

Keyboard and touch

TabMove between tabs, lists, boxes and buttons
Enter in a boxRun again

Tips

  • Spikes are all-or-nothing: lower the current step by step and find the threshold where the spike suddenly disappears.
  • Just after a spike the sodium gate h is still closed and the potassium gate n is still open, so a second pulse fails: that is the refractory period.
  • A current that rises slowly may never cause a spike, because the gates have time to adjust. This is called accommodation.
  • The Hodgkin-Huxley neuron does not fire slowly: steady firing starts suddenly at about 50 spikes per second. The simple integrate-and-fire neuron can fire as slowly as you like.
  • The numbers come from a squid's giant nerve fibre at about 6 °C. Human neurons have more kinds of channels, but the idea is the same.

About this model

Alan Hodgkin and Andrew Huxley described in 1952 how a nerve fibre makes a spike, work that won the 1963 Nobel Prize. The membrane is a capacitor (1 µF/cm²) with three paths for current: sodium channels (up to 120 mS/cm², pushing towards +50 mV), potassium channels (up to 36 mS/cm², towards -77 mV) and a small leak (0.3 mS/cm², towards -54.4 mV). Sodium is open in proportion to m³h and potassium to n⁴; each gate opens and closes with rates that depend on the voltage. We use the standard modern form of their rate equations, with rest near -65 mV, and solve the four equations with the fourth-order Runge-Kutta method in steps of 0.01 ms. A spike is counted when the voltage rises through 0 mV.

The integrate-and-fire neuron has only the leak: the voltage climbs towards rest plus current ÷ leak, fires when it is 15 mV above rest, resets and waits 2 ms. Its rate is 1 / (2 ms + τ ln(RI / (RI − 15 mV))) with τ = C / gL. This is a teaching tool about how nerve cells work; it says nothing about any health condition. Everything runs in your browser.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product