This toy is a mini Sterling Engine. It demonstrates the cyclic process of a heat engine. Heat is taken in from the hot plate, partly converted into mechanical work to turn the wheel, and partly “wasted” as heat dumped to the cold plate.
It takes time for heat transfer through conduction, convection or radiation. Compressing or expanding a gas, on the other hand, can be completed in a split second.
As such, if we plunge the piston into the syringe suddenly, we get what is practically an adiabatic compression, accompanied by a dramatic increase in temperature.
Similarly, if we “pop the champagne” and let the air out suddenly, we get what is practically an adiabatic expansion., accompanied by a dramatic decrease in temperature.
This applet provides a microscopic view of the first law of thermodynamics. Click here for the applet’s url.
Basically, heating is not the only way to change the temperature of a gas. The other way is to do work on it. If the piston charges towards the gas molecules, KE is passed to the gas molecules through the collisions. Higher average KE of gas molecules means higher temperature. On the other hand, if the piston moves away from the gas molecules, the gas molecules actually lose KE through the collisions. The gas cools down since its average KE has been lowered.
Here is a nice applet to visualise the motion of gas molecules in a gas. (Click here for the applet’s url)
The speeds of the molecules are faster at higher temperatures. But at any one temperature, the speeds of the molecules are not uniform. In fact, the distribution of speed follows the Maxwell-Boltzman’s distribution (shown in the histogram at the bottom of the applet). The gas molecules are also colour coded according to their speeds in this applet. Did you notice that the speed of the gas molecules are unchanged when colliding with the walls? When they collide with one another, their speeds do get changed as they exchange momentum. But because they are all elastic collisions, the total (and thus average) KE of the gas remains constant.
The Khan-academy has a very neat write-up on the Maxwell-Boltzman’s distribution. Click here.
Most real gases at standard temperature and pressure do not deviate too far from pV=nRT . Even when they do, the ideal gas equation still provides a good model for qualitative understanding of how the state varibles p, V and T play out.