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
- Nernst equation:
E = (RT/zF)·ln([C]_out/[C]_in) (≈ 61.5·log₁₀ ratio mV at 37 °C, z = 1) - Goldman–Hodgkin–Katz:
V_m = (RT/F)·ln[(P_K K_o + P_Na Na_o + P_Cl Cl_i)/(P_K K_i + P_Na Na_i + P_Cl Cl_o)] - Membrane RC:
C_m·dV/dt = −Σ g_i(V − E_i) + I_stim - Time constant:
τ_m = R_m·C_m - Hodgkin–Huxley currents:
I_Na = g_Na m³h(V − E_Na); I_K = g_K n⁴(V − E_K)
Worked example: Potassium equilibrium
Given: [K]_in 140 mM, [K]_out 5 mM, 37 °C
Find: E_K.
- 26.7 mV × ln(5/140)
Answer: −89.1 mV
Worked example: Hyperkalaemia
Given: [K]_out rises to 8 mM
Find: New E_K.
- 26.7 × ln(8/140)
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.
- 10e3 × 1e-6
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 mVAt 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
- Wrong: Assuming resting potential equals E_K. — Right: Na⁺ and Cl⁻ permeabilities pull it up (GHK).
- Wrong: Ignoring temperature in Nernst. — Right: RT/F changes ~0.3%/°C.
- Wrong: Thinking large ion flows occur at rest. — Right: Tiny charge movements set the voltage; concentrations barely change.
Applications
- ECG, EEG, EMG: Recording bioelectric signals non-invasively.
- Pacemakers & defibrillators: Electrical stimulation of the heart.
- Neuroprosthetics: Cochlear implants, deep brain stimulation, BCIs.
- Drug safety: Ion-channel screening (hERG) to avoid arrhythmias.
Key takeaways
- Nernst: E = (RT/zF)ln(C_out/C_in).
- GHK weights ions by permeability.
- Action potentials: Na⁺ in, K⁺ out, threshold and refractory period.
- Bioelectric signals underlie ECG/EEG/EMG and stimulation devices.
Going further
- Cable equation: Space constant λ = √(r_m/r_i) for passive spread.
- Cardiac tissue models: Bidomain equations for arrhythmia simulation.
- Optogenetics: Light-gated ion channels to control neurons.