2 T2 T3 T4 I$_{dc}$ T2 Spring beam Engine beam 10 m GLYPH<c109> 2 m GLYPH<c109> [100] [010] T1 Resonator mass T1 I$_{dc}$ a I$_{dc}$ Mechanical motion Mass Spring beam Engine beam v$_{ac}$$^{R}$ + r dc ac x y z Output signal (T1) Ground (T2) b I$_{dc}$ Z load R +r beam ac R$_{0}$ V +v dc ac i$_{ac}$ Spectrum analyser Voltage amplifier 1:1 T1 T2 m x 54 nF C$_{1}$ r =K R x R =R +R =794 ac pr dc dc beam 0 GLYPH<c87> 70 pF 12 k GLYPH<c87> C$_{0}$ Z$_{tot}$ c d resistance r$_{ac}$ elasticity force F displacement x piezo- resistive effect thermal expansion resistive heating ( ) GLYPH<c181> I$_{dc}$ thermodynamic feedback heating power T$_{b}$ p$_{pr}$ temperature heat capacitance & conductance +F$_{te}$ +F$_{ext}$ e V, GLYPH<c101> P,- GLYPH<c115> 2 3 4 1 p - $_{pr}$GLYPH<c181> GLYPH<c101> W$_{e}$ p <0 pr T =T b avg 2 p =0 pr T <T b avg 3 p >0 pr T =T b avg 4 f p =0 pr T >T b avg 1 T$_{b}$ T$_{b}$ T$_{b}$ T$_{b}$ 2 v$_{ac}$ FIG. 1: Micrograph, schematics (not to scale), m easurement circuit and operation mechanism of the piezore- sistive heat engine and refrigerator. a Scanning electron microscope (SEM) image of the heat engine. The inset shows a magnification of the wide spring beam and narrow engin e beam by which the resonator mass m is suspended. b Schematic of the device and electrical connections used for the measur ements in Fig. 2b,c,d. c Schematic of the device and electrical circuit used for the measurements in Fig. 3 and 4. d Besides the elastic coupling between displacement and force, a thermally delayed feedback mechanism via the internal electrical and ther mal variables occurs in a piezoresistive spring in the presence of a DC current flow. e Schematic thermodynamic cycle in the piezoresistive spring, when the device is operating at a single frequency as a heat engine. As a result of thermal delay, the temp erature T$_{b}$ and stress σ are phase shifted with respect to the strain ε and piezoresistive heating power p pr . The axes indica te the longitudinal strain ε and stress σ , which are proportional to the volume change V and pressure P respectively. Therefo re the engine beam expands at a higher temperature than at which it is compressed. It thus generates an amount of mechanical work W e from piezoresistive heat during each cycle. f Illustration of the phases - of the thermodynamic cycle shown in 1 e, which are identified by the AC resistive heating power p pr and beam temperature T$_{b}$ . To illustrate the position dependent h eating power a fictitious external heat sink (blue) and source (red) are drawn. In reality the internal heating power in the bea m depends on its position as a result of the piezoresistive effect. constant k , this will not just result in an elastic force, but will also result in a resistance variation r$_{ac}$ via the piezoresistive effect. If a constant DC current I$_{dc}$ is flow- ing through the spring, the resistive heating power there- fore changes by p$_{pr}$ = I 2 $_{dc}$r$_{ac}$ and causes a temperature change, which in turn will generate a thermal expansion force F$_{te}$ that adds to the external forces F$_{ext}$ on the spring, such that kx = F$_{te}$ + F$_{ext}$ . The amplitude and the thermal phase-delay of the thermal expansion feedback force F$_{te}$ can be described by a complex coefficient β which is defined by F$_{te}$ = βI 2 $_{dc}$kx . The coefficient β can be calculated from the material con- stants and geometry of the spring (see Supplementary Discussion A). The response of the piezoresistive spring to an external force can now be described by a complex spring constant k ∗ eff ≡ F$_{ext}$/x = k (1 − βI 2 $_{dc}$). When the piezoresistive spring is coupled to a mass m , it forms a resonator that can store energy U$_{i}$ similar to the flywheel of a conventional heat engine. In the absence of current ( I$_{dc}$ = 0 A), the resonator’s intrinsic damping can be ex- pressed by a Q -factor Q$_{int}$ and its resonance frequency The observed oscillation of the heat engine is at- tributed to the thermodynamic feedback mecha nism which is schematically shown in Fig. 1d. When an al- ternating mechanical displacement x = x$_{0}$e iωt w it h fre- quency ω is applied to a piezoresistive beam with s pring sinusoidal output voltage v$_{ac}$ with a frequency o f 1.26 MHz. Oscilloscope and spectrum analyser measurem ents of the signal are shown in Fig. 2b, 2c and 2d. The mo tion of the device is also studied by stroboscopic illumina tion under a microscope. The stroboscope is triggered by the electrical output v$_{ac}$ of the heat engine. By adjustin g the phase delay of the stroboscope a slow-motion mov ie of the engine’s sinusoidal motion is made (see Supple men- tary Video). Stroboscopic and electrical measure ments show that just above I$_{t}$ the displacement amplitu de of the mass depends very sensitively on the DC current I$_{dc}$ . If I$_{dc}$ is increased more than 50 µ A above I$_{t}$ , the op tically observed mechanical amplitude x stops increasing and is saturated by collisions of the resonator mass against elec- trode T3. This amplitude saturation is also observe d in the piezoresistance variations r$_{ac}$ .