The nonselective cation channel TRPV1 is responsible for transducing noxious stimuli into action potentials propagating through peripheral nerves. It is activated by temperatures greater than 43 °C, while remaining completely nonconductive at temperatures lower than this threshold. The origin of this sharp response, which makes TRPV1 a biological temperature sensor, is not understood. Here we used molecular dynamics simulations and free energy calculations to characterize the molecular determinants of the transition between nonconductive and conductive states. We found that hydration of the pore and thus ion permeation depends critically on the polar character of its molecular surface: in this narrow hydrophobic enclosure, the motion of a polar side-chain is sufficient to stabilize either the dry or wet state. The conformation of this side-chain is in turn coupled to the hydration state of four peripheral cavities, which undergo a dewetting transition at the activation temperature.