Monarchs are cold-blooded, meaning they cannot regulate body temperature by increasing or decreasing their energy burn (metabolism). Cold-blooded animals instead regulate temperature imperfectly by their behavior--such as seeking or avoiding the sun.
Monarchs prefer a temperature of 84 F. Adult monarchs increase their temperature by vibrating their wings, akin to our shivering. Typically, they do this before they fly because flying requires higher energy production that goes along with increased body temperature. Monarchs are also covered with hair-like scales, which must insulate them as fur does for mammals.
Daily activity of adults closely mirrors the ambient temperature. If it's less than 70 F, they are somewhat less active, and much less active below 60 F. They cannot fly below 50 F unless it's sunny.
The reason females lay eggs on the underside of leaves is probably to hide them from predators, but also to avoid "cooking" them on the hot, sunny side of the leaf. Caterpillars mostly stay on the underside for the same reasons.
I have not observed obvious temperature regulation behavior in caterpillars--but it's highly likely they do have behaviors to regulate. Here's a great project for a student! Would a caterpillar crawl up onto the sunny side to get warm on a cold day? Interesting question.
Being small animals, a change in ambient temperature changes their internal temperature quickly. Even if they can regulate temperature by behavior, caterpillars can't do it with any speed, because they move slowly. That's why you need to keep them out of direct sunlight and out of hot cars.
For every 10 degree Celsius increase in temperature, the speed of chemical reactions roughly doubles. (The "Q10 rule.") This means that the rate of caterpillar growth should roughly double with a 10 C temperature increase. In other words, the time required to complete various stages of the life cycle increases a lot as temperatures drop.
This can have serious consequences. Last September, my granddaughter was raising monarchs in Lansing, MI; I wasn't there to closely supervise. I gave her some caterpillars left over after distributing to schools. Because she kept them in a cold location, their development to butterflies was delayed by a month. They emerged too late to migrate.
When overwintering in Mexico, adults can survive temperatures a few degrees below freezing because their body fluids, like any salty solution, have a depressed freezing point.
Humidity is closely related to temperature. If you increase the temperature (without adding water to the air), humidity goes down. Being small animals (with a large surface area relative to volume), monarchs can dry out quickly. That's why increasing humidity by misting is important when raising caterpillars. If adults are kept in a tent in the sun on a hot day, they will die if not provided with honey water.
Experiment: Do caterpillars seek optimum temperatures?
Students could experiment by setting up a "temperature gradient," meaning a caterpillar habitat with varying temperature inside. Hot air rises, so if you gently heat the top of a container, inside the top will be warmer and the bottom cooler. Put a number of digital thermometers inside to confirm temperatures.
Place a number of tall milkweed plants inside. Do the caterpillars prefer a certain level (certain temperature) inside the habitat? Draw graphs showing (a) temperature vs. height; (b) number of caterpillars at each level vs. temperature.