A receptor detects a stimulus and generates electrical impulses in response. Electrical signals are then conducted by a sensory neuron to the spinal cord. Neurotransmitter molecules then cross the synapse between the sensory and relay neuron; in this way electrical signals are converted to chemical signals. The neurotransmitter molecules initiate electrical signals in the relay neuron which conducts the impulse to a motor neuron, again via a chemical synapse. The motor neuron then causes a response in the effector, for example muscle contraction or glandular secretion.