STM is based on the concept that the tunneling current between a conductive tip and sample is exponentially dependent on their separation. This can be represented by the equation I~Ve-cd ,where I is the tunneling current, V is the bias voltage between sample and tip, c is the constant, and d represents the separation distance between the tip and sample.
As the tip scans the sample surface, it encounters sample features of different heights, resulting in an exponential change in the tunneling current. A feedback loop is used to maintain a constant tunneling current during scanning by vertically moving the scanner at each (x, y) data point until a "setpoint" current is reached. The vertical position of the scanner at each (x, y) data point is stored by the computer to form the topographic image of the sample surface. This technique is typically limited to conductive and semi-conductive surfaces.
Scanning Probe Microscopy Training Notebook, Digital Instruments, Veeco Metrology Group