# Cardiac pacemaker

The cardiac pacemaker is the heart's natural rhythm generator. It employs pacemaker cells that produce electrical impulses, known as cardiac action potentials, which control the rate of contraction of the cardiac muscle, that is, the heart rate. In most humans, these cells are concentrated in the sinoatrial (SA) node, the primary pacemaker, which regulates the heart’s sinus rhythm.
Sometimes a secondary pacemaker sets the pace, if the SA node is damaged or if the electrical conduction system of the heart has problems. Cardiac arrhythmias can cause heart block, in which the contractions lose their rhythm. In humans, and sometimes in other animals, a mechanical device called an artificial pacemaker (or simply "pacemaker") may be used after damage to the body's intrinsic conduction system to produce these impulses synthetically.

## Control
### Primary pacemaker

The sinoatrial node (SA node) is the primary pacemaker of the heart. It is a region of cardiac muscle on the wall of the upper right atrium near to the superior vena cava entrance. The cells that make up the SA node are specialized cardiomyocytes known as pacemaker cells that can spontaneously generate cardiac action potentials. These signals are propagated through the heart's electrical conduction system. Only one percent of the heart muscle cells are conductive, the rest of the cardiomyocytes are contractile.
The pacemaker cells are connected to neighboring contractile cells via gap junctions, which enable them to locally depolarize adjacent cells. Gap junctions allow the passage of positive cations from the depolarization of the pacemaker cell to adjacent contractile cells. This starts the depolarization and eventual action potential in contractile cells. Having cardiomyocytes connected via gap junctions allow all contractile cells of the heart to act in a coordinated fashion and contract as a unit. All the while being in sync with the pacemaker cells; this is the property that allows the pacemaker cells to control contraction in all other cardiomyocytes.
Cells in the SA node spontaneously depolarize, ultimately resulting in contraction, approximately 100 times per minute. This native rate is constantly modified by the activity of sympathetic and parasympathetic nerve fibers via the autonomic nervous system, so that the average resting heart rate in adult humans is about 70 beats per minute.

### Secondary (AV junction and Bundle of His)

Impulses from the sinus node reach the atrioventricular node which acts as the secondary pacemaker. The cells of the AV node normally discharge at about 40–60 beats per minute, and are called the secondary pacemaker.
Further down the electrical conducting system of the heart is the Bundle of His. The left and right bundle branches, and the Purkinje fibers, will also produce a spontaneous action potential at a rate of 30–40 beats per minute, so if the SA and AV node both fail to function, these cells can become pacemakers. These cells will be initiating action potentials and contraction at a much lower rate than the primary or secondary pacemaker cells.
The SA node controls the rate of contraction for the entire heart muscle because its cells have the quickest rate of spontaneous depolarization, thus they initiate action potentials the quickest. The action potential generated by the SA node passes down the electrical conduction system of the heart, and depolarizes the other potential pacemaker cells (AV node) to initiate action potentials before these other cells have had a chance to generate their own spontaneous action potential, thus they contract and propagate electrical impulses to the pace set by the cells of the SA node. This is the normal conduction of electrical activity in the heart.

## Generation of action potentials

There are three main stages in the generation of an action potential in a pacemaker cell. Since the stages are analogous to contraction of cardiac muscle cells, they have the same naming system. This can lead to some confusion as phases one and two are absent, leaving only phases zero, three, and four.

### Phase 4 – Pacemaker potential

The key to the rhythmic firing of pacemaker cells is that, unlike neurons, these cardiomyocytes will slowly depolarize by themselves and do not need any outside innervation from the autonomic nervous system to fire action potentials.
In all other cells, the resting potential (-60mV to -70mV) is caused by a continuous outflow or "leak" of potassium ions through ion channel proteins in the membrane that surrounds the cells. However, in pacemaker cells, this potassium permeability (efflux) decreases as time goes on, causing a slow depolarization. In addition, there is a slow, continuous inward flow of sodium, called the "funny" or pacemaker current. These two relative ion concentration changes slowly depolarize (make more positive) the inside membrane potential (voltage) of the cell, giving these cells their pacemaker potential. When the membrane potential gets depolarized to about -40mV it has reached threshold (cells enter phase 0), allowing an action potential to be generated.

### Phase 0 – Upstroke

Though much faster than the depolarization of phase 4, the upstroke in a pacemaker cell is slow compared to that in an axon.
The SA and AV node do not have fast sodium channels like neurons, and the depolarization is mainly caused by a slow influx of calcium ions. (The funny current also increases). Calcium enters the cell via voltage-sensitive calcium channels that open when the threshold is reached. This calcium influx produces the rising phase of the action potential, which results in the reversal of membrane potential to a peak of about +10mV. It is important to note that intracellular calcium causes muscular contraction in contractile cells, and is the effector ion. In heart pacemaker cells, phase 0 depends on the activation of L-type calcium channels instead of the activation of voltage-gated fast sodium channels, which are responsible for initiating action potentials in contractile (non-pacemaker) cells. For this reason, the pacemaker action potential rising phase slope is more gradual than that of the contractile cell (image 2).

### Phase 3 – Repolarization

The reversal of membrane potential triggers the opening of potassium leak channels, resulting in the rapid loss of potassium ions from the inside of the cell, causing repolarization (V$_m$ gets more negative). The calcium channels are also inactivated soon after they open. In addition, as sodium channels become inactivated, sodium permeability into the cell is decreased. These ion concentration changes slowly repolarize the cell to resting membrane potential (-60mV). Another important note at this phase is that ionic pumps restore ion concentrations to pre-action potential status. The sodium-calcium exchanger ionic pump works to pump calcium out of the intracellular space, thus effectively relaxing the cell. The sodium/potassium pump restores ion concentrations of sodium and potassium ions by pumping sodium out of the cell and pumping (exchanging) potassium into the cell. Restoring these ion concentrations is vital because it enables the cell to reset itself and enables it to repeat the process of spontaneous depolarization leading to activation of an action potential.

## Clinical significance
### Damage to the SA node

If the SA node does not function, or the impulse generated in the SA node is blocked before it travels down the electrical conduction system, a group of cells further down the heart will become its pacemaker. This center is typically represented by cells inside the atrioventricular node (AV node), which is an area between the atria and ventricles, within the atrial septum. If the AV node also fails, Purkinje fibers are occasionally capable of acting as the default or "escape" pacemaker.

### Ectopic pacemaker

An ectopic pacemaker also known as an ectopic focus or ectopic foci, is an excitable group of cells that causes a premature heart beat outside the normally functioning SA node of the heart. It is thus a cardiac pacemaker that is ectopic, producing an ectopic beat. If chronic this can result in arhythmias such as tachycardia, bradycardia, or ventricular fibrillation. An artificial pacemaker may be used to counter this.

#### Artificial pacemakers

An artificial cardiac pacemaker (or artificial pacemaker, so as not to be confused with the natural cardiac pacemaker) or just pacemaker is an implanted medical device that generates electrical impulses delivered by electrodes to the chambers of the heart either the upper atria, or lower ventricles to cause the targeted chambers to contract and pump blood. By doing so, the artificial pacemaker takes over from the primary SA node pacemaker to regulate the function of the heart's electrical conduction system.