this thing helps you to easily fine tune z offset.
the spring radius is 3mm and the length is not important , you can buy a long spring then cut it for a suitable length for your 3d printer .
the screw radius is 4mm
you can buy the optical endstop sensor from aliexpress.com .
optical endstops are compatible with most 3d printer boards.
that black thing in the pictures is a normal female pin header .
drill the pin header to connect the spring to it .
notice : if you want to print it with ABS , its better to scale it up a little .
i designed this with solidworks.