Atomic force microscopy is a type of scanning probe microscopy that maps the surface of a sample with a sharp tip microfabricated onto the end of a cantilever.
Imaging is performed by raster scanning the tip across the sample to sense short-range molecular interactions (van der Waals, hydrogen bonding, steric repulsion), as well as mechanical contact forces, long-range electrostatic and magnetic interactions, and capillary meniscus forces between the tip and surface.
As the tip encounters changes in the surface, the cantilever, which acts as a flexible spring, deflects accordingly (or in dynamic modes, its oscillation changes). Changes in the cantilever deflection (or oscillation) are usually detected using a laser and compensated for by changing the tip-sample distance. These positional changes required to keep the cantilever deflection (or oscillation amplitude) constant are used to form the image of the sample surface.
In addition to imaging, spectroscopic modes can be used that provide maps of elastic modulus, adhesion, membrane rupture, ligand-receptor unbinding, and molecular unfolding.