The inductive proximity sensor is a great tool for your 3D printer. It uses electric induction to detect when a conductive metal is very close without actually touching. It is incredibly accurate and it will stay calibrated after repeated use, unlike a touch probe or a contact switch that might shift a little every time it is bumped.
This sensor runs on 12v. For your 5v or 3.3v circuits you will need to use a voltage divider.