Pit vipers are so called because of the small pits on the sides of their heads which function as infrared sensors, giving the viper a thermal impression of objects in its vicinity  Because all species of pit vipers are predators, scientists have long thought that these sensors were used to find prey
One researcher has hypothesized, however, that the infrared sensor serves primarily to assist the viper in judging the size of approaching predators and how far away they are
The rattle of the diamondback rattlesnake, one of the most common kinds of pit viper, functions as a defense mechanism to intimidate predators.