The nervous system controls and coordinates functions throughout the body using electrical signals called nerve impulses. It has three main parts - the central nervous system (brain and spinal cord), and the peripheral nervous system which includes sensory neurons, motor neurons, and interneurons. Sensory neurons detect stimuli and send signals to the central nervous system. Motor neurons carry signals from the central nervous system to muscles and glands. Interneurons connect neurons within the central nervous system. Neurons communicate via neurotransmitters released at synapses between neurons.