Sensory abilities in snakes
The ability to sense infrared thermal radiation evolved independently in three different groups of snakes, consisting of the families of Boidae (boas), Pythonidae (pythons), and the subfamily Crotalinae (pit vipers). What is commonly called a pit organ allows these animals to essentially "see" radiant heat at wavelengths between 5 and 30 μm. The more advanced infrared sense of pit vipers allows these animals to strike prey accurately even in the absence of light, and detect warm objects from several meters away. It was previously thought that the organs evolved primarily as prey detectors, but recent evidence suggests that it may also be used in thermoregulation and predator detection, making it a more general-purpose sensory organ than was supposed.
Phylogeny and evolution.
The facial pit underwent parallel evolution in pitvipers and some boas and pythons. It evolved once in pitvipers and multiple times in boas and pythons. The electrophysiology of the structure is similar between the two lineages, but they differ in gross structural anatomy. Most superficially, pitvipers possess one large pit organ on either side of the head, between the eye and the nostril (loreal pits), while boas and pythons have three or more smaller pits lining the upper and sometimes the lower lip, in or between the scales (labial pits). Those of the pitvipers are the more advanced, having a suspended sensory membrane as opposed to a simple pit structure.
Anatomy.
In pit vipers, the heat pit consists of a deep pocket in the rostrum with a membrane stretched across it. Behind the membrane, an air-filled chamber provides air contact on either side of the membrane. The pit membrane is highly vascular and heavily innervated with numerous heat-sensitive receptors formed from terminal masses of the trigeminal nerve (terminal nerve masses, or TNMs). The receptors are therefore not discrete cells, but a part of the trigeminal nerve itself. The labial pit found in boas and pythons lacks the suspended membrane and consists more simply of a pit lined with a membrane that is similarly innervated and vascular, though the morphology of the vasculature differs between these snakes and crotalines. The purpose of the vasculature, in addition to providing oxygen to the receptor terminals, is to rapidly cool the receptors to their thermo-neutral state after being heated by thermal radiation from a stimulus. Were it not for this vasculature, the receptor would remain in a warm state after being exposed to a warm stimulus, and would present the animal with afterimages even after the stimulus was removed. 
Neuroanatomy.
In all cases, the facial pit is innervated by the trigeminal nerve. In crotalines, information from the pit organ is relayed to the nucleus reticularus caloris in the medulla via the lateral descending trigeminal tract. From there, it is relayed to the contralateral optic tectum. In boas and pythons, information from the labial pit is sent directly to the contralateral optic tectum via the lateral descending trigeminal tract, bypassing the nucleus reticularus caloris.
It is the optic tectum of the brain which eventually processes these infrared cues. This portion of the brain receives other sensory information as well, most notably optic stimulation, but also motor, proprioceptive and auditory. Some neurons in the tectum respond to visual or infrared stimulation alone; others respond more strongly to combined visual and infrared stimulation, and still others respond only to a combination of visual and infrared. Some neurons appear to be tuned to detect movement in one direction. It has been found that the snake's visual and infrared maps of the world are overlaid in the optic tectum. This combined information is relayed via the tectum to the forebrain.
The nerve fibers in the pit organ are constantly firing at a very low rate. Objects that are within a neutral temperature range do not change the rate of firing; the neutral range is determined by the average thermal radiation of all objects in the receptive field of the organ. The thermal radiation above a given threshold causes an increase in the temperature of the nerve fiber, resulting in stimulation of the nerve and subsequent firing, with increased temperature resulting in increased firing rate. The sensitivity of the nerve fibers is estimated to be ;0.001 °C.
The pit organ will adapt to a repeated stimulus; if an adapted stimulus is removed, there will be a fluctuation in the opposite direction. For example, if a warm object is placed in front of the snake, the organ will increase in firing rate at first, but after a while will adapt to the warm object and the firing rate of the nerves in the pit organ will return to normal. If that warm object is then removed, the pit organ will now register the space that it used to occupy as being colder, and as such the firing rate will be depressed until it adapts to the removal of the object. The latency period of adaptation is approximately 50 to 150 ms.
The facial pit actually visualizes thermal radiation using the same optical principles as a pinhole camera, wherein the location of a source of thermal radiation is determined by the location of the radiation on the membrane of the heat pit. However, studies that have visualized the thermal images seen by the facial pit using computer analysis have suggested that the resolution is extremely poor. The size of the opening of the pit results in poor resolution of small, warm objects, and coupled with the pit's small size and subsequent poor heat conduction, the image produced is of extremely low resolution and contrast. It is known that some focusing and sharpening of the image occurs in the lateral descending trigeminal tract, and it is possible that the visual and infrared integration that occurs in the tectum is also used to help sharpen the image.
Molecular mechanism.
In spite of its detection of infrared light, the infrared detection mechanism is not similar to photoreceptors - while photoreceptors detect light via photochemical reactions, the protein in the pits of snakes is a type of transient receptor potential channel, TRPA1 which is a temperature sensitive ion channel. It senses infrared signals through a mechanism involving warming of the pit organ, rather than chemical reaction to light. In structure and function it resembles a biological version of warmth-sensing instrument called a bolometer. This is consistent with the very thin pit membrane, which would allow incoming infrared radiation to quickly and precisely warm a given ion channel and trigger a nerve impulse, as well as the vascularization of the pit membrane in order to rapidly cool the ion channel back to its original temperature state. While the molecular precursors of this mechanism are found in other snakes, the protein is both expressed to a much lower degree and much less sensitive to heat.
Behavioral and ecological implications.
Infrared sensing snakes use pit organs extensively to detect and target warm-blooded prey such as rodents and birds. Blind or blindfolded rattlesnakes can strike prey accurately in the complete absence of visible light, though it does not appear that they assess prey animals based on their body temperature. In addition, snakes may deliberately choose ambush sites that facilitate infrared detection of prey. It was previously assumed that the organ evolved specifically for prey capture. However, recent evidence suggests that the pit organ is also used for thermoregulation. In an experiment that tested snakes' abilities to locate a cool thermal refuge in an uncomfortably hot maze, all pit vipers were able to locate the refuge quickly and easily, while true vipers were unable to do so. This finding suggests that the pit vipers were using their pit organs to aid in thermoregulatory decisions. It is also possible that the organ even evolved as a defensive adaptation rather than a predatory one, or that multiple pressures have contributed to the organ's development. The use of the heat pit to direct thermoregulation or other behaviors in pythons and boas has not yet been determined.
References.
 ;templatestyles src="Reflist/styles.css" / ;