The sensor's laser diode projects a beam of light onto the target object. Some of the light is reflected off the object onto a light-sensitive detector built into the sensor. The detector records the position of the reflected beam and reports a height measurement. If the target or the sensor moves, the position of the reflection on the detector changes. The sensor calculates the amount of change based on the new spot position on the detector.
Triangulation sensors turn up in a variety of guises.
Each has its pluses and minuses. Choosing the right tool requires knowing what each does well. Microscopes are excellent for visual inspection but collecting quantifiable measurements requires the operator to manipulate x and y measurement stages. Some microscopes provide overall height measurement. However, determining z at a particular point on the target is laborious and time-consuming.