Nerve impulses are electrical signals that propagate via action potentials, and occur when there is a change in the electrical potential of the neural membrane.
When neurons are not conducting impulses, these cells are at rest or have a resting membrane potential. At rest, the inside of the neuron is negatively charged (typically -70 mV) compared to the extracellular conditions. A resting neuron also contains a higher concentration of potassium and a lower concentration of sodium than a stimulated neuron. Because of this concentration difference between both ions, a gradient is established. To maintain this gradient, Na+/K+ ATPase protein pumps sodium out of the cell and potassium into the cell.
When a resting cell is stimulated, an action potential occurs, which is a rapid change in membrane potential because of changes in the flux of potassium and sodium ions inside and outside the cell. First, a stimulus causes the sodium channels to open. Because there is more sodium outside than inside, sodium diffuses into the cell. This causes the membrane potential to become less negative, or depolarized. Once the sodium channels close, the potassium channels open, and potassium ions diffuse out. The inside of the nerve cell's membrane becomes negative again. Every action potential is followed by a refractory period, during which another stimulus (no matter how strong it is) cannot produce another action potential. This is because sodium channels are in a temporary inactive state and will not open.