There is described a position sensor comprising at least one planar substrate having formed thereon a magnetic field generator which comprises conductive tracks formed on at least two planes defined by the at least one planar substrate. An intermediate coupling element is operable to move relative to the at least one planar substrate along a measurement direction transverse to the planar substrate, the detector detects the position of the intermediate coupling element in a magnetic field generated by the magnetic field generator. The position sensor has particular application in man-machine interfaces such as push buttons and rotary switches.