To begin with, we should first look at how the heart beats.
Beating of the heart is due to myogenic muscle contraction, This means the myocyte (muscle cell) itself is the origin of the contraction and is not controlled externally. A region of myocytes called the sinoatrial node (pacemaker) controls the rate of the heartbeat. A wave of excitations is sent from the sinoartrial node causing the atria to contract. This excitation is conducted to the atrioventricular node, where it is passed through nerves to the muscles of the ventricles causing them to contract. Myogenic initiation of the contraction means that the heart does not stop beating as it is no a conscious process. Cardiac muscle is indefatigable. Now the way we can control the heart beat:
Heart rate can be controlled by the autonomic nerve system – the part of the nervous system that responds automatically to the changes in body conditions. Where myocardial contraction maintains the beating of the heart, we may need to speed up or slow down the heart rate. When exercising, more CO2 is present in the blood. This is detected by chemoreceptors in the brain’s medulla oblongata, resulting in a nerve signal being sent to the SA node to speed up the heart rate When CO2 levels fall, another nerve ( Vagus) reduces heart rate. The hormone adrenalin causes a rapid increase in heart rate in flight or fight responses preparing the body for action. The effect can be mimicked by stimulant drugs.
For this question we also need to make sure that we do not go off topic by describing how the signals work to produce the heart beat and to be sure that we include the specific words we need such as medulla oblongata, adrenaline etc.