Molecular machine
A  molecular machine  has been defined as a discrete number of molecular components that have been designed to perform mechanical-like movements (output) in response to specific stimuli (input). It is often applied more generally to molecules that simply mimic functions at the macroscopic level.  The term is also common in nanotechnology and a number of highly complex molecular machines have been proposed towards the goal of constructing a molecular assembler.  Molecular machines can be divided into two broad categories: synthetic and biological.
Molecular systems that are able to shift a chemical or mechanical process away from equilibrium represent a potentially important branch of chemistry and nanotechnology. By definition these types of systems are examples of molecular machinery, as the gradient generated from this process is able to perform useful work.

# Historical Insight and Studies
There are two thought experiments that form the historical basis for molecular machines; Maxwell's demon and Feynmans Ratchet (or Brownian ratchet). Maxwells Demon is well-described elsewhere, and a slightly different interpretation of Richard Feynmans ratchet is given here.
Imagine a very small system (seen below) of two paddles or gears connected by a rigid axel and it is possible to keep these two paddles at two different temperatures. One of the gears (at T2) has a pawl that is rectifying the system motion, and therefore the axel can only move in a clockwise rotation, and in doing so it could lift a weight (m) upward upon ratcheting. Now imagine if the paddle in box T1 was in a much hotter environment than the gear in box T2; it would be expected that the kinetic energy of the gas molecules (red circles) hitting the paddle in T1 would be much higher, than the gas molecules hitting the gear at T2. Therefore, with lower kinetic energy of the gases in T2 there would be very little resistance from the molecules on colliding with the gear in the statistically opposite direction. Further the ratcheting would allow for directionality, and slowly over time the axle would rotate and ratchet, lifting the weight (m).
As described this system may seem like a perpetual motion machine, however the key ingredient is the heat gradient within the system. This ratchet does not threaten the second law of thermodynamics because this temperature gradient must be maintained by some external means. Brownian motion of the gas particles provides the power to the machine, and the temperature gradient allows the machine to drive the system cyclically away from equilibrium. An interesting design concept in Feynmans ratchet is that random Brownian motion is not fought against but instead harnessed and rectified. Unfortunately, temperature gradients cannot be maintained over molecular scale distances because of molecular vibration redistributing the energy to other parts of the molecule. Furthermore, despite Feynmans machine doing useful work in lifting the mass; using Brownian motion to power a molecular level machine, does not provides any insight on how that power (or potential energy of the lifted weight, m) can be used to perform nanoscale tasks.

# Modern Insights and Studies
Unlike macroscopic motion, molecular systems are constantly undergoing significant dynamic motions subject to the laws of Brownian mechanics (or Brownian motion) and as such, harnessing molecular motion is a far more difficult process. At the macroscopic level, many machines operate in the gas phase and often air resistance is neglected, as it  is insignificant, but analogously for a molecular system in a Brownian environment, molecular motion is similar to walking in a hurricane, or swimming in molasses. The phenomenon of Brownian Motion (observed by Robert Brown (botanist), 1827) was later explained by Albert Einstein in 1905. Einstein found that Brownian motion is a consequence of scale and not the nature of the surroundings. As long as thermal energy is applied to a molecule it will undergo Brownian motion with the kinetic energy appropriate to that temperature. Therefore, like Feynmans strategy, when designing a molecular machine, it seems sensible to utilize Brownian motion rather than attempt to fight against it.
Like macroscopic machines, molecular machines typically have movable parts. However, while the macroscopic machines we encounter in everyday life may provide inspiration for molecular machines, it is misleading to draw analogies between their design strategy; the dynamics of large and small length scales are simply too different. Harnessing Brownian motion and making molecular level machines is regulated by the Second law of thermodynamics, with its often counter-intuitive consequences, and as such we need another inspiration.
Although it is a challenging process to harness Brownian motion, nature has provided us with several blueprints for molecular motion performing useful work. Nature has created many useful structures for compartmentalizing molecular systems, hence creating distinct non-equilibrium distributions; the  is an excellent example. Lipophilic barriers make use of a number of different mechanisms to power motion from one compartment to another.

# Examples of molecular machines
From a synthetic perspective, there are two important types of molecular machines; molecular switches (or shuttles) and molecular motors. The major difference between the two systems is that a switch influences a system as a function of state whereas a motor influences a system as function of trajectory. A switch (or shuttle) may appear to undergo translational motion, but returning a switch to its original position undoes any mechanical effect and liberates energy to the system. Furthermore, switches cannot use chemical energy to repetitively and progressively drive a system away from equilibrium where a motor can.

## Synthetic
A wide variety of rather simple molecular machines have been synthesized by chemists.  They can consist of a singe molecule, however they are often constructed for mechanically-interlocked molecular architectures, such as rotaxanes and catenanes.
- Molecular motors are molecules that are capable of unidirectional rotation motion powered by external energy input.  A number of molecular machines have been synthesized, powered by light or reaction with other molecules.
- A molecular propeller is a molecule that can propel fluids when rotated, due to its special shape that is designed in analogy to macroscopic propellers. It has several molecular-scale blades attached at a certain pitch angle around the circumference of a nanoscale shaft.
- A molecular switch is a molecule that can be reversibly shifted between two or more stable states. The molecules may be shifted between the states in response to changes in e.g. pH, light, temperature, an electrical current, microenvironment, or the presence of a ligand.
- A molecular shuttle in molecule capable of shuttling molecules or ions from one location to another.  A common molecular shuttle consists of a rotaxane where the macrocycle can move between two sites or stations along the dumbbell backbone.
- Molecular tweezers are host molecules capable of holding guests between two arms.  The open cavity of the molecular tweezers binds guests using non-covalent bonding including hydrogen bonding, metal coordination, hydrophobic forces, van der Waals forces, - interactions, and/or electrostatic effects.  Examples of molecular tweezers have been reported that are constructed from DNA and are considered DNA machines.
- A molecular sensor is a molecule that interacts with an analyte to produce a detectable change.  Molecular sensors combine molecular recognition with some form of reporter so the presence of the guest can be observed.
- A molecular logic gate is a molecule that performs a logical operation on one or more logic inputs and produces a single logic output.  Unlike a molecular sensor the molecular logic gate will only output when a particular combination of inputs are presents.

## Biological
The most complex molecular machines are found in within cells.  These include motor proteins, such as, myosin that is responsible for muscle contraction, kinesin that moves cargo inside cells away from the nucleus along microtubules, and dynein that produces the axonemal beating of cilia and flagella.  These proteins are far more complex than any molecular machines that have yet been artificially constructed.

## Theoretical
The construction of more complex molecular machines is an active area of theoretical research.  A number of molecules, such as s, have been designed although experimental studies of these molecules are inhibited by the lack of methods to construct these molecules.  These complex molecular machines the basis of areas of nanotechnology, including molecular assembler.