The invention relates an optical displacement sensor element comprising two essentially flat surfaces (1,2) being separated by a cavity defined by a spacer (5) and the surfaces (1,2), the distance between the surfaces being variable, wherein a first of said surfaces (1) is positioned on an at least partially transparent carrier (3) and being provided with a reflective pattern, the pattern constituting a pattern being shaped as a diffractive lens, and said second surface (2) being a reflective surface.