The atomic force microscope (AFM) consists of a cantilever with a sharp tip at its end. The tip is brought into close proximity of a sample surface. The force between the tip and the sample leads to a deflection of the cantilever according to Hooke's law. Typically, the deflection is measured using a laser interferometer.

If the tip were scanned at constant height, there would be a risk that the tip would collide with the surface, causing damage. Hence, in most cases a feedback mechanism is employed to adjust the tip-to-sample distance to keep the force between the tip and the sample constant. This can be achieved by mounting the sample on a piezoelectric crystal.

The tip is then scanned across the sample surface and the vertical displacement s necessary to maintain a constant force on the tip is recorded. The resulting map of s(x,y) represents the topography of the sample.

See also: scanning tunneling microscope