Thermoregulation is the ability of an organism to control its body temperature within certain limits, even when the surrounding temperature is different. This is an aspect of homeostasis: the keeping of a constant internal environment.