Homeostasis is the natural function of the body that controls the body's internal environment. It is a process responsible for sending and receiving messages though the nervous system, interpreting and responding appropriately to the body's demands. Homeostasis aims for normal functions and values from the body, such as temperature and blood glucose levels. When those values are either lower or higher than normal, homeostasis brings the functions back within normal values.
The brain stem consists of five parts: the thalamus, hypothalamus, midbrain, pons and medulla. The medulla controls the heart rate. It sends and receives messages in the form of chemicals or hormones from the thousands of nerves running through the medulla, in an area called the medullary pyramids. The medulla constantly receives messages from the nerves, which are communication pathways from muscles, organs and other parts of the body. During exercise, your muscles send a message through the nervous system to the medulla, which in turn releases epinephrine and norepinephrine. These two chemicals travel along the nervous system to the reach the electrical system of the heart, the sinus node. The sinus mode triggers the heart's contractions. Homeostasis constantly monitors messages coming from the nervous system corresponding between the body's muscles and joints. When you stop exercising, your muscles send along a message to the medulla again, which responds this time by releasing a hormone called acetylcholine. This hormone slows the heart rate, retarding the heart's muscle contractions.
The medulla also relies on information from other parts of the brain to help make decisions for an appropriate response. For instance, the thalamus is the sensory part of the brain. If the thalamus sends the medulla information that the body is under emotional stress, the medulla considers that, in addition to the information received from the nervous system to harmonize the deviation and trigger the best response. This may include an increase of epinephrine to increase the heart rate and stimulate norepinephrine that seems to have a milder affect on the cardiovascular system, bringing equilibrium to the stress and heart rate. All of the chemicals to trigger and retard the heart rate are constantly changing and monitored. With moderate exercise, the medulla simply responds by removing acetylcholine, the chemical to retard heart rate. For intense exercise, the medulla releases epinephrine and norepinephrine. Increasing the heart rate is the body's response to oxygen demand. To prepare and condition the appropriate response, homeostasis may increase the metabolic rate and create a new set point to meet the body's demands.