A scanning tunneling microscope (STM) is a type of microscope used for imaging surfaces at the atomic level. Its development in 1981 earned its inventors, Gerd Binnig and Heinrich Rohrer, then at IBM Zürich, the Nobel Prize in Physics in 1986.    STM senses the surface by using an extremely sharp conducting tip that can distinguish features smaller than 0.1 nm with a 0.01 nm (10 pm) depth resolution.  This means that individual atoms can routinely be imaged and manipulated. Most microscopes are built for use in ultra-high vacuum at temperatures approaching zero kelvin, but variants exist for studies in air, water and other environments, and for temperatures over 1000 °C.  
STM is based on the concept of quantum tunneling. When the tip is brought very near to the surface to be examined, a bias voltage applied between the two allows electrons to tunnel through the vacuum separating them. The resulting tunneling current is a function of the tip position, applied voltage, and the local density of states (LDOS) of the sample. Information is acquired by monitoring the current as the tip scans across the surface, and is usually displayed in image form. 
A refinement of the technique known as scanning tunneling spectroscopy consists of keeping the tip in a constant position above the surface, varying the bias voltage and recording the resultant change in current. Using this technique the local density of the electronic states can be reconstructed.  This is sometimes performed in high magnetic fields and in presence of impurities to infer the properties and interactions of electrons in the studied material.
Scanning tunneling microscopy can be a challenging technique, as it requires extremely clean and stable surfaces, sharp tips, excellent vibration isolation, and sophisticated electronics. Nonetheless, many hobbyists build their own microscopes. 
The tip is brought close to the sample by a coarse positioning mechanism that is usually monitored visually. At close range, fine control of the tip position with respect to the sample surface is achieved by piezoelectric scanner tubes whose length can be altered by a control voltage. A bias voltage is applied between the sample and the tip, and the scanner is gradually elongated until the tip starts receiving the tunneling current. The tip–sample separation w is then kept somewhere in the 4–7 Å (0.4–0.7 nm) range, slightly above the height where the tip would experience repulsive interaction (w<3Å), but still in the region where attractive interaction exists (3<w<10Å).  The tunneling current, being in the sub- nanoampere range, is amplified as close to the scanner as possible. Once tunneling is established, the sample bias and tip position with respect to the sample are varied according to the requirements of the experiment.
As the tip is moved across the surface in a discrete x–y matrix, the changes in surface height and population of the electronic states cause changes in the tunneling current. Digital images of the surface are formed in one of the two ways: in the constant height mode changes of the tunneling current are mapped directly, while in the constant current mode the voltage that controls the height (z) of the tip is recorded while the tunneling current is kept at a predetermined level. 
In constant current mode, feedback electronics adjust the height by a voltage to the piezoelectric height control mechanism. If at some point the tunneling current is below the set level, the tip is moved towards the sample, and vice versa. This mode is relatively slow as the electronics need to check the tunneling current and adjust the height in a feedback loop at each measured point of the surface. When the surface is atomically flat, the voltage applied to the z-scanner will mainly reflect variations in local charge density. But when an atomic step is encountered, or when the surface is buckled due to reconstruction, the height of the scanner will also have to change because of the overall topography. The image formed of the z-scanner voltages that were needed to keep the tunneling current constant as the tip scanned the surface will thus contain both topographical and electron density data. In some cases it may not be clear whether height changes came as a result of one or the other.
In constant height mode, the z-scanner voltage is kept constant as the scanner swings back and forth across the surface and the tunneling current, exponentially dependent on the distance, is mapped. This mode of operation is faster, but on rough surfaces, where there may be large adsorbed molecules present, or ridges and groves, the tip will be in danger of crashing.
The raster scan of the tip is anything from a 128×128 to a 1024×1024 (or more) matrix, and for each point of the raster a single value is obtained. The images produced by STM are therefore grayscale, and color is only added in post-processing in order to visually emphasize important features.
In addition to scanning across the sample, information on the electronic structure at a given location in the sample can be obtained by sweeping the bias voltage (along with a small AC modulation to directly measure the derivative) and measuring current change at a specific location.  This type of measurement is called scanning tunneling spectroscopy (STS) and typically results in a plot of the local density of states as a function of the electrons' energy within the sample. The advantage of STM over other measurements of the density of states lies in its ability to make extremely local measurements. This is how, for example, the density of states at an impurity site can be compared to the density of states around the impurity and elsewhere on the surface. 
The main components of a scanning tunneling microscope are the scanning tip, piezoelectrically controlled height (z axis) and lateral (x and y axes) scanner, and coarse sample-to-tip approach mechanism. The microscope is controlled by dedicated electronics and a computer. The system is supported on a vibration isolation system. 
The tip is often made of tungsten or platinum-iridium wire, though gold is also used.  Tungsten tips are usually made by electrochemical etching, and platinum-iridium tips by mechanical shearing. The resolution of an image is limited by the radius of curvature of the scanning tip. Sometimes, image artefacts occur if the tip has more than one apex at the end; most frequently double-tip imaging is observed, a situation in which two apices contribute equally to the tunneling.  While several processes for obtaining sharp, usable tips are known, the ultimate test of quality of the tip is only possible when it is tunneling in the vacuum. Every so often the tips can be conditioned by applying high voltages when they are already in the tunneling range, or by making them pick up an atom or a molecule from the surface.
In most modern designs the scanner is a hollow tube of a radially-polarized piezoelectric with metallized surfaces. The outer surface is divided into four long quadrants to serve as x and y motion electrodes with deflection voltages of two polarities applied on the opposing sides. The tube material is a lead zirconate titanate ceramic with a piezo constant of some 5 nanometers per volt. The tip is mounted at the center of the tube. Because of some crosstalk between the electrodes and inherent nonlinearities, the motion is calibrated and voltages needed for independent x, y and z motion applied according to calibration tables. 
Due to the extreme sensitivity of the tunneling current to the separation of the electrodes, proper vibration isolation or a rigid STM body is imperative for obtaining usable results. In the first STM by Binnig and Rohrer, magnetic levitation was used to keep the STM free from vibrations; now mechanical spring or gas spring systems are often employed.  Additionally, mechanisms for vibration damping using eddy currents are sometimes implemented. Microscopes designed for long scans in scanning tunneling spectroscopy need extreme stability and are built in anechoic chambers—dedicated concrete rooms with acoustic and electromagnetic isolation that are themselves floated on vibration isolation devices inside the laboratory.
Maintaining the tip position with respect to the sample, scanning the sample and acquiring the data is computer controlled. Dedicated software for scanning probe microscopies is used for image processing as well as performing quantitative measurements. 
Some scanning tunneling microscopes are capable of recording images at high frame rates.   Videos made of such images can show surface diffusion  or track adsorption and reactions on the surface. In video-rate microscopes, frame rates of 80 Hz have been achieved with fully working feedback that adjusts the height of the tip. 
Quantum tunneling of electrons is a functioning concept of STM that arises from quantum mechanics. Classically, a particle hitting an impenetrable barrier will not pass through. If the barrier is described by a potential acting along z-direction in which an electron of mass me acquires the potential energy U(z), the electron's trajectory will be deterministic, and such that the sum E of its kinetic and potential energies is at all times conserved,
The electron will have a defined, non-zero momentum p only in regions where the initial energy E is greater than U(z). In quantum physics, however, particles with a very small mass, such as the electron, have discernible wavelike characteristics and are allowed to leak into classically forbidden regions. This is referred to as tunneling. 
The simplest model of tunneling between the sample and the tip of a scanning tunneling microscope is that of a rectangular potential barrier.   An electron of energy E is incident upon an energy barrier of height U, in the region of space of width w. An electron's behavior in the presence of a potential U(z), assuming one-dimensional case, is described by wave functions that satisfy Schrödinger’s equation,
Here, ħ is the reduced Planck’s constant, z is the position, and me is the mass of an electron. In the zero-potential regions on two sides of the barrier, the wave function takes on the following form
Here, . Inside the barrier, where E < U, the wave function is a superposition of two terms, each decaying from one side of the barrier
The coefficients r and t provide measure of how much of the incident electron's wave is reflected or transmitted through the barrier. Namely, of the whole impinging particle current only will be transmitted, as can be seen from the probability current expression
which evaluates to . The transmission coefficient is obtained from the continuity condition on the three parts of the wave function and their derivatives at z=0 and z=w (detailed derivation is in the article Rectangular potential barrier). This gives where . The expression can be further simplified, as follows:
In STM experiments, typical barrier height is of the order of the material's surface work function W, which for most metals has a value between 4 and 6 eV.  The work function is the minimum energy needed to bring an electron from an occupied level, the highest of which is the Fermi level (for metals at T=0 kelvin), to vacuum level. The electrons can tunnel between two metals only from occupied states on one side into the unoccupied states of the other side of the barrier. Without bias, Fermi energies are flush and there is no tunneling. Bias shifts electron energies in one of the electrodes higher, and those electrons that have no match at the same energy on the other side will tunnel. In experiments, bias voltages of a fraction of 1 V are used, so is of the order of 10 to 12 nm−1, while w is a few tenths of a nanometer. The barrier is strongly attenuating. The expression for the transmission probability reduces to . The tunneling current from a single level is therefore 
where both wave vectors depend on the level's energy E; and .
Tunneling current is exponentially dependent on the separation of the sample and the tip, and typically reduces by an order of magnitude when the separation is increased by 1 Å (0.1 nm).  Because of this, even when tunneling occurs from a non-ideally sharp tip, the dominant contribution to the current is from its most protruding atom or orbital. 
As a result of the restriction that the tunneling from an occupied energy level on one side of the barrier requires an empty level of the same energy on the other side of the barrier, tunneling occurs mainly with electrons near the Fermi level. The tunneling current can be related to the density of available or filled states in the sample. The current due to an applied voltage V (assume tunneling occurs from the sample to the tip) depends on two factors: 1) the number of electrons between the Fermi level EF and EF−eV in the sample, and 2) the number among them which have corresponding free states to tunnel into on the other side of the barrier at the tip.  The higher the density of available states in the tunneling region the greater the tunneling current. By convention, a positive V means that electrons in the tip tunnel into empty states in the sample; for a negative bias, electrons tunnel out of occupied states in the sample into the tip. 
For small biases and temperatures near absolute zero, the number of electrons in a given volume (the electron concentration) that are available for tunneling is the product of the density of the electronic states ρ(EF) and the energy interval between the two Fermi levels, eV.  Half of these electrons will be travelling away from the barrier. The other half will represent the electric current impinging on the barrier, which is given by the product of the electron concentration, charge, and velocity v (Ii=nev), 
The tunneling electric current will be a small fraction of the impinging current. The proportion is determined by the transmission probability T,  so
In the simplest model of a rectangular potential barrier the transmission probability coefficient T equals |t|2.
A model that is based on more realistic wave functions for the two electrodes was devised by John Bardeen in a study of the metal-insulator-metal junction.  His model takes two separate orthonormal sets of wave functions for the two electrodes and examines their time evolution as the systems are put close together.   Bardeen's novel method, ingenious in itself,  solves a time-dependent perturbative problem in which the perturbation emerges from the interaction of the two subsystems rather than an external potential of the standard Rayleigh–Schrödinger perturbation theory.
Each of the wave functions for the electrons of the sample (S) and the tip (T) decay into the vacuum after hitting the surface potential barrier, roughly of the size of the surface work function. The wave functions are the solutions of two separate Schrödinger's equations for electrons in potentials US and UT. When the time dependence of the states of known energies and is factored out, the wave functions have the following general form
If the two systems are put closer together, but are still separated by a thin vacuum region, the potential acting on an electron in the combined system is UT + US. Here, each of the potentials is spatially limited to its own side of the barrier. Only because the tail of a wave function of one electrode is in the range of the potential of the other, there is a finite probability for any state to evolve over time into the states of the other electrode.  The future of the sample's state μ can be written as a linear combination with time-dependent coefficients of and all ,
with the initial condition .  When the new wave function is inserted into the Schrödinger’s equation for the potential UT + US, the obtained equation is projected onto each separate (that is, the equation is multiplied by a and integrated over the whole volume) to single out the coefficients . All are taken to be nearly orthogonal to all (their overlap is a small fraction of the total wave functions), and only first order quantities retained. Consequently, the time evolution of the coefficients is given by
Because the potential UT is zero at the distance of a few atomic diameters away from the surface of the electrode, the integration over z can be done from a point zo somewhere inside the barrier and into the volume of the tip (z>zo).
If the tunneling matrix element is defined as
the probability of the sample's state μ evolving in time t into the state of the tip ν is
In a system with many electrons impinging on the barrier, this probability will give the proportion of those that successfully tunnel. If at a time t this fraction was , at a later time t+dt the total fraction of would have tunneled. The current of tunneling electrons at each instance is therefore proportional to divided by , which is the time derivative of , 
The time scale of the measurement in STM is many orders of magnitude larger than the typical femtosecond time scale of electron processes in materials, and is large. The fraction part of the formula is a fast oscillating function of that rapidly decays away from the central peak where . In other words, the most probable tunneling process, by far, is the elastic one, in which the electron's energy is conserved. The fraction, as written above, is a representation of the delta function, so
Solid-state systems are commonly described in terms of continuous rather than discrete energy levels. The term can be thought of as the density of states of the tip at energy , giving
The number of energy levels in the sample between the energies and is . When occupied, these levels are spin-degenerate (except in a few special classes of materials) and contain charge of either spin. With the sample biased to voltage , tunneling can occur only between states whose occupancies, given for each electrode by the Fermi–Dirac distribution , are not the same, that is, when either one or the other is occupied, but not both. That will be for all energies for which is not zero. For example, an electron will tunnel from energy level in the sample into energy level in the tip (), an electron at in the sample will find unoccupied states in the tip at (), and so will be for all energies in-between. The tunneling current is therefore the sum of little contributions over all these energies of the product of three factors: representing available electrons, for those that are allowed to tunnel, and the probability factor for those that will actually tunnel.
Typical experiments are run at a liquid helium temperature (around 4 K) at which the Fermi level cut-off of the electron population is less than a millielectronvolt wide. The allowed energies are only those between the two step-like Fermi levels, and the integral becomes
When the bias is small, it is reasonable to assume that the electron wave functions and, consequently, the tunneling matrix element do not change significantly in the narrow range of energies. Then the tunneling current is simply the convolution of the densities of states of the sample surface and the tip,
How the tunneling current depends on distance between the two electrodes is contained in the tunneling matrix element
This formula can be transformed so that no explicit dependence on the potential remains. First, the part is taken out from the Schrödinger equation for the tip, and the elastic tunneling condition is used so that
Now is present in the Schrödinger equation for the sample, and equals the kinetic plus the potential operator acting on . However, the potential part containing US is on the tip side of the barrier nearly zero. What remains,
can be integrated over z because the integrand in the parentheses equals .
Bardeen's tunneling matrix element is an integral of the wave functions and their gradients over a surface separating the two planar electrodes,
The exponential dependence of the tunneling current on the separation of the electrodes comes from the very wave functions that leak through the potential step at the surface and exhibit exponential decay into the classically forbidden region outside of the material.
The tunneling matrix elements show appreciable energy dependence, which is such that tunneling from the upper end of the eV interval is nearly an order of magnitude more likely than tunneling from the states at its bottom. When the sample is biased positively, its unoccupied levels are probed as if the density of states of the tip is concentrated at its Fermi level. Conversely, when the sample is biased negatively, its occupied electronic states are probed but the spectrum of the electronic states of the tip dominates. In this case it is important that the density of states of the tip is as flat as possible. 
The results identical to Bardeen's can be obtained by considering adiabatic approach of the two electrodes and using the standard time-dependent perturbation theory.  This leads to Fermi's golden rule for the transition probability in the form given above.
Bardeen's model is for tunneling between two planar electrodes and does not explain scanning tunneling microscope's lateral resolution. Tersoff and Hamann    used Bardeen's theory and modeled the tip as a structureless geometric point.  This helped them disentangle the properties of the tip—which are hard to model—from the properties of the sample surface. The main result was that the tunneling current is proportional to the local density of states of the sample at the Fermi level taken at the position of the center of curvature of a spherically-symmetric tip (s-wave tip model). With such a simplification, their model proved valuable for interpreting images of surface features bigger than a nanometer, even though it predicted atomic-scale corrugations of less than a picometer. These are well below the microscope's detection limit and below the values actually observed in experiments.
In sub-nanometer resolution experiments, the convolution of the tip and sample surface states will always be important, to the extent of the apparent inversion of the atomic corrugations that may be observed within the same scan. Such effects can only be explained by modeling of the surface and tip electronic states and the ways the two electrodes interact from first principles.
A 7 nm long part of a single-walled carbon nanotube.
Atoms on the surface of a crystal of silicon carbide (SiC) are arranged in a hexagonal lattice and are 0.3 nm apart.
An earlier invention similar to Binnig and Rohrer's, the Topografiner of R. Young, J. Ward, and F. Scire from the NIST, relied on field emission.  However, Young is credited by the Nobel Committee as the person who realized that it should be possible to achieve better resolution by using the tunnel effect. 
Many other microscopy techniques have been developed based upon STM. These include photon scanning microscopy (PSTM), which uses an optical tip to tunnel photons;  scanning tunneling potentiometry (STP), which measures electric potential across a surface;  spin polarized scanning tunneling microscopy (SPSTM), which uses a ferromagnetic tip to tunnel spin-polarized electrons into a magnetic sample;  multi-tip scanning tunneling microscopy which enables electrical measurements to be performed at the nanoscale; and atomic force microscopy (AFM), in which the force caused by interaction between the tip and sample is measured.
STM can be used to manipulate atoms and change the topography of the sample. This is attractive for several reasons. Firstly the STM has an atomically precise positioning system which enables very accurate atomic scale manipulation. Furthermore, after the surface is modified by the tip, the same instrument can be used to image the resulting structures. IBM researchers famously developed a way to manipulate xenon atoms adsorbed on a nickel surface.  This technique has been used to create electron corrals with a small number of adsorbed atoms, and observe Friedel oscillations in the electron density on the surface of the substrate. Aside from modifying the actual sample surface, one can also use the STM to tunnel electrons into a layer of electron beam photoresist on the sample, in order to do lithography. This has the advantage of offering more control of the exposure than traditional electron beam lithography. Another practical application of STM is atomic deposition of metals (gold, silver, tungsten, etc.) with any desired (pre-programmed) pattern, which can be used as contacts to nanodevices or as nanodevices themselves.[ citation needed]