The somatosensory system is a part of the sensory nervous system. The somatosensory system is a complex system of sensory neurons and pathways that responds to changes at the surface or inside the body. The axons (as afferent nerve fibers), of sensory neurons connect with, or respond to, various receptor cells. These sensory receptor cells are activated by different stimuli such as heat and nociception, giving a functional name to the responding sensory neuron, such as a thermoreceptor which carries information about temperature changes. Other types include mechanoreceptors, chemoreceptors, and nociceptors and they send signals along a sensory nerve to the spinal cord where they may be processed by other sensory neurons and then relayed to the brain for further processing. Sensory receptors are found all over the body including the skin, epithelial tissues, muscles, bones and joints, internal organs, and the cardiovascular system.
Somatic senses are sometimes referred to as somesthetic senses, with the understanding that somesthesis includes the sense of touch, proprioception (sense of position and movement), and (depending on usage) haptic perception.
The mapping of the body surfaces in the brain is called somatotopy. In the cortex, it is also referred to as the cortical homunculus. This brain-surface ("cortical") map is not immutable, however. Dramatic shifts can occur in response to stroke or injury.
Merkel cell nerve endings are found in the basal epidermis and hair follicles; they react to low vibrations (5–15 Hz) and deep static touch such as shapes and edges. Due to a small receptive field (extremely detailed info) they are used in areas like fingertips the most; they are not covered (shelled) and thus respond to pressures over long periods.
Tactile corpuscles react to moderate vibration (10–50 Hz) and light touch. They are located in the dermal papillae; due to their reactivity they are primarily located in fingertips and lips. They respond in quick action potentials, unlike Merkel. They are responsible for the ability to read Braille and feel gentle stimuli.
Lamellar corpuscles determine gross touch and distinguish rough and soft substances. They react in quick action potentials, especially to vibrations around 250 Hz (even up to centimeters away). They are the most sensitive to vibrations, and have large receptor fields. Pacinian reacts only to sudden stimuli so pressures like clothes that are always compressing their shape are quickly ignored.
Bulbous corpuscles react slowly and respond to sustained skin stretch. They are responsible for the feeling of object slippage and play a major role in the kinesthetic sense and control of finger position and movement. Merkel and bulbous cells - slow-response - are myelinated; the rest - fast-response - are not. All of these receptors are activated upon pressures that squish their shape causing an action potential.
All afferent touch/vibration info ascends the spinal cord via the posterior (dorsal) column-medial lemniscus pathway via gracilis (T7 and below) or cuneatus (T6 and above).
Cuneatus sends signals to the cochlear nucleus indirectly via spinal grey matter, this info is used in determining if a perceived sound is just villi noise/irritation. All fibers cross (left becomes right) in the medulla.
BA3 receives the densest projections from the thalamus. BA3a is involved with the sense of relative position of neighboring body parts and amount of effort being used during movement. BA3b is responsible for distributing somato info, it projects texture info to BA1 and shape + size info to BA2.
Region S2 (secondary somatosensory cortex) divides into Area S2 and parietal ventral area. Area S2 is involved with specific touch perception and is thus integrally linked with the amygdala and hippocampus to encode and reinforce memories.
Parietal ventral area is the somatosensory relay to the premotor cortex and somatosensory memory hub, BA5.
BA5 is the topographically organized somato memory field and association area.
BA1 processes texture info while BA2 processes size + shape info.
Area S2 processes light touch, pain, visceral sensation, and tactile attention.
The insular cortex (insula) plays a role in the sense of bodily-ownership, bodily self-awareness, and perception. Insula also plays a role in conveying info about sensual touch, pain, temperature, itch, and local oxygen status. Insula is a highly connected relay and thus is involved in numerous functions.
The somatosensory system is spread through all major parts of the vertebrate body. It consists both of sensory receptors and afferent neurons in the periphery (skin, muscle and organs for example), to deeper neurons within the central nervous system.
A somatosensory pathway will typically have three long neurons: primary, secondary, and tertiary (or first, second, and third).
Photoreceptors, similar to those found in the retina of the eye, detect potentially damaging ultraviolet radiation (ultraviolet A specifically), inducing increased production of melanin by melanocytes. Thus tanning potentially offers the skin rapid protection from DNA damage and sunburn caused by ultraviolet radiation (DNA damage caused by ultraviolet B). However, whether this offers protection is debatable, because the amount of melanin released by this process is modest in comparison to the amounts released in response to DNA damage caused by ultraviolet B radiation.
The receptor for the sense of balance resides in the vestibular system in the ear (for the three-dimensional orientation of the head, and by inference, the rest of the body). Balance is also mediated by the kinesthetic reflex fed by proprioception (which senses the relative location of the rest of the body to the head). In addition, proprioception estimates the location of objects which are sensed by the visual system (which provides confirmation of the place of those objects relative to the body), as input to the mechanical reflexes of the body.
Fine touch (or discriminative touch) is a sensory modality that allows a subject to sense and localize touch. The form of touch where localization is not possible is known as crude touch. The posterior column–medial lemniscus pathway is the pathway responsible for the sending of fine touch information to the cerebral cortex of the brain.
Crude touch (or non-discriminative touch) is a sensory modality that allows the subject to sense that something has touched them, without being able to localize where they were touched (contrasting "fine touch"). Its fibres are carried in the spinothalamic tract, unlike the fine touch, which is carried in the dorsal column.  As fine touch normally works in parallel to crude touch, a person will be able to localize touch until fibres carrying fine touch (Posterior column–medial lemniscus pathway) have been disrupted. Then the subject will feel the touch, but be unable to identify where they were touched.
The somatosensory cortex encodes incoming sensory information from receptors all over the body. Affective touch is a type of sensory information that elicits an emotional reaction and is usually social in nature, such as a physical human touch. This type of information is actually coded differently than other sensory information. Intensity of affective touch is still encoded in the primary somatosensory cortex and is processed in a similar way to emotions invoked by sight and sound, as exemplified by the increase of adrenaline caused by the social touch of a loved one, as opposed to the physical inability to touch someone you don't love. 
Meanwhile, the feeling of pleasantness associated with affective touch activates the anterior cingulate cortex more than the primary somatosensory cortex. Functional magnetic resonance imaging (fMRI) data shows that increased blood oxygen level contrast (BOLD) signal in the anterior cingulate cortex as well as the prefrontal cortex is highly correlated with pleasantness scores of an affective touch. Inhibitory transcranial magnetic stimulation (TMS) of the primary somatosensory cortex inhibits the perception of affective touch intensity, but not affective touch pleasantness. Therefore, the S1 is not directly involved in processing socially affective touch pleasantness, but still plays a role in discriminating touch location and intensity.
A variety of studies have measured and investigated the causes for differences between individuals in the sense of fine touch. One well-studied area is passive tactile spatial acuity, the ability to resolve the fine spatial details of an object pressed against the stationary skin. A variety of methods have been used to measure passive tactile spatial acuity, perhaps the most rigorous being the grating orientation task. In this task subjects identify the orientation of a grooved surface presented in two different orientations, which can be applied manually or with automated equipment. Many studies have shown a decline in passive tactile spatial acuity with age; the reasons for this decline are unknown, but may include loss of tactile receptors during normal aging. Remarkably, index finger passive tactile spatial acuity is better among adults with smaller index fingertips; this effect of finger size has been shown to underlie the better passive tactile spatial acuity of women, on average, compared to men. The density of tactile corpuscles, a type of mechanoreceptor that detects low-frequency vibrations, is greater in smaller fingers; the same may hold for Merkel cells, which detect the static indentations important for fine spatial acuity. Among children of the same age, those with smaller fingers also tend to have better tactile acuity. Many studies have shown that passive tactile spatial acuity is enhanced among blind individuals compared to sighted individuals of the same age, possibly because of cross modal plasticity in the cerebral cortex of blind individuals. Perhaps also due to cortical plasticity, individuals who have been blind since birth reportedly consolidate tactile information more rapidly than sighted people.