The somatosensory system is the part of the sensory system concerned with the conscious perception of touch, pressure, pain, temperature, position, movement, and vibration, which arise from the muscles, joints, skin, and fascia.
The somatosensory system is a 3-neuron system that relays sensations detected in the periphery and conveys them via pathways through the spinal cord, brainstem, and thalamic relay nuclei to the sensory cortex in the parietal lobe. 
Impulses are carried from receptors via sensory afferents to the dorsal root ganglia, where the cell bodies of the first-order neurons are located. Their axons then travel through the spinal cord either in an ipsilateral or a contralateral fashion. Note that second-order neuron cell bodies are located in different anatomical areas depending on the sensation they carry.
Broadly, the spinal cord contains the second-order neurons for the fibers carrying pain, touch, and temperature sensations. The medulla contains the second-order neurons for fibers carrying touch, position, and vibratory sensations. The fibers are then either conveyed to the thalamus (where the third-order neurons are located) or conveyed to the cerebellum. The latter tracts are not discussed in this article in detail because they carry information that is not perceived consciously. From the thalamic nucleus, the sensory afferents are projected to the cortical sensory areas, where information is integrated and analyzed. [2, 3, 4]
The somatosensory system is displayed in the images below.
The somatosensory system may be thought of as having its beginnings in receptors located in the skin, joints, ligaments, muscles, and fascia. Receptors detect either environmental changes (exteroceptive receptors located in the dermis) or changes within the body (proprioceptive receptors). The sensations are transmitted via the peripheral nerves to the dorsal root ganglion, which houses the first-order neuron for the somatosensory system.
Dorsal root ganglion
The dorsal root ganglion houses the cell bodies of the afferent fibers from the periphery. Neurons located in the dorsal root ganglion are pseudounipolar, and their central processes travel to and enter the spinal cord in bundles. Here the fibers split into 2 functional groups: a lateral group (or anterolateral system) and a medial group (or dorsal column-medial lemniscal system). The lateral group carries mainly unmyelinated fibers that subserve pain and temperature sensations, whereas the medial group carries mainly myelinated fibers that convey proprioceptive impulses. The sensation of touch is mediated by both systems. Phylogenetically speaking, the dorsal column system is newer than the anterolateral system. [1, 2, 3]
The lateral group of fibers enters the spinal cord, then ascend or descend approximately 2 spinal cord segments (in the tract of Lissauer) to terminate on the substantia gelatinosa and the nucleus proprius, where the second-order neurons are housed. These neurons have projections that cross over (decussate) to the contralateral side via a tract called the anterior white commissure. Fibers then ascend via the brainstem to the thalamus in the spinothalamic tracts (or STT).
Two primary spinothalamic tracts exist: the lateral spinothalamic tract, which conveys pain and temperature information, and the anterior spinothalamic tract, which conveys pain and poorly localizable touch sensation. [2, 4, 5] The lateral spinothalamic tract is laminated, with sacral fibers lying most laterally and cervical fibers medially. This lamination is clinically useful in differentiating intrinsic cord lesions, in which the sacral fibers are often spared, from extrinsic ones, in which they are involved early.  The anterior STT subserves diffuse touch sensation. It should be noted that touch is also mediated by the medial lemniscal system; thus, selective damage to the anterior STT often produces no clinical deficit with respect to touch. 
The medial group also sends its fibers into the posterior spinal cord; however, upon reaching it, most fibers ascend to the dorsal column nuclei in the medulla and synapse there. The fiber tracts that ascend are called the posterior funiculus. This funiculus is composed of 2 separate elements: the gracile tract and the cuneate tract. The gracile tract contains fibers that originate below the sixth thoracic segment. The cuneate tract, which is located more laterally in the spinal cord, carries fibers that originate above the sixth thoracic segment.
These tracts synapse on a second-order neuron in the nucleus gracilis and cuneatus, which are located in the medulla. Their axons then decussate (via internal arcuate fibers) and form a bundle known as the medial lemniscus. Other names for this decussation are sensory decussation and lemniscal decussation. The medial lemniscus is located ventral to the gracile and cuneate nuclei in the medulla. Fibers of the posterior columns and medial lemniscus are concerned primarily with position sense and fine discriminative touch. [1, 2, 3, 4]
Facial sensation is carried via the 3 branches of the trigeminal nerve to the pseudounipolar perikarya, which are located in the semilunar ganglion, in the middle cranial fossa near the apex of the petrous bone. The fibers then enter the pons and terminate on 3 nuclei: nucleus of the spinal tract of the trigeminal nerve, principal sensory nucleus, and the mesencephalic nucleus.
Many sensory fibers descend the spinal tract of the trigeminal nerve, giving off branches to the nucleus of the spinal tract, which is located medially. These fibers carry pain, temperature, and touch information from the face. Both the spinal tract of the trigeminal nerve and its corresponding nucleus descend into the upper cervical spinal cord. [3, 6] The nucleus is laminated, so that the sensation subserving the lateral face is located more caudally than sensation for the midline facial structures. This explains the typical perioral pattern of sensory loss that is associated with rostral spinal nucleus and tract lesions. From the spinal nucleus, fibers ascend via the trigeminothalamic tract to the thalamus. The fibers that enter the principal sensory nucleus of the pons carry tactile and proprioceptive information, and fibers entering the mesencephalic nucleus also receive proprioceptive information. 
At this point, the sensory system's contribution to spinal reflexes should be mentioned. Both the spinothalamic and dorsal column fibers contribute to the stretch reflex arc; upon entering the spinal cord, their branches synapse on interneurons in the dorsal grey matter, which ultimately synapse on motor neurons in the anterior horn. 
Both the medial lemniscus and the spinothalamic tract send fibers cephalad; these fibers travel in the basal part of the tegmentum in the pons and midbrain on their way to the thalamus. Once in the thalamus, they synapse on third-order neurons in the ventral posterior lateral (VPL) nucleus. Fibers from the face (trigeminal lemniscus) synapse on the ventral posterior medial (VPM) nucleus.
The third-order neurons then project, via the posterior limb of the internal capsule, to the primary somatosensory cortex, which is located in the postcentral gyrus (also known as Brodmann areas 1, 2, and 3) of the parietal lobe, and to the posterior paracentral lobule. [3, 4] Primary somatosensory cortex subserves general and proprioceptive sensations and serves to integrate sensory information. It also receives connections from the motor cortex, somatosensory association cortex, and the contralateral primary somatosensory cortex. Somesthetic cortex is organized in a sensory homunculus, which is analogous to the motor homunculus. Genital and leg fibers are located medially, whereas arm, hand, face, and tongue fibers are on the lateral surface of the somatosensory area. Body areas particularly important to the sensory system (for example the face, lips, and hand) are given larger representation than other areas. [3, 4]
Secondary sensory areas
Secondary sensory areas surround the primary sensory cortex. They receive projections from the thalamus and the primary sensory area. Representation in these areas is bilateral, although contralateral sensations are overrepresented. Interestingly, the face, tongue, mouth, and throat are not represented here. [7, 4]
Sensory receptors are specialized structures that detect changes in their immediate environment. The primary modality of the receptor is determined by how sensitive the receptor is to the size of an applied sensory stimulus and by its connections to the fibers that transmit the applied stimulus.
Receptors are also defined by their ability to adapt to stimulus. Adaptation is the capacity of some receptors to diminish their rate of discharge with continuous or repetitive stimulation.  Quickly adapting receptors respond maximally when a stimulus is initially applied, and the response fades away with continuous stimulation. By contrast, nonadapting receptors discharge continuously for the duration of the stimulus. 
Exteroceptors, proprioceptors, and interoceptors
Three types of sensory receptors exist, as follows, and differ based on the location of the stimulus they are sensing  :
Exteroceptive receptors, or exteroceptors, are stimulated by changes in the external environment
Proprioceptive receptors, or proprioceptors, record information about the position of the body in space
Interoceptive receptors, or interoceptors, detect visceral information
Mechanoreceptors, thermoreceptors, and nociceptors
Sensory receptors are further classified as mechanoreceptors, thermoreceptors, and nociceptors, depending on the type of inciting stimulus.  These receptors may be either free nerve endings, encapsulated nerve endings, or expanded tip endings. [2, 4]
Free nerve endings are formed by fine unmyelinated branches of nerve fibers, located throughout the skin, subcutaneous tissue, body, and organs. These are nonadapting receptors that detect pain and temperature sensation. [4, 2]
Encapsulated endings consist of concentric layers of tissue filled with fluid that surround a nerve ending. These are the very sensitive and rapidly adapting receptors. They mediate vibration, fine discriminative touch, and deep touch. They are located in high concentration in subcutaneous tissue, skin, fingertips, palms, lips, and external genitalia. Examples include Meissner corpuscles, Pacinian corpuscles, Golgi-Mazzoni corpuscles, neuromuscular spindles, and neurotendinous organs of Golgi. [2, 4]
Expanded tip endings are nerve endings with an expansion (or knobs) at the distal aspect of the nerve, which serves as a receptor. These are responsible for detecting touch, pressure, and temperature. Examples are moderately adapting and slowly transmitting Merkel receptors and Ruffini endings, which are located in the dermis and joints. [2, 4]
Mechanoreceptors detect the mechanical displacement of the nerve endings. These mediate touch (divided into fine localizable discriminative touch and diffuse or nonlocalizable touch), pressure, vibration, limb position (proprioception), and limb movement (kinesthesia). Most axons are large-diameter myelinated fibers, which carry impulses quickly.
Nociceptors are free nerve endings that function as high-threshold mechanoreceptors. Many receptors for pain are also specialized chemoreceptors, detecting substances such as histamine, bradykinin, substance P, serotonin, acetylcholine, excitatory amino acids, or high concentration of intracellular ions. Noxious stimuli vary and may include intense mechanical impulses, high temperatures, or other stimuli, all of which may cause damage to the tissue. Most axons are slowly conducting, lightly myelinated A delta fibers and subserve well-localized initial pain or cutaneous pricking pain.
Unmyelinated C fibers (which conduct slowly, at 1 m/sec) mediate poorly localized and poorly tolerated secondary pain, which is more persistent and has a burning quality. A deep pain from viscera, muscles, and joints (often associated with referred pain) is conducted by both unmyelinated type C fibers and myelinated A delta fibers within the sympathetic nerves. 
Thermoreceptors detect the sensations of cold and heat and are triggered by narrow changes in skin temperature. Warm temperature thermoreceptors are C fibers, whereas A delta fibers mediate cold temperature. 
Meissner, Pacinian, and Golgi-Mazzoni corpuscles
Meissner and Pacinian corpuscles primarily mediate discriminative touch and vibration. Meissner corpuscles are found in dermal papillae and are ovoid bodies of flattened epithelioid cells surrounded by nucleated connective tissue sheets and spirals of naked axons.
Pacinian corpuscles are laminated structures formed by continuous layers of flattened cells surrounding a large myelinated axon.
Corpuscles of Golgi-Mazzoni are ovoid bodies with a central core and laminated capsule and are related to the Pacinian corpuscles. They are located on the surfaces of tendons and subcutaneous tissue of the fingers.
Tactile disks of Merkel
Muscle spindles and Golgi tendon organs
Muscle spindles are fusiform encapsulated structures located in skeletal muscles. They mediate information about the length and the rate of change in length of a muscle. Each spindle is formed by 2-12 thin, modified striated muscle fibers that are surrounded by a capsule of connective tissue. These so-called intrafusal fibers are connected in parallel to the regular striated muscles (or extrafusal fibers). Two types of intrafusal muscle fibers can be found: small nuclear chain fibers (with a single chain of central nuclei) and large nuclear bag fibers (containing numerous small nuclei in the equatorial region).
Sensory innervation is provided by primary and secondary afferents. Primary afferents are derived from Ia nerve fibers and wrap around the central regions of both chain and bag fibers. Secondary afferents are derived from type II nerve fibers and are seen predominantly on nuclear chain fibers.
Primary and secondary afferents synapse on alpha motoneurons at the level of the spinal cord and modulate the activity of the alpha motoneurons. These fibers are responsible for modulating both the stretch reflex and muscle tone. Primary endings are more sensitive to dynamic change in muscle and measuring velocity of stretch. Secondary endings primarily measure the length.
Gamma or beta motoneurons innervate the contractile end of intrafusal muscle fibers. By triggering the contraction of intrafusal muscle fibers, gamma motoneurons increase the sensitivity of sensory afferents and reset the spindle mechanism. [9, 4]
Golgi neurotendinous organs are encapsulated structures located in series at the junction of the muscle and tendon. Their capsule surrounds an afferent Ib nerve fiber. Ib afferents fire when the tendon is stretched. Ib fibers project polysynaptically on the alpha motor neurons at the level of the spinal cord. Here they inhibit the alpha motor neurons innervating agonist muscles and facilitate motor neurons of antagonist muscle groups. [4, 9]
Various disorders can cause the degeneration of the neurons of the dorsal root ganglion. These include paraneoplastic, dysimmune, and toxic etiologies (eg, cisplatin). Typically, patients with a sensory neuronopathy present subacutely with pansensory loss and sensory ataxia of the limbs. Classically, the sensory loss is described as diffuse (although it may be asymmetric) and does not demonstrate the typical length-dependent stocking-and-glove pattern exhibited by typical neuropathies. [10, 11]
Subacute combined degeneration of the spinal cord
Vitamin B12 deficiency causes a wide range of dysfunctions affecting many organ systems, including the nervous system. Specifically, patients experience abnormalities of proprioception and vibration in addition to upper motor neuron signs.  More recent observations also support primary involvement of the posterior columns, affecting the cervical and thoracic areas predominantly. MRI imaging often documents hyperintense lesions in the posterior columns of the spinal cord. [13, 14, 15]
Lesions involving the central canal of the spinal cord typically encroach on the fibers of the anterior white commissure initially. This produces an unusual pattern of sensory loss, typically described as bilateral loss of pain and temperature sensations at a particular dermatomal level. This is due to injury to the fibers that cross in the anterior white commissure. Since the cervical spinal cord is involved commonly initially, the arms are often affected first. Characteristically, sensations carried in the posterior columns (vibration and proprioception) are intact.  With time, involvement of the motor fibers and posterior columns often occurs.
Central pain results from injury at different levels of the central nervous system, including the cerebral cortex, thalamus, brainstem, and spinal cord, usually affecting the spinothalamic or trigeminothalamic tracts. Injury of the VPM and VPL nucleus of the thalamus, most commonly as a result of vascular disease, affects all sensory modalities of the contralateral body, followed by delayed-onset burning pain. Pain may be increased by sensory stimulation. The combination of hemianesthesia and spontaneous or sensory stimulation – induced pain is classically known as the thalamic pain syndrome or the Dejerine and Roussy thalamic syndrome. [9, 6]
Agnosia is an inability to perceive stimuli that individuals normally perceive, despite intact intellect, language, and ability to process sensory information. Agnosia is modality specific (visual, auditory, and tactile). Tactile agnosia specifically is discussed here.  This is the inability to discriminate objects through touch and is frequently caused by a lesion in the contralateral parietal cortex. Various subtypes include astereognosia, in which the form of objects is not recognized through touch; amorphognosia, in which size or shape is not recognized; and ahylognosia, in which certain qualities of an object (weight, density) are not perceived.