A Piston engine is a heat engine that uses one or more pistons to convert pressure into a rotating motion. The main types are the internal combustion engine used extensively in motor vehicles, the steam engine which was the mainstay of the industrial revolution and the niche application Stirling engine.
There may be one or more pistons. Each piston is inside a cylinder, into which a gas is introduced, either already hot and under pressure (steam engine), or heated inside the cylinder either by ignition of a fuel air mixture (internal combustion engine) or by contact with a hot heat exchanger in the cylinder (Stirling engine). The hot gases expand, pushing the piston to the bottom of the cylinder. The piston is returned to the cylinder top (Top Dead Centre) either by a flywheel or the power from other pistons connected to the same shaft. In most types the expanded or "exhausted" gases are removed from the cylinder by this stroke. The exception is the Stirling engine, which repeatedly heats and cools the same sealed quantity of gas.
In some designs the piston may be powered in both directions in the cylinder in which case it is said to be double acting.