Yesterday, I built a small Stirling engine from a cardboard kit. The kit included 4 cardboard pages of pre-punched parts, metal base plates & plastic side strips, a foam displacement piston, a few metal rods & plastic bearings and a latex glove. The kit is very well made and the instructions are fairly clear but there are few pictures. It was difficult to get the engine airtight at first; I ended up adding a lot of extra glue to make it airtight. Also required were: 2 component glue, all purpose glue, sandpaper, silicone oil. The latex glove isn't to stop fingers getting sticky with the glue; one of the latex glove fingers is used as part of the working piston, as a flexible seal.
In the video below the Stirling engine is powered by a cup of hot water which heats the base of the engine. This forces the air in the cylinder to expand pushing the working piston up (the one with the latex seal). The air is alternately heated and cooled as the displacement piston (the big foam piston in the cylinder) moves the air back and forth between the cylinder's hot and cool parts. As the air is cooled the working piston is pulled down by the drop in pressure caused by the compression of the air. The momentum of the fly-wheel keeps the displacement piston moving, repeatedly moving air between the hot and cool parts of the cylinder.
The Stirling engine was patented in 1816 by Robert Stirling, a Scottish clergyman, as a competitor to the steam engine. There are different types of Stirling engine; the one here is a low-temperature differential engine. There is a nice animation and explanation of this type of Stirling engine here. This type of engine is usually used for demonstration purposes, as they are low powered; however, some large versions have been built such as this large solar powered engine which can be used for pumping water. Stirling engines can achieve up to 40% efficiency.
Any heat source can be used to heat the bottom of this engine - a cup of tea, hot water, a flame, solar. Alternatively, the engine can be run in reverse by cooling the base instead of heating (e.g. using ice) - the top will then be the hotter area.