The Stirling engine was invented in 1816 by Robert Stirling as an alternative to steam engines due to their explosions. It works by alternately compressing and expanding a fixed quantity of air or other gas between a hot and cold section, driving a piston. There are three main types - alpha, beta, and gamma - distinguished by how they move the air between sections. Advantages include various heat sources, low pressure operation, and efficiency theoretically equal to Carnot efficiency. Applications include water pumps, solar power, micro-CHP, and cryocoolers.