a sensor for scanning a surface with an oscillating cantilever , made from piezoelectric material that is suitable for a transverse oscillation of the free end of a beam , holding an electrically conductive probe tip on the free end of the beam in transverse direction , a first deflection electrode and an inversely phased second electrode being provided to collect charges that are separated within the space of the deflection electrodes . the cantilever is provided with at least one electrode in addition to the deflection electrodes that provides electrical contact to the tip , the at least one additional electrode being located in a region on the deflecting beam where the surface charge density due to the strain caused by beam deflection is smaller than in the region where the deflection electrodes are located .