Bioelectricity: Membranes, Action Potentials & Nerves

The electrical basis of life. Learn ion concentrations and the cell membrane, the Nernst equation and equilibrium potentials, the Goldman–Hodgkin–Katz resting potential, the membrane as an RC circuit, action potentials and the Hodgkin–Huxley model, conduction velocity and myelination, the cardiac conduction system and how the ECG arises — with Python computing Nernst and GHK potentials.

Every heartbeat, thought and muscle contraction is electrical. Cells keep different ion concentrations inside and outside, which creates a membrane voltage of about −70 mV. Opening and closing ion channels produces the rapid voltage spikes — action potentials — that carry information.

Understanding bioelectricity is essential for ECG/EEG/EMG instrumentation, pacemakers and defibrillators, neural stimulation, and brain–computer interfaces.

An analogy

A neuron's membrane is like a charged battery with thousands of tiny, voltage-controlled gates. When the voltage rises past a threshold, sodium gates flood open (the spike), then potassium gates let charge back out to reset the battery.

Why cells have a voltage

Sodium–potassium pumps keep K⁺ high inside and Na⁺ high outside. K⁺ leaks out through open channels, leaving negative charge behind, until the electrical pull balances the concentration push — the equilibrium (Nernst) potential. With several ions permeable, the resting potential is a weighted average (GHK).

Action potentials

A stimulus that depolarises the membrane past threshold (~−55 mV) opens voltage-gated Na⁺ channels: positive feedback drives V_m up to ~+30 mV within a millisecond. Na⁺ channels then inactivate and K⁺ channels open, repolarising the cell; a refractory period follows. Hodgkin and Huxley's 1952 model (Nobel Prize) describes this with gating variables m, h, n.

Conduction and the heart

Action potentials propagate along axons; myelin sheaths make them jump between nodes (saltatory conduction), reaching 120 m/s. In the heart, the SA node paces (~70 bpm), the AV node delays, and the His–Purkinje system spreads excitation. Cardiac action potentials have a long plateau (~250 ms) from Ca²⁺ currents, preventing tetanus.

From cells to body-surface signals and stimulation

Synchronous activity of many cells creates currents in the volume conductor of the body; electrodes on the skin record their potential differences — ECG (heart), EEG (brain, µV), EMG (muscle). The ECG lead axes (Einthoven's triangle) project the heart's electrical dipole vector. Stimulating devices (pacemakers, defibrillators, cochlear implants, deep-brain stimulators, FES) inject currents to trigger or reset excitation; strength–duration curves (rheobase, chronaxie) set pulse parameters.

Formulas

Worked example: Potassium equilibrium

Given: [K]_in 140 mM, [K]_out 5 mM, 37 °C

Find: E_K.

Answer: −89.1 mV

Worked example: Hyperkalaemia

Given: [K]_out rises to 8 mM

Find: New E_K.

Answer: −76.5 mV (cells depolarise — arrhythmia risk)

Worked example: Membrane time constant

Given: R_m = 10 kΩ·cm², C_m = 1 µF/cm²

Find: τ_m.

Answer: 10 ms

Nernst and GHK potentials

import math
# Nernst potentials and the Goldman-Hodgkin-Katz resting potential (37 C)
R, F, T = 8.314, 96485, 310.15
k = R * T / F * 1000                 # mV
ions = {"K+": (140, 5, 1), "Na+": (10, 145, 1), "Cl-": (4, 110, -1)}   # in, out mM, valence
for ion, (ci, co, z) in ions.items():
    print(f"E_{ion} = {k / z * math.log(co / ci):6.1f} mV")
pK, pNa, pCl = 1.0, 0.04, 0.45
num = pK * 5 + pNa * 145 + pCl * 4
den = pK * 140 + pNa * 10 + pCl * 110
print(f"GHK resting potential = {k * math.log(num / den):.1f} mV")
# E_K+ =  -89.1 mV
# E_Na+ =   71.5 mV
# E_Cl- =  -88.6 mV
# GHK resting potential = -72.5 mV

At rest the membrane is mostly permeable to K⁺, so V_m sits near E_K. During an action potential Na⁺ permeability increases ~20-fold and V_m swings toward E_Na (+71 mV). Raising extracellular K⁺ (hyperkalaemia) depolarises cells — dangerous for the heart.

Common mistakes

Applications

Key takeaways

Going further