  Feynman's ratchet is a microscopic machine in contact with two heat
reservoirs, at temperatures $T_A$ and $T_B$, that was proposed by Richard
Feynman to illustrate the second law of thermodynamics. In equilibrium
($T_A=T_B$), thermal fluctuations prevent the ratchet from generating directed
motion. When the ratchet is maintained away from equilibrium by a temperature
difference ($T_A \ne T_B$), it can operate as a heat engine, rectifying thermal
fluctuations to perform work. While it has attracted much interest, the
operation of Feynman's ratchet as a heat engine has not been realized
experimentally, due to technical challenges. In this work, we realize Feynman's
ratchet with a colloidal particle in a one dimensional optical trap in contact
with two heat reservoirs: one is the surrounding water, while the effect of the
other reservoir is generated by a novel feedback mechanism, using the
Metropolis algorithm to impose detailed balance. We verify that the system does
not produce work when $T_A=T_B$, and that it becomes a microscopic heat engine
when $T_A \ne T_B$. We analyze work, heat and entropy production as functions
of the temperature difference and external load. Our experimental realization
of Feynman's ratchet and the Metropolis algorithm can also be used to study the
thermodynamics of feedback control and information processing, the working
mechanism of molecular motors, and controllable particle transportation.
