A Scottish pastor and inventor became concerned about his parishioners who worked the local coal mines. Steam engines were used to power pumps and the boilers frequently blew up with disastrous results.
Rev. Stirling developed the closed cycle heat engine bearing his name. It requires a heating and cooling source but no boiler. It runs on air and not steam.
A large displacer moves air between the hot and cold reservoirs. When the air heats, it pushes on a piston and keeps the displacer moving. When the air cools it pulls on the piston and keeps the displacer moving. The displacer moves a quarter of a cycle out of phase with the piston.
Today Stirling engines are used to generate electricity in remote places and on yachts. The may also be used to heat or cool if driven by a motor. They are used for this purpose to cool some optical sensors and also to reach very low temperatures for scientific purposes. Furthermore, if they were used for combined heating, cooling and/or electricity generation in homes, it would be a much more efficient use of natural resources.
This is a precision made Stirling engine that has very low friction. The heat from your hand is sufficient to keep it moving.