The human body has a specific internal state that it needs to maintain to survive. This state, known as homeostasis, includes factors such as internal temperature, pH balance, electrolyte balances and body composition. The nervous system is responsible for maintaining homeostasis. The sensory neurons, brain, motor neurons and spinal cord all play an important part in the relationship between the nervous system and homeostasis. If any part of the nervous system is damaged, homeostasis is difficult or impossible to maintain.
The nervous system and homeostasis have a negative feedback relationship: the nervous system responds to internal and external stimuli, or a deviation from the body's normal state. For example, if core body temperature drops too low the brain sends a message to the blood vessels to constrict and keep warm blood flowing in the core of the body. Similarly, excess body heat triggers perspiration. The body's homeostasis-related functions are controlled in the brain by the pituitary gland and the hypothalamus.
The pituitary gland is linked to all the efferent neurons in the peripheral nervous system. It contains the hypothalamus, thalamus and epithalamus. These glands regulate the body's internal functions such as hunger, sleep rhythms and the secretion of various hormones. The pituitary also communicates with the other parts of the brain; for example, if the body lacks oxygen, this gland will direct the medulla oblongata to increase breathing or heart rate to circulate oxygenated blood throughout the body.
Another component in the relationship between the nervous system and homeostasis is the peripheral nervous system. It consists of all afferent and efferent nerves that branch from the spinal cord. Afferent nerves receive data from visceral or sensory organs, convert the data to an electrical signal and transfer it to the brain. When the signal reaches the brain, it travels along efferent nerves to the muscles or glands to respond to the stimulus.
The peripheral nervous system has two parts: the somatic system and the autonomic system. The latter is responsible for homeostasis; it links to smooth muscle fibers such as the intestinal walls, cardiac muscle fibers and the glands within the body. The autonomic nervous system can be further divided into the sympathetic and parasympathetic nervous systems.
The nervous system and homeostasis relate to one another via the sympathetic and parasympathetic nervous systems. Where the former produces hormones that gear the body to respond to an emergency — increasing heart rate, breathing, energy transfer to muscles — the latter calms the body, lowering heart rate, breathing and playing a part in digestion. The secretion of adrenaline and other "fight-or-flight" hormones shuts down all non-vital functions for the duration of the situation.