This invention provides heat engines based on various structures of internal combustion engines, such as a four-stroke piston-type combustion engine, two-stroke piston-type combustion engine, rotary combustion engine, or a free-piston type combustion engine. Said heat engine is provided with at least a heating chamber per piston or rotor, a heat exchanger unit disposed within said heating chamber through which thermal energy is extracted from a heat source and at least a port leading to a working chamber space from said heating chamber, and has a significantly increased heat transfer duration from the heat source to the working fluid within said heating chamber without increasing the number of strokes per power stroke in a cycle. Additionally, said heat engine is provided with an over expansion mechanism in conjunction with a compression means for intake charge. Thereby many of the operational characteristics of an Otto power cycle may be attained in said heat engine, and a heat source with a relatively low temperature may be accommodated through the combination of a lower compression ratio, the over expansion mechanism, and the boost of the intake charge.Another major objective of this invention is to provide a refrigerator based on the structures of the various heat engines disclosed in this invention and having a reversed operation of the heat engine. The invention combines the compression functionality of a compressor and the expansion functionality of a turbine in an air cycle machine into a single refrigerator unit having a simple mechanical structure, and provides a significantly increased heat removal rate or duration before the expansion stroke to reduce the temperature of the working fluid without increasing the number of strokes per discharge stroke of cooled working fluid in the cycle. Said refrigerator may include the over expansion mechanism or working fluid pressurization to increase the coefficient of performance and cooling load. In particular, said refrigerator uses a gas as the working fluid to avoid the negative impact of a conventional refrigerant on the environment.