Micro gap measurement by vibration mode for needle-type dispenser