Heat is supplied to a gas, causing the particles to move around faster and collide with the surface of the piston. The piston is then pushed because of the increased pressure causing the wheel to turn. Heat is then removed causing the pressure to decrease and the piston starts moving back causing the wheel to turn.