The Stirling engine was invented in 1816 by Robert Stirling as a safer alternative to steam engines. It works by alternately compressing and expanding a fixed amount of working fluid between a hot and cold section, driving a piston for power generation. Key components include pistons and a displacer. Advantages over steam engines include operating at lower pressures safely using various heat sources. Applications include power generation, pumps, refrigeration, and as an alternative power source for vehicles, ships and nuclear plants. Stirling engines are more efficient than steam and can use solar, waste or other heat sources to run.