Moving to 3mm +/- 1mm to an irregular surface

I need to move object A (dispenser tip) to object B (irregular surface).

While dispensing, I need to have A about 3mm +/- 1mm from the surface of the B at all times. What kind of sensor I can use to measure distance between A & B with this kind of accuracy?

Provide a clear description of the "irregular surface".

Are you allowed to have, say, a small wheel that runs along the irregular surface ?

You need to tell us how the irregular surface varies - the height between peaks and valleys and the distance between peaks.

...R

Irregular surface resembles a human hand. Hence Peaks are about 25mm while valleys are about 10mm.

I prefer not to run anything physical on the surface, instead a contactless solution is what I am looking for. Thanks

Low distance sensors certainly exist

Did you want to interface it with Arduino?

kashif_izhar:
Irregular surface resembles a human hand. Hence Peaks are about 25mm while valleys are about 10mm.

Does that mean a range of 35mm ?

Who has fingers 35 mm in diameter ?

If you are talking about the "valley" between closed fingers the slope will be very steep.

Can you post a cross-section drawing of your irregular surface ?

...R