A position sensor includes a flexible substrate formed into a three-dimensional (3D) shape. At least first and second field-sensing coils are formed in first and second respective layers of the flexible substrate, such that in the 3D shape the first and second field-sensing coils have first and second respective axes that are not parallel to one another.